illuminance
2.0.0.0
|
Functions | |
void | illuminance_cfg_setup (illuminance_cfg_t *cfg) |
Config Object Initialization function. More... | |
ILLUMINANCE_RETVAL | illuminance_init (illuminance_t *ctx, illuminance_cfg_t *cfg) |
Initialization function. More... | |
void | illuminance_default_cfg (illuminance_t *ctx) |
Click Default Configuration function. More... | |
void | illuminance_generic_write (illuminance_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. More... | |
void | illuminance_generic_read (illuminance_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. More... | |
void | illuminance_write_data (illuminance_t *ctx, uint8_t address, uint8_t write_command) |
Generic write data function. More... | |
uint8_t | illuminance_read_data (illuminance_t *ctx, uint8_t addr) |
Generic read data function. More... | |
void | illuminance_get_result (illuminance_t *ctx, uint16_t *value_ch0, uint16_t *value_ch1) |
Get Visible & Infrared value. More... | |
uint16_t | illuminance_calculate_lux (uint16_t value_gain, uint16_t value_int, uint16_t ch0, uint16_t ch1) |
Calculate lux value. More... | |
uint8_t | illuminance_get_interrupt (illuminance_t *ctx) |
Get interrupt pin status. More... | |
uint16_t illuminance_calculate_lux | ( | uint16_t | value_gain, |
uint16_t | value_int, | ||
uint16_t | ch0, | ||
uint16_t | ch1 | ||
) |
Calculate lux value.
ctx | Click object. |
value_gain | 0x00 - No gain, 0x01 - 16x gain |
value_int | 0x00 - 13.7ms, 0x01 - 101ms, 0x02 - 402ms |
channel0 | Visible & Infrared data |
channel1 | Infrared data |
@descruotion This function calculates lux value from the TSL2561 sensor.
void illuminance_cfg_setup | ( | illuminance_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void illuminance_default_cfg | ( | illuminance_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration ( typically power on device and set timing value ) for Illuminance click.
void illuminance_generic_read | ( | illuminance_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len | ||
) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void illuminance_generic_write | ( | illuminance_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len | ||
) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t illuminance_get_interrupt | ( | illuminance_t * | ctx | ) |
Get interrupt pin status.
ctx | Click object. |
@description This functions gets interrupt pin state.
void illuminance_get_result | ( | illuminance_t * | ctx, |
uint16_t * | value_ch0, | ||
uint16_t * | value_ch1 | ||
) |
Get Visible & Infrared value.
ctx | Click object. |
value_ch0 | Pointer to read Visible & Infrared value. |
value_ch1 | Pointer to read Infrared value. |
@description This function gets Visible & Infrared value.
ILLUMINANCE_RETVAL illuminance_init | ( | illuminance_t * | ctx, |
illuminance_cfg_t * | cfg | ||
) |
Initialization function.
illuminance | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t illuminance_read_data | ( | illuminance_t * | ctx, |
uint8_t | addr | ||
) |
Generic read data function.
ctx | Click object. |
addr | Register address. |
@description This function reads byte of data from register address addr of TSL2561.
void illuminance_write_data | ( | illuminance_t * | ctx, |
uint8_t | address, | ||
uint8_t | write_command | ||
) |
Generic write data function.
ctx | Click object. |
address | Register address. |
write_command | Command to write. |
@description This function writes byte of data to TSL2561.