upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _flex_context |
Functions | |
flex_context | flex_init (int16_t pin) |
void | flex_close (flex_context dev) |
upm_result_t | flex_set_aref (const flex_context dev, float aref) |
upm_result_t | flex_set_scale (const flex_context dev, float scale) |
upm_result_t | flex_set_offset (const flex_context dev, float offset) |
float | flex_get_aref (const flex_context dev) |
float | flex_get_scale (const flex_context dev) |
float | flex_get_offset (const flex_context dev) |
upm_result_t | flex_get_normalized (const flex_context dev, float *value) |
upm_result_t | flex_get_raw_volts (const flex_context dev, float *value) |
upm_result_t | flex_get_volts (const flex_context dev, float *value) |
Typedefs | |
typedef struct _flex_context * | flex_context |
flex_context flex_init | ( | int16_t | pin | ) |
Initialize analog sensor
pin | Analog pin |
void flex_close | ( | flex_context | dev | ) |
Analog sensor destructor
sensor | context pointer |
upm_result_t flex_set_aref | ( | const flex_context | dev, |
float | aref | ||
) |
Set ADC reference voltage
dev | sensor context pointer |
aref | ADC reference voltage |
upm_result_t flex_set_scale | ( | const flex_context | dev, |
float | scale | ||
) |
Set sensor scale. This scale is applied to the return value: counts = counts * scale
dev | sensor context pointer |
scale | count scale value used |
upm_result_t flex_set_offset | ( | const flex_context | dev, |
float | offset | ||
) |
Set sensor offset. This offset is applied to the return value: value = value + offset
dev | sensor context pointer |
offset | count offset value used |
float flex_get_aref | ( | const flex_context | dev | ) |
Get sensor aref
dev | sensor context pointer |
float flex_get_scale | ( | const flex_context | dev | ) |
Get sensor scale
dev | sensor context pointer |
float flex_get_offset | ( | const flex_context | dev | ) |
Get sensor offset
dev | sensor context pointer |
upm_result_t flex_get_normalized | ( | const flex_context | dev, |
float * | value | ||
) |
Read normalized value for sensor
dev | sensor context pointer |
*value | Normalized value (0.0 -> 1.0) |
upm_result_t flex_get_raw_volts | ( | const flex_context | dev, |
float * | value | ||
) |
Read raw voltage from the sensor
dev | sensor context pointer |
*value | Raw sensor voltage |
upm_result_t flex_get_volts | ( | const flex_context | dev, |
float * | value | ||
) |
Read scaled/offset voltage from the sensor
dev | sensor context pointer |
*value | Adjusted sensor voltage |
typedef struct _flex_context * flex_context |
driver context