129 uint8_t device_address = (uint8_t)sensor_identifier;
133 "TSL4531 I2C initialization failed; %d message: %s", errno,
141 sensor_id, errno, strerror(errno));
148 "TSL4531 setting configuration failed; %d message: %s", errno,
157 (void)sensor_identifier;
166 uint8_t device_address = (uint8_t)sensor_identifier;
170 errno, strerror(errno));
175 int32_t
data = i2c_smbus_read_word_data(
179 errno, strerror(errno));
242 errno, strerror(errno));
267 if (read_result < 0) {
278 result = i2c_smbus_write_byte_data(
sensor_bus,
283 "TSL4531 writing control register failed; %d message: %s", errno,
291 errno, strerror(errno));
306 result = i2c_smbus_write_byte_data(
311 "TSL4531 writing new range configuration failed; %d "
313 errno, strerror(errno));
319 result = i2c_smbus_write_byte_data(
324 "TSL4531 writing new range configuration failed; %d "
326 errno, strerror(errno));
332 result = i2c_smbus_write_byte_data(
337 "TSL4531 writing new range configuration failed; %d "
339 errno, strerror(errno));
345 result = i2c_smbus_write_byte_data(
350 "TSL4531 writing new range configuration failed; %d "
352 errno, strerror(errno));
368 unsigned int index = 0;
rl_calibration_t data
The actual calibration data.
int rl_log(rl_log_level_t log_level, char const *const format,...)
#define ERROR
Function return value for errors (use errno to indicate the error)
int sensor_bus
I2C sensor bus identifier for communication.
int sensors_get_bus(void)
int sensors_init_comm(uint8_t device_address)
int tsl4531_get_range(int sensor_identifier)
int32_t tsl4531_get_value(int sensor_identifier, int channel)
uint8_t tsl4531_multiplier[sizeof(tsl4531_sensors)]
int tsl4531_init(int sensor_identifier)
int32_t tsl4531_values[sizeof(tsl4531_sensors)]
int tsl4531_get_index(int sensor_identifier)
int tsl4531_read(int sensor_identifier)
int tsl4531_send_range(int sensor_identifier, int range)
const int tsl4531_sensors[]
int tsl4531_set_parameters(int sensor_identifier)
void tsl4531_deinit(int sensor_identifier)
tsl4531_range_t tsl4531_auto_range[sizeof(tsl4531_sensors)]
int tsl4531_set_range(int sensor_identifier, int range)
#define TSL4531_INT_TIME_200
#define TSL4531_REG_DATALOW
#define TSL4531_SAMPLE_CONTINUOUS
#define TSL4531_INT_TIME_100
#define TSL4531_RANGE_MEDIUM_MAX
enum tsl4531_range tsl4531_range_t
#define TSL4531_I2C_ADDRESSES
#define TSL4531_REG_CONTROL
#define TSL4531_REG_CONFIG
#define TSL4531_RANGE_LOW_MAX
#define TSL4531_INT_TIME_400
#define TSL4531_LOW_POWER
#define TSL4531_RANGE_HYSTERESIS