![]() |
LibDriver TSL2561
|
tsl2561 base driver modules More...
Data Structures | |
| struct | tsl2561_handle_s |
| tsl2561 handle structure definition More... | |
| struct | tsl2561_info_s |
| tsl2561 information structure definition More... | |
Typedefs | |
| typedef struct tsl2561_handle_s | tsl2561_handle_t |
| tsl2561 handle structure definition | |
| typedef struct tsl2561_info_s | tsl2561_info_t |
| tsl2561 information structure definition | |
Enumerations | |
| enum | tsl2561_address_t { TSL2561_ADDRESS_GND = 0x52 , TSL2561_ADDRESS_FLOAT = 0x72 , TSL2561_ADDRESS_VCC = 0x92 } |
| tsl2561 address enumeration definition More... | |
| enum | tsl2561_bool_t { TSL2561_BOOL_FALSE = 0x00 , TSL2561_BOOL_TRUE = 0x01 } |
| tsl2561 bool enumeration definition More... | |
| enum | tsl2561_gain_t { TSL2561_GAIN_1 = 0x00 , TSL2561_GAIN_16 = 0x01 } |
| tsl2561 gain enumeration definition More... | |
| enum | tsl2561_integration_time_t { TSL2561_INTEGRATION_TIME_13MS = 0x00 , TSL2561_INTEGRATION_TIME_101MS = 0x01 , TSL2561_INTEGRATION_TIME_402MS = 0x02 } |
| tsl2561 integration time enumeration definition More... | |
Functions | |
| uint8_t | tsl2561_info (tsl2561_info_t *info) |
| get chip's information | |
| uint8_t | tsl2561_set_addr_pin (tsl2561_handle_t *handle, tsl2561_address_t addr_pin) |
| set the iic address pin | |
| uint8_t | tsl2561_get_addr_pin (tsl2561_handle_t *handle, tsl2561_address_t *addr_pin) |
| get the iic address pin | |
| uint8_t | tsl2561_init (tsl2561_handle_t *handle) |
| initialize the chip | |
| uint8_t | tsl2561_deinit (tsl2561_handle_t *handle) |
| close the chip | |
| 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_power_down (tsl2561_handle_t *handle) |
| power down the chip | |
| uint8_t | tsl2561_wake_up (tsl2561_handle_t *handle) |
| wake up the chip | |
| uint8_t | tsl2561_set_gain (tsl2561_handle_t *handle, tsl2561_gain_t gain) |
| set the adc gain | |
| uint8_t | tsl2561_get_gain (tsl2561_handle_t *handle, tsl2561_gain_t *gain) |
| get the adc gain | |
| uint8_t | tsl2561_set_integration_time (tsl2561_handle_t *handle, tsl2561_integration_time_t t) |
| set the integration time | |
| uint8_t | tsl2561_get_integration_time (tsl2561_handle_t *handle, tsl2561_integration_time_t *t) |
| get the integration time | |
tsl2561 base driver modules
| typedef struct tsl2561_handle_s tsl2561_handle_t |
tsl2561 handle structure definition
| typedef struct tsl2561_info_s tsl2561_info_t |
tsl2561 information structure definition
| enum tsl2561_address_t |
tsl2561 address enumeration definition
| Enumerator | |
|---|---|
| TSL2561_ADDRESS_GND | ADDR pin connected to GND |
| TSL2561_ADDRESS_FLOAT | ADDR pin connected to FLOAT |
| TSL2561_ADDRESS_VCC | ADDR pin connected to VCC |
Definition at line 63 of file driver_tsl2561.h.
| enum tsl2561_bool_t |
tsl2561 bool enumeration definition
| Enumerator | |
|---|---|
| TSL2561_BOOL_FALSE | disable function |
| TSL2561_BOOL_TRUE | enable function |
Definition at line 73 of file driver_tsl2561.h.
| enum tsl2561_gain_t |
tsl2561 gain enumeration definition
| Enumerator | |
|---|---|
| TSL2561_GAIN_1 | 1x gain |
| TSL2561_GAIN_16 | 16x gain |
Definition at line 82 of file driver_tsl2561.h.
tsl2561 integration time enumeration definition
| Enumerator | |
|---|---|
| TSL2561_INTEGRATION_TIME_13MS | 13 ms integration time |
| TSL2561_INTEGRATION_TIME_101MS | 101 ms integration time |
| TSL2561_INTEGRATION_TIME_402MS | 402 ms integration time |
Definition at line 91 of file driver_tsl2561.h.
| uint8_t tsl2561_deinit | ( | tsl2561_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to a tsl2561 handle structure |
Definition at line 294 of file driver_tsl2561.c.
| uint8_t tsl2561_get_addr_pin | ( | tsl2561_handle_t * | handle, |
| tsl2561_address_t * | addr_pin ) |
get the iic address pin
| [in] | *handle | pointer to a tsl2561 handle structure |
| [out] | *addr_pin | pointer to a chip iic address pin buffer |
Definition at line 357 of file driver_tsl2561.c.
| uint8_t tsl2561_get_gain | ( | tsl2561_handle_t * | handle, |
| tsl2561_gain_t * | gain ) |
get the adc gain
| [in] | *handle | pointer to a tsl2561 handle structure |
| [out] | *gain | pointer to an adc gain buffer |
Definition at line 477 of file driver_tsl2561.c.
| uint8_t tsl2561_get_integration_time | ( | tsl2561_handle_t * | handle, |
| tsl2561_integration_time_t * | t ) |
get the integration time
| [in] | *handle | pointer to a tsl2561 handle structure |
| [out] | *t | pointer to an integration time buffer |
Definition at line 557 of file driver_tsl2561.c.
| uint8_t tsl2561_info | ( | tsl2561_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to a tsl2561 info structure |
Definition at line 1043 of file driver_tsl2561.c.
| uint8_t tsl2561_init | ( | tsl2561_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to a tsl2561 handle structure |
Definition at line 214 of file driver_tsl2561.c.
| uint8_t tsl2561_power_down | ( | tsl2561_handle_t * | handle | ) |
power down the chip
| [in] | *handle | pointer to a tsl2561 handle structure |
Definition at line 901 of file driver_tsl2561.c.
| 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
| [in] | *handle | pointer to a tsl2561 handle structure |
| [out] | *channel_0_raw | pointer to a channel 0 raw data |
| [out] | *channel_1_raw | pointer to a channel 1 raw data |
| [out] | *lux | pointer to a converted lux |
Definition at line 382 of file driver_tsl2561.c.
| uint8_t tsl2561_set_addr_pin | ( | tsl2561_handle_t * | handle, |
| tsl2561_address_t | addr_pin ) |
set the iic address pin
| [in] | *handle | pointer to a tsl2561 handle structure |
| [in] | addr_pin | chip iic address pin |
Definition at line 335 of file driver_tsl2561.c.
| uint8_t tsl2561_set_gain | ( | tsl2561_handle_t * | handle, |
| tsl2561_gain_t | gain ) |
set the adc gain
| [in] | *handle | pointer to a tsl2561 handle structure |
| [in] | gain | adc gain |
Definition at line 433 of file driver_tsl2561.c.
| uint8_t tsl2561_set_integration_time | ( | tsl2561_handle_t * | handle, |
| tsl2561_integration_time_t | t ) |
set the integration time
| [in] | *handle | pointer to a tsl2561 handle structure |
| [in] | t | integration time |
Definition at line 513 of file driver_tsl2561.c.
| uint8_t tsl2561_wake_up | ( | tsl2561_handle_t * | handle | ) |
wake up the chip
| [in] | *handle | pointer to a tsl2561 handle structure |
Definition at line 937 of file driver_tsl2561.c.