36 #include <i2c/smbus.h>
130 uint8_t device_address = (uint8_t)sensor_identifier;
134 "TSL4531 I2C initialization failed; %d message: %s", errno,
142 sensor_id, errno, strerror(errno));
149 "TSL4531 setting configuration failed; %d message: %s", errno,
158 (void)sensor_identifier;
167 uint8_t device_address = (uint8_t)sensor_identifier;
171 errno, strerror(errno));
176 int32_t
data = i2c_smbus_read_word_data(
180 errno, strerror(errno));
243 errno, strerror(errno));
268 if (read_result < 0) {
279 result = i2c_smbus_write_byte_data(
sensor_bus,
284 "TSL4531 writing control register failed; %d message: %s", errno,
292 errno, strerror(errno));
307 result = i2c_smbus_write_byte_data(
312 "TSL4531 writing new range configuration failed; %d "
314 errno, strerror(errno));
320 result = i2c_smbus_write_byte_data(
325 "TSL4531 writing new range configuration failed; %d "
327 errno, strerror(errno));
333 result = i2c_smbus_write_byte_data(
338 "TSL4531 writing new range configuration failed; %d "
340 errno, strerror(errno));
346 result = i2c_smbus_write_byte_data(
351 "TSL4531 writing new range configuration failed; %d "
353 errno, strerror(errno));
369 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