EV3 Sensors. More...
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "modp_numtoa.h"
#include "crc32.h"
#include "ev3.h"
#include "ev3_port.h"
#include "ev3_sensor.h"
Functions | |
size_t | get_sensor_address (uint8_t sn, char *buf, size_t sz) |
Read "address" attribute of the sensor. More... | |
size_t | get_sensor_bin_data (uint8_t sn, byte *buf, size_t sz) |
Read "bin_data" attribute of the sensor. More... | |
size_t | set_sensor_bin_data (uint8_t sn, byte *value, size_t sz) |
Write "bin_data" attribute of the sensor. More... | |
size_t | multi_set_sensor_bin_data (uint8_t *sn, byte *value, size_t sz) |
Write "bin_data" attribute of several sensors. More... | |
size_t | get_sensor_bin_data_format (uint8_t sn, char *buf, size_t sz) |
Read "bin_data_format" attribute of the sensor. More... | |
size_t | set_sensor_command (uint8_t sn, char *value) |
Write "command" attribute of the sensor. More... | |
size_t | multi_set_sensor_command (uint8_t *sn, char *value) |
Write "command" attribute of several sensors. More... | |
size_t | get_sensor_commands (uint8_t sn, char *buf, size_t sz) |
Read "commands" attribute of the sensor. More... | |
size_t | get_sensor_direct (uint8_t sn, char *buf, size_t sz) |
Read "direct" attribute of the sensor. More... | |
size_t | set_sensor_direct (uint8_t sn, char *value) |
Write "direct" attribute of the sensor. More... | |
size_t | multi_set_sensor_direct (uint8_t *sn, char *value) |
Write "direct" attribute of several sensors. More... | |
size_t | get_sensor_decimals (uint8_t sn, dword *buf) |
Read "decimals" attribute of the sensor. More... | |
size_t | get_sensor_driver_name (uint8_t sn, char *buf, size_t sz) |
Read "driver_name" attribute of the sensor. More... | |
size_t | get_sensor_fw_version (uint8_t sn, char *buf, size_t sz) |
Read "fw_version" attribute of the sensor. More... | |
size_t | get_sensor_mode (uint8_t sn, char *buf, size_t sz) |
Read "mode" attribute of the sensor. More... | |
size_t | set_sensor_mode (uint8_t sn, char *value) |
Write "mode" attribute of the sensor. More... | |
size_t | multi_set_sensor_mode (uint8_t *sn, char *value) |
Write "mode" attribute of several sensors. More... | |
size_t | get_sensor_modes (uint8_t sn, char *buf, size_t sz) |
Read "modes" attribute of the sensor. More... | |
size_t | get_sensor_num_values (uint8_t sn, dword *buf) |
Read "num_values" attribute of the sensor. More... | |
size_t | get_sensor_poll_ms (uint8_t sn, dword *buf) |
Read "poll_ms" attribute of the sensor. More... | |
size_t | set_sensor_poll_ms (uint8_t sn, dword value) |
Write "poll_ms" attribute of the sensor. More... | |
size_t | multi_set_sensor_poll_ms (uint8_t *sn, dword value) |
Write "poll_ms" attribute of several sensors. More... | |
size_t | get_sensor_units (uint8_t sn, char *buf, size_t sz) |
Read "units" attribute of the sensor. More... | |
size_t | get_sensor_value0 (uint8_t sn, float *buf) |
Read "value0" attribute of the sensor. More... | |
size_t | get_sensor_value1 (uint8_t sn, float *buf) |
Read "value1" attribute of the sensor. More... | |
size_t | get_sensor_value2 (uint8_t sn, float *buf) |
Read "value2" attribute of the sensor. More... | |
size_t | get_sensor_value3 (uint8_t sn, float *buf) |
Read "value3" attribute of the sensor. More... | |
size_t | get_sensor_value4 (uint8_t sn, float *buf) |
Read "value4" attribute of the sensor. More... | |
size_t | get_sensor_value5 (uint8_t sn, float *buf) |
Read "value5" attribute of the sensor. More... | |
size_t | get_sensor_value6 (uint8_t sn, float *buf) |
Read "value6" attribute of the sensor. More... | |
size_t | get_sensor_value7 (uint8_t sn, float *buf) |
Read "value7" attribute of the sensor. More... | |
size_t | get_sensor_text_value (uint8_t sn, char *buf, size_t sz) |
Read "text_value" attribute of the sensor. More... | |
size_t | get_sensor_value (uint8_t inx, uint8_t sn, int *buf) |
Read "value" attribute of the sensor. More... | |
const char * | ev3_sensor_type (INX_T type_inx) |
Get name of the specified sensor type. More... | |
INX_T | get_sensor_type_inx (uint8_t sn) |
Read "driver_name" attribute and get index of the sensor type. More... | |
size_t | get_sensor_desc (uint8_t sn, EV3_SENSOR *desc) |
Read sensor attributes that are required for filling the descriptor. More... | |
EV3_SENSOR * | ev3_sensor_desc (uint8_t sn) |
Get descriptor of the sensor. More... | |
INX_T | ev3_sensor_desc_type_inx (uint8_t sn) |
Get type from the sensor descriptor. More... | |
uint8_t | ev3_sensor_desc_port (uint8_t sn) |
Get EV3 port from the sensor descriptor. More... | |
uint8_t | ev3_sensor_desc_extport (uint8_t sn) |
Get extended port from the sensor descriptor. More... | |
uint8_t | ev3_sensor_desc_addr (uint8_t sn) |
Get I2C address from the sensor descriptor. More... | |
char * | ev3_sensor_port_name (uint8_t sn, char *buf) |
Assemble EV3 port name from the sensor descriptor. More... | |
bool | ev3_search_sensor (INX_T type_inx, uint8_t *sn, uint8_t from) |
Search of a sequence number of the specified sensor type. More... | |
bool | ev3_search_sensor_plugged_in (uint8_t port, uint8_t extport, uint8_t *sn, uint8_t from) |
Search of a sequence number the sensor by plug-in attributes. More... | |
const char * | ev3_sensor_mode (INX_T mode_inx) |
Get name of the specified sensor mode. More... | |
INX_T | get_sensor_mode_inx_of_type (uint8_t sn, INX_T type_inx) |
Read "mode" attribute of the specified sensor type and get the index. More... | |
INX_T | get_sensor_mode_inx (uint8_t sn) |
Read "mode" attribute of the sensor and get the index. More... | |
size_t | set_sensor_mode_inx (uint8_t sn, INX_T mode_inx) |
Write "mode" attribute of the sensor by the index. More... | |
size_t | multi_set_sensor_mode_inx (uint8_t *sn, INX_T mode_inx) |
Write "mode" attribute of several sensors by the index. More... | |
const char * | ev3_sensor_command (INX_T command_inx) |
Get name of the specified sensor command. More... | |
size_t | set_sensor_command_inx (uint8_t sn, INX_T command_inx) |
Write "command" attribute of the sensor by the index. More... | |
size_t | multi_set_sensor_command_inx (uint8_t *sn, INX_T command_inx) |
Write "command" attribute of several sensors by the index. More... | |
int | ev3_sensor_init (void) |
Detect connected sensors. More... | |
EV3 Sensors.
(ev3_sensor.yu-c)