File syn_lux.h¶
Go to the source code of this file
Generic Ambient Light & RGB Color Sensor Driver (BH1750, TSL2561, TCS34725).
#include "../common/syn_defs.h"#include "../drivers/syn_soft_i2c.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_Lux Generic Light & Color Sensor Context. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_LuxType Light & Color Sensor Type. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_lux_feed_lux (SYN_Lux * sensor, float lux) Feed raw illuminance reading in Lux (for BH1750/TSL2561). |
| void | syn_lux_feed_rgbc (SYN_Lux * sensor, uint16_t r, uint16_t g, uint16_t b, uint16_t c) Feed raw RGBC channels (for TCS34725). |
| uint16_t | syn_lux_get_color_temp_k (const SYN_Lux * sensor) Get Correlated Color Temperature in Kelvin. |
| float | syn_lux_get_lux (const SYN_Lux * sensor) Get ambient illuminance in Lux. |
| SYN_Status | syn_lux_init (SYN_Lux * sensor, SYN_GPIO_Pin scl, SYN_GPIO_Pin sda, uint8_t i2c_addr, SYN_LuxType type) Initialize Light & Color Sensor. |
Public Types Documentation¶
enum SYN_LuxType¶
Light & Color Sensor Type.
Public Functions Documentation¶
function syn_lux_feed_lux¶
Feed raw illuminance reading in Lux (for BH1750/TSL2561).
Parameters:
sensorLux sensor context.luxAmbient light value in Lux.
function syn_lux_feed_rgbc¶
Feed raw RGBC channels (for TCS34725).
Parameters:
sensorLux sensor context.rRed channel raw ADC.gGreen channel raw ADC.bBlue channel raw ADC.cClear channel raw ADC.
function syn_lux_get_color_temp_k¶
Get Correlated Color Temperature in Kelvin.
Parameters:
sensorLux sensor context.
Returns:
Color Temp in K.
function syn_lux_get_lux¶
Get ambient illuminance in Lux.
Parameters:
sensorLux sensor context.
Returns:
Lux value.
function syn_lux_init¶
Initialize Light & Color Sensor.
SYN_Status syn_lux_init (
SYN_Lux * sensor,
SYN_GPIO_Pin scl,
SYN_GPIO_Pin sda,
uint8_t i2c_addr,
SYN_LuxType type
)
Parameters:
sensorLux sensor context.sclI2C SCL GPIO pin.sdaI2C SDA GPIO pin.i2c_addrI2C slave address (e.g. 0x23 or 0x29).typeSensor type (BH1750, TSL2561, TCS34725).
Returns:
SYN_OK on success.
The documentation for this class was generated from the following file src/syntropic/sensor/syn_lux.h