Ambient light and UV index sensor#

Ambient light and UV index sensor driver abstraction designed for Thunderboard. Not suitable for other applications.

Functions#

sl_status_t
sl_status_t
sl_sensor_light_get(float *lux, float *uvi)
void
sl_sensor_light_set(float lux, float uvi)
void

Macros#

#define
SENSOR_LIGHT_POSITIVE_TOLERANCE 0
#define
SENSOR_LIGHT_NEGATIVE_TOLERANCE 0
#define
SENSOR_LIGHT_SAMPLING_FUNCTION SAMPLING_UNSPECIFIED
#define
SENSOR_LIGHT_MEASUREMENT_PERIOD 0
#define
SENSOR_LIGHT_UPDATE_INTERVAL 0

Function Documentation#

sl_sensor_light_init#

sl_status_t sl_sensor_light_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Initialize ambient light and UV index sensor.

Note

  • With certain boards (e.g. 4166A, 4184A), using this initialization function enables other sensors, because they're on the same enable pin. Please take that into account when using this function.

Returns

  • Status of the operation.


Definition at line 49 of file common/sensor_light/sl_sensor_light.h

sl_sensor_light_deinit#

void sl_sensor_light_deinit (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Deinitialize ambient light and UV index sensor.

Warnings

  • With certain boards (e.g. 4166A, 4184A), using this deinitialization function disables other sensors, because they're on the same enable pin. Please use with caution.


Definition at line 58 of file common/sensor_light/sl_sensor_light.h

sl_sensor_light_get#

sl_status_t sl_sensor_light_get (float * lux, float * uvi)
Parameters
TypeDirectionArgument NameDescription
float *[out]lux

Ambient light illuminance (in lux).

float *[out]uvi

UV index.

Getter for ambient light and UV index sensor measurement data. Returns

  • Status of the operation.


Definition at line 66 of file common/sensor_light/sl_sensor_light.h

sl_sensor_light_set#

void sl_sensor_light_set (float lux, float uvi)
Parameters
TypeDirectionArgument NameDescription
float[in]lux

Ambient light illuminance (in lux).

float[in]uvi

UV index.

Setter for ambient light and UV index.


Definition at line 46 of file common/sensor_light/sl_sensor_light_lux_mock.h

sl_sensor_lux_set#

void sl_sensor_lux_set (float lux)
Parameters
TypeDirectionArgument NameDescription
float[in]lux

Ambient light illuminance (in lux).

Setter for ambient light.


Definition at line 52 of file common/sensor_light/sl_sensor_light_lux_mock.h