upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _light_context |
Functions | |
light_context | light_init (int16_t pin) |
void | light_close (light_context dev) |
upm_result_t | light_set_aref (const light_context dev, float aref) |
upm_result_t | light_set_scale (const light_context dev, float scale) |
upm_result_t | light_set_offset (const light_context dev, float offset) |
float | light_get_aref (const light_context dev) |
float | light_get_scale (const light_context dev) |
float | light_get_offset (const light_context dev) |
upm_result_t | light_get_normalized (const light_context dev, float *value) |
upm_result_t | light_get_raw_volts (const light_context dev, float *value) |
upm_result_t | light_get_lux (const light_context dev, float *value) |
Typedefs | |
typedef struct _light_context * | light_context |
light_context light_init | ( | int16_t | pin | ) |
Initialize analog sensor
pin | Analog pin |
void light_close | ( | light_context | dev | ) |
Analog sensor destructor
sensor | context pointer |
upm_result_t light_set_aref | ( | const light_context | dev, |
float | aref | ||
) |
Set ADC reference voltage
dev | sensor context pointer |
aref | ADC reference voltage |
upm_result_t light_set_scale | ( | const light_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 light_set_offset | ( | const light_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 light_get_aref | ( | const light_context | dev | ) |
Get sensor aref
dev | sensor context pointer |
float light_get_scale | ( | const light_context | dev | ) |
Get sensor scale
dev | sensor context pointer |
float light_get_offset | ( | const light_context | dev | ) |
Get sensor offset
dev | sensor context pointer |
upm_result_t light_get_normalized | ( | const light_context | dev, |
float * | value | ||
) |
Read normalized value for sensor
dev | sensor context pointer |
*value | Normalized value (0.0 -> 1.0) |
upm_result_t light_get_raw_volts | ( | const light_context | dev, |
float * | value | ||
) |
Read raw voltage from the sensor
dev | sensor context pointer |
*value | Raw sensor voltage |
upm_result_t light_get_lux | ( | const light_context | dev, |
float * | value | ||
) |
Read scaled/offset light value in lux
dev | sensor context pointer |
*value | Adjusted sensor value in lux |
typedef struct _light_context * light_context |
driver context