55 uint16_t channel_0_raw;
56 uint16_t channel_1_raw;
187 res =
tsl2561_read(&gs_handle, (uint16_t *)&channel_0_raw, (uint16_t *)&channel_1_raw, (uint32_t *)&lux);
215 res =
tsl2561_read(&gs_handle, (uint16_t *)&channel_0_raw, (uint16_t *)&channel_1_raw, (uint32_t *)&lux);
243 res =
tsl2561_read(&gs_handle, (uint16_t *)&channel_0_raw, (uint16_t *)&channel_1_raw, (uint32_t *)&lux);
282 res =
tsl2561_read(&gs_handle, (uint16_t *)&channel_0_raw, (uint16_t *)&channel_1_raw, (uint32_t *)&lux);
310 res =
tsl2561_read(&gs_handle, (uint16_t *)&channel_0_raw, (uint16_t *)&channel_1_raw, (uint32_t *)&lux);
338 res =
tsl2561_read(&gs_handle, (uint16_t *)&channel_0_raw, (uint16_t *)&channel_1_raw, (uint32_t *)&lux);
driver tsl2561 read test header file
uint8_t tsl2561_read(tsl2561_handle_t *handle, uint16_t *channel_0_raw, uint16_t *channel_1_raw, uint32_t *lux)
read data from the chip
uint8_t tsl2561_deinit(tsl2561_handle_t *handle)
close the chip
uint8_t tsl2561_set_addr_pin(tsl2561_handle_t *handle, tsl2561_address_t addr_pin)
set the iic address pin
uint8_t tsl2561_init(tsl2561_handle_t *handle)
initialize the chip
uint8_t tsl2561_info(tsl2561_info_t *info)
get chip's information
tsl2561_address_t
tsl2561 address enumeration definition
uint8_t tsl2561_set_gain(tsl2561_handle_t *handle, tsl2561_gain_t gain)
set the adc gain
struct tsl2561_handle_s tsl2561_handle_t
tsl2561 handle structure definition
uint8_t tsl2561_set_integration_time(tsl2561_handle_t *handle, tsl2561_integration_time_t t)
set the integration time
struct tsl2561_info_s tsl2561_info_t
tsl2561 information structure definition
uint8_t tsl2561_wake_up(tsl2561_handle_t *handle)
wake up the chip
@ TSL2561_INTEGRATION_TIME_402MS
@ TSL2561_INTEGRATION_TIME_101MS
@ TSL2561_INTEGRATION_TIME_13MS
uint8_t tsl2561_interface_iic_init(void)
interface iic bus init
uint8_t tsl2561_interface_iic_deinit(void)
interface iic bus deinit
void tsl2561_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t tsl2561_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t tsl2561_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
void tsl2561_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t tsl2561_set_interrupt_mode(tsl2561_handle_t *handle, tsl2561_interrupt_mode_t mode)
set the interrupt mode
uint8_t tsl2561_set_interrupt_low_threshold(tsl2561_handle_t *handle, uint16_t ch0_raw)
set the interrupt low threshold
uint8_t tsl2561_set_interrupt_high_threshold(tsl2561_handle_t *handle, uint16_t ch0_raw)
set the interrupt high threshold
uint8_t tsl2561_set_interrupt(tsl2561_handle_t *handle, tsl2561_bool_t enable)
enable or disable the chip interrupt
@ TSL2561_INTERRUPT_MODE_15_INTEGRATION_TIME_OUT_OF_RANGE
#define DRIVER_TSL2561_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_TSL2561_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_TSL2561_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_TSL2561_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_TSL2561_LINK_INIT(HANDLE, STRUCTURE)
initialize tsl2561_handle_t structure
#define DRIVER_TSL2561_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_TSL2561_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
uint8_t tsl2561_read_test(tsl2561_address_t addr_pin, uint32_t times)
read test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v