upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _gsr_context |
Functions | |
gsr_context | gsr_init (int16_t pin) |
void | gsr_close (gsr_context dev) |
upm_result_t | gsr_set_aref (const gsr_context dev, float aref) |
upm_result_t | gsr_set_scale (const gsr_context dev, float scale) |
upm_result_t | gsr_set_offset (const gsr_context dev, float offset) |
float | gsr_get_aref (const gsr_context dev) |
float | gsr_get_scale (const gsr_context dev) |
float | gsr_get_offset (const gsr_context dev) |
upm_result_t | gsr_get_normalized (const gsr_context dev, float *value) |
upm_result_t | gsr_get_raw_volts (const gsr_context dev, float *value) |
upm_result_t | gsr_get_volts (const gsr_context dev, float *value) |
Typedefs | |
typedef struct _gsr_context * | gsr_context |
gsr_context gsr_init | ( | int16_t | pin | ) |
Initialize analog sensor
pin | Analog pin |
void gsr_close | ( | gsr_context | dev | ) |
Analog sensor destructor
sensor | context pointer |
upm_result_t gsr_set_aref | ( | const gsr_context | dev, |
float | aref | ||
) |
Set ADC reference voltage
dev | sensor context pointer |
aref | ADC reference voltage |
upm_result_t gsr_set_scale | ( | const gsr_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 gsr_set_offset | ( | const gsr_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 gsr_get_aref | ( | const gsr_context | dev | ) |
Get sensor aref
dev | sensor context pointer |
float gsr_get_scale | ( | const gsr_context | dev | ) |
Get sensor scale
dev | sensor context pointer |
float gsr_get_offset | ( | const gsr_context | dev | ) |
Get sensor offset
dev | sensor context pointer |
upm_result_t gsr_get_normalized | ( | const gsr_context | dev, |
float * | value | ||
) |
Read normalized value for sensor
dev | sensor context pointer |
*value | Normalized value (0.0 -> 1.0) |
upm_result_t gsr_get_raw_volts | ( | const gsr_context | dev, |
float * | value | ||
) |
Read raw voltage from the sensor
dev | sensor context pointer |
*value | Raw sensor voltage |
upm_result_t gsr_get_volts | ( | const gsr_context | dev, |
float * | value | ||
) |
Read scaled/offset voltage from the sensor
dev | sensor context pointer |
*value | Adjusted sensor voltage |
typedef struct _gsr_context * gsr_context |
driver context