upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _o2_context |
Functions | |
o2_context | o2_init (int16_t pin) |
void | o2_close (o2_context dev) |
upm_result_t | o2_set_aref (const o2_context dev, float aref) |
float | o2_get_aref (const o2_context dev) |
upm_result_t | o2_set_offset (const o2_context dev, float offset) |
float | o2_get_offset (const o2_context dev) |
upm_result_t | o2_set_scale (const o2_context dev, float scale) |
float | o2_get_scale (const o2_context dev) |
upm_result_t | o2_get_counts (const o2_context dev, int *value) |
upm_result_t | o2_get_raw_volts (const o2_context dev, float *value) |
upm_result_t | o2_get_value (const o2_context dev, float *value) |
Typedefs | |
typedef struct _o2_context * | o2_context |
o2_context o2_init | ( | int16_t | pin | ) |
Initialize analog sensor
pin | is Analog pin |
void o2_close | ( | o2_context | dev | ) |
Analog sensor destructor
sensor | context pointer deallocate memory |
upm_result_t o2_set_aref | ( | const o2_context | dev, |
float | aref | ||
) |
Set sensor adc vref.
dev | sensor context pointer |
aref | Voltage reference routed to ADC ref pin |
float o2_get_aref | ( | const o2_context | dev | ) |
Get sensor adc vref
dev | sensor context pointer |
upm_result_t o2_set_offset | ( | const o2_context | dev, |
float | offset | ||
) |
Set sensor offset. This offset is applied to the return value: counts = counts * scale + offset * scale
dev | sensor context pointer |
offset | count offset value used |
float o2_get_offset | ( | const o2_context | dev | ) |
Get sensor offset
dev | sensor context pointer |
upm_result_t o2_set_scale | ( | const o2_context | dev, |
float | scale | ||
) |
Set sensor scale. This scale is applied to the return value: counts = counts * scale + offset * scale
dev | sensor context pointer |
scale | count scale value used |
float o2_get_scale | ( | const o2_context | dev | ) |
Get sensor scale
dev | sensor context pointer |
upm_result_t o2_get_counts | ( | const o2_context | dev, |
int * | value | ||
) |
Read raw adc counts from sensor
dev | sensor context pointer |
*value | Raw adc value |
upm_result_t o2_get_raw_volts | ( | const o2_context | dev, |
float * | value | ||
) |
Read voltage from sensor
dev | sensor context pointer |
*value | Voltage (v) |
upm_result_t o2_get_value | ( | const o2_context | dev, |
float * | value | ||
) |
Read value from sensor
dev | sensor context pointer |
*value | O2 percentage |
typedef struct _o2_context * o2_context |
device context