54 void setup()
override;
64 data = (uint16_t(buffer[1]) << 8) | (uint16_t(buffer[0]) & 0xFF);
84 void calculate_temperature_and_lux_(uint16_t r, uint16_t g, uint16_t b, uint16_t c);
85 uint16_t integration_reg_;
This class simplifies creating components that periodically check a state.
This Class provides the methods to read/write bytes from/to an i2c device.
ErrorCode write_register(uint8_t a_register, const uint8_t *data, size_t len, bool stop=true)
writes an array of bytes to a specific register in the I²C device
ErrorCode read_register(uint8_t a_register, uint8_t *data, size_t len, bool stop=true)
reads an array of bytes from a specific register in the I²C device
Base-class for all sensors.
float get_setup_priority() const override
void set_color_temperature_sensor(sensor::Sensor *color_temperature_sensor)
void set_red_sensor(sensor::Sensor *red_sensor)
i2c::ErrorCode read_data_register_(uint8_t a_register, uint16_t &data)
void set_green_sensor(sensor::Sensor *green_sensor)
void set_blue_sensor(sensor::Sensor *blue_sensor)
void dump_config() override
void set_glass_attenuation_factor(float ga)
sensor::Sensor * illuminance_sensor_
bool integration_time_auto_
i2c::ErrorCode write_config_register_(uint8_t a_register, uint8_t data)
sensor::Sensor * blue_sensor_
sensor::Sensor * red_sensor_
sensor::Sensor * clear_sensor_
void set_illuminance_sensor(sensor::Sensor *illuminance_sensor)
void set_integration_time(TCS34725IntegrationTime integration_time)
sensor::Sensor * green_sensor_
void set_gain(TCS34725Gain gain)
sensor::Sensor * color_temperature_sensor_
void set_clear_sensor(sensor::Sensor *clear_sensor)
IntegrationTime501 integration_time
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
@ ERROR_OK
No error found during execution of method.
@ TCS34725_INTEGRATION_TIME_154MS
@ TCS34725_INTEGRATION_TIME_120MS
@ TCS34725_INTEGRATION_TIME_480MS
@ TCS34725_INTEGRATION_TIME_540MS
@ TCS34725_INTEGRATION_TIME_614MS
@ TCS34725_INTEGRATION_TIME_600MS
@ TCS34725_INTEGRATION_TIME_499MS
@ TCS34725_INTEGRATION_TIME_360MS
@ TCS34725_INTEGRATION_TIME_199MS
@ TCS34725_INTEGRATION_TIME_300MS
@ TCS34725_INTEGRATION_TIME_401MS
@ TCS34725_INTEGRATION_TIME_AUTO
@ TCS34725_INTEGRATION_TIME_101MS
@ TCS34725_INTEGRATION_TIME_240MS
@ TCS34725_INTEGRATION_TIME_180MS
@ TCS34725_INTEGRATION_TIME_420MS
@ TCS34725_INTEGRATION_TIME_50MS
@ TCS34725_INTEGRATION_TIME_2_4MS
@ TCS34725_INTEGRATION_TIME_24MS
Providing packet encoding functions for exchanging data with a remote host.