55 rl_log(
ERROR,
"TSL4531 I2C bus not initialized properly");
61 uint8_t device_address = (uint8_t)sensor_identifier;
70 rl_log(
ERROR,
"TSL4531 with wrong sensor ID: %d", sensor_id);
76 rl_log(
ERROR,
"TSL4531 setting configuraiton failed");
88 (void)sensor_identifier;
102 uint8_t device_address = (uint8_t)sensor_identifier;
110 int32_t data = i2c_smbus_read_word_data(
221 if (read_result < 0) {
222 rl_log(
ERROR,
"TSL4531 I2C error reading ID of sensor");
237 result = i2c_smbus_write_byte_data(sensor_bus,
241 rl_log(
ERROR,
"TSL4531 writing control register failed");
268 result = i2c_smbus_write_byte_data(
272 rl_log(
ERROR,
"TSL4531 writing new range configuration failed");
278 result = i2c_smbus_write_byte_data(
282 rl_log(
ERROR,
"TSL4531 writing new range configuration failed");
288 result = i2c_smbus_write_byte_data(
292 rl_log(
ERROR,
"TSL4531 writing new range configuration failed");
298 result = i2c_smbus_write_byte_data(
302 rl_log(
ERROR,
"TSL4531 writing new range configuration failed");
322 unsigned int index = 0;
#define TSL4531_SAMPLE_CONTINUOUS
int TSL4531_init(int sensor_identifier)
#define TSL4531_INT_TIME_100
#define TSL4531_RANGE_HYSTERESIS
#define TSL4531_REG_CONFIG
#define TSL4531_I2C_ADDRESSES
#define TSL4531_LOW_POWER
enum TSL4531_range TSL4531_auto_range[sizeof(TSL4531_sensors)]
#define TSL4531_REG_CONTROL
int32_t TSL4531_values[sizeof(TSL4531_sensors)]
void rl_log(rl_log_type type, const char *format,...)
int Sensors_initSharedComm(uint8_t device_address)
int TSL4531_setParameters(int sensor_identifier)
const int TSL4531_sensors[]
int Sensors_getSharedBus(void)
#define TSL4531_RANGE_LOW_MAX
int32_t TSL4531_getValue(int sensor_identifier, int channel)
#define TSL4531_RANGE_MEDIUM_MAX
int TSL4531_getRange(int sensor_identifier)
int TSL4531_read(int sensor_identifier)
#define TSL4531_REG_DATALOW
int TSL4531_sendRange(int sensor_identifier, int range)
uint8_t TSL4531_multiplier[sizeof(TSL4531_sensors)]
#define TSL4531_INT_TIME_200
int TSL4531_getIndex(int sensor_identifier)
int TSL4531_setRange(int sensor_identifier, int range)
void TSL4531_close(int sensor_identifier)
#define TSL4531_INT_TIME_400