Driver for the AMS TCS37727 Color Light-To-Digital Converter. More...
Driver for the AMS TCS37727 Color Light-To-Digital Converter.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
Modules | |
TCS37727 RGB Light Sensor driver compile configuration | |
Files | |
file | tcs37727.h |
Interface definition for the TCS37727 sensor driver. | |
file | tcs37727-internal.h |
Register definitions for the TCS37727 driver. | |
file | tcs37727_params.h |
Default configuration for TCS37727 devices. | |
Data Structures | |
struct | tcs37727_data_t |
Struct for storing TCS37727 sensor data. More... | |
struct | tcs37727_params_t |
TCS37727 configuration parameters. More... | |
struct | tcs37727_t |
Device descriptor for TCS37727 sensors. More... | |
Macros | |
#define | TCS37727_I2C_ADDRESS 0x29 |
Default Device Address. | |
Enumerations | |
enum | { TCS37727_OK = 0, TCS37727_NOBUS = -1, TCS37727_NODEV = -2 } |
Possible TCS27737 return values. More... | |
Functions | |
int | tcs37727_init (tcs37727_t *dev, const tcs37727_params_t *params) |
Initialize the given TCS37727 sensor. More... | |
void | tcs37727_set_rgbc_active (const tcs37727_t *dev) |
Set RGBC enable, this activates periodic RGBC measurements. More... | |
void | tcs37727_set_rgbc_standby (const tcs37727_t *dev) |
Set RGBC disable, this deactivates periodic RGBC measurements. More... | |
void | tcs37727_read (const tcs37727_t *dev, tcs37727_data_t *data) |
Read sensor's data. More... | |
anonymous enum |
Possible TCS27737 return values.
Enumerator | |
---|---|
TCS37727_OK | everything worked as expected |
TCS37727_NOBUS | access to the configured I2C bus failed |
TCS37727_NODEV | no TCS37727 device found on the bus |
Definition at line 93 of file tcs37727.h.
int tcs37727_init | ( | tcs37727_t * | dev, |
const tcs37727_params_t * | params | ||
) |
Initialize the given TCS37727 sensor.
The sensor is initialized in RGBC only mode with proximity detection turned off.
The gain will be initially set to 4x, but it will be adjusted
The gain value will be initially set to 4x, but it will be automatically adjusted during runtime.
[out] | dev | device descriptor of sensor to initialize |
[in] | params | static configuration parameters |
void tcs37727_read | ( | const tcs37727_t * | dev, |
tcs37727_data_t * | data | ||
) |
Read sensor's data.
Besides an Autogain routine is called. If a maximum or minimum threshold value of the channel clear is reached, then the gain will be changed correspond to max or min threshold.
[in] | dev | device descriptor of sensor |
[out] | data | device sensor data, MUST not be NULL |
void tcs37727_set_rgbc_active | ( | const tcs37727_t * | dev | ) |
Set RGBC enable, this activates periodic RGBC measurements.
[out] | dev | device descriptor of sensor |
void tcs37727_set_rgbc_standby | ( | const tcs37727_t * | dev | ) |
Set RGBC disable, this deactivates periodic RGBC measurements.
Also turns off the sensor when proximity measurement is disabled.
[in] | dev | device descriptor of sensor |