lightmixsens 2.0.0.0
|
API for configuring and manipulating Light mix sens Click driver. More...
Topics | |
Light mix sens Registers List | |
List of registers of Light mix sens Click driver. | |
Light mix sens Registers Settings | |
Settings for registers of Light mix sens Click driver. | |
Light mix sens MikroBUS Map | |
MikroBUS pin mapping of Light mix sens Click driver. | |
Functions | |
void | lightmixsens_cfg_setup (lightmixsens_cfg_t *cfg) |
Light mix sens configuration object setup function. | |
err_t | lightmixsens_init (lightmixsens_t *ctx, lightmixsens_cfg_t *cfg) |
Light mix sens initialization function. | |
void | lightmixsens_default_cfg (lightmixsens_t *ctx) |
Light mix sens default configuration function. | |
void | lightmixsens_generic_write (lightmixsens_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Light mix sens I2C writing function. | |
void | lightmixsens_generic_read (lightmixsens_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Light mix sens I2C reading function. | |
err_t | lightmixsens_write_byte (lightmixsens_t *ctx, uint8_t reg_addr, uint8_t data_in) |
Generic Write Byte function. | |
err_t | lightmixsens_write_word (lightmixsens_t *ctx, uint8_t reg_addr, uint16_t data_in) |
Generic Write Word function. | |
err_t | lightmixsens_read_byte (lightmixsens_t *ctx, uint8_t reg_addr, uint8_t *data_out) |
Generic Read Byte function. | |
err_t | lightmixsens_read_word (lightmixsens_t *ctx, uint8_t reg_addr, uint16_t *data_out) |
Generic Read Word function. | |
void | lightmixsens_get_status (lightmixsens_t *ctx, uint8_t flag_mask, uint8_t *status) |
Get Status function. | |
void | lightmixsens_switch_ir_to_green (lightmixsens_t *ctx) |
Switch IR To Green Channel function. | |
void | lightmixsens_switch_ir_to_prox (lightmixsens_t *ctx) |
Switch IR To Proximity function. | |
void | lightmixsens_wait_atime (lightmixsens_t *ctx) |
Wait ALS/Color Intregration Time Done function. | |
void | lightmixsens_wait_ptime (lightmixsens_t *ctx) |
Wait Proximity Sample Time Done function. | |
void | lightmixsens_wait_wtime (lightmixsens_t *ctx) |
Wait WTIME + WLONG Done function. | |
API for configuring and manipulating Light mix sens Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void lightmixsens_cfg_setup | ( | lightmixsens_cfg_t * | cfg | ) |
Light mix sens configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See lightmixsens_cfg_t object definition for detailed explanation. |
void lightmixsens_default_cfg | ( | lightmixsens_t * | ctx | ) |
Light mix sens default configuration function.
This function executes a default configuration of Light mix sens click board.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
0
- Success, -1
- Error.void lightmixsens_generic_read | ( | lightmixsens_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Light mix sens I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_buf | : Output read data. |
[in] | len | : Number of bytes to be read. |
void lightmixsens_generic_write | ( | lightmixsens_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Light mix sens I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_buf | : Data to be written. |
[in] | len | : Number of bytes to be written. |
void lightmixsens_get_status | ( | lightmixsens_t * | ctx, |
uint8_t | flag_mask, | ||
uint8_t * | status ) |
Get Status function.
This function allows the desired bit flags to be checked from the STATUS register.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | flag_mask | : Bit flag selection to include/mask the desired bits. |
[in] | status | : Buffer where masked status byte be placed. |
err_t lightmixsens_init | ( | lightmixsens_t * | ctx, |
lightmixsens_cfg_t * | cfg ) |
Light mix sens initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See lightmixsens_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t lightmixsens_read_byte | ( | lightmixsens_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | data_out ) |
Generic Read Byte function.
This function reads data byte from the selected register.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | reg_addr | : Address which from data be read. |
[out] | data_out | : Buffer where data be placed. |
0
- Success, -1
- Error.err_t lightmixsens_read_word | ( | lightmixsens_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t * | data_out ) |
Generic Read Word function.
This function reads 16-bit data starting from the selected register to the next one.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | reg_addr | : Start address which from data be read. |
[out] | data_out | : Buffer where data be placed. |
0
- Success, -1
- Error.void lightmixsens_switch_ir_to_green | ( | lightmixsens_t * | ctx | ) |
Switch IR To Green Channel function.
This function switches the IR light to be measured in the Green channel (GDATA) register.
[out] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
void lightmixsens_switch_ir_to_prox | ( | lightmixsens_t * | ctx | ) |
Switch IR To Proximity function.
This function switches the IR light to measure proximity in the PDATA register.
[out] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
void lightmixsens_wait_atime | ( | lightmixsens_t * | ctx | ) |
Wait ALS/Color Intregration Time Done function.
This function performs a delay time determined by the ALS/Color integration time (ATIME) register.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
void lightmixsens_wait_ptime | ( | lightmixsens_t * | ctx | ) |
Wait Proximity Sample Time Done function.
This function performs a delay time determined by the Proximity sample time (PTIME) register.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
void lightmixsens_wait_wtime | ( | lightmixsens_t * | ctx | ) |
Wait WTIME + WLONG Done function.
This function performs a delay time determined by the WTIME and WLONG registers.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
err_t lightmixsens_write_byte | ( | lightmixsens_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t | data_in ) |
Generic Write Byte function.
This function writes data byte to the selected register.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | reg_addr | : Address where data be written. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.err_t lightmixsens_write_word | ( | lightmixsens_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | data_in ) |
Generic Write Word function.
This function writes 16-bit data starting from the selected register to the next one.
[in] | ctx | : Click context object. See lightmixsens_t object definition for detailed explanation. |
[in] | reg_addr | : Start address where data be written. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.