light3 2.1.0.0
|
API for configuring and manipulating Light 3 Click driver. More...
Modules | |
Light 3 Registers List | |
List of registers of Light 3 Click driver. | |
Light 3 Registers Settings | |
Settings for registers of Light 3 Click driver. | |
Light 3 MikroBUS Map | |
MikroBUS pin mapping of Light 3 Click driver. | |
Functions | |
void | light3_cfg_setup (light3_cfg_t *cfg) |
Light 3 configuration object setup function. More... | |
err_t | light3_init (light3_t *ctx, light3_cfg_t *cfg) |
Light 3 initialization function. More... | |
err_t | light3_default_cfg (light3_t *ctx) |
Light 3 default configuration function. More... | |
err_t | light3_generic_write (light3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Light 3 I2C writing function. More... | |
err_t | light3_generic_read (light3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Light 3 I2C reading function. More... | |
uint8_t | light3_get_int_pin (light3_t *ctx) |
Light 3 get INT pin state function. More... | |
err_t | light3_sw_reset (light3_t *ctx) |
Light 3 software reset function. More... | |
err_t | light3_write_reg (light3_t *ctx, uint8_t reg, uint16_t data_in) |
Light 3 register writing function. More... | |
err_t | light3_read_reg (light3_t *ctx, uint8_t reg, uint16_t *data_out) |
Light 3 register reading function. More... | |
err_t | light3_get_ch0_data (light3_t *ctx, float *lux) |
Light 3 read CH0 data function. More... | |
err_t | light3_get_ch1_data (light3_t *ctx, float *lux) |
Light 3 read CH1 data function. More... | |
err_t | light3_get_ch0_fifo_data (light3_t *ctx, float *lux) |
Light 3 read CH0 FIFO data function. More... | |
err_t | light3_get_ch1_fifo_data (light3_t *ctx, float *lux) |
Light 3 read CH1 FIFO data function. More... | |
API for configuring and manipulating Light 3 Click driver.
void light3_cfg_setup | ( | light3_cfg_t * | cfg | ) |
Light 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See light3_cfg_t object definition for detailed explanation. |
err_t light3_default_cfg | ( | light3_t * | ctx | ) |
Light 3 default configuration function.
This function executes a default configuration of Light 3 click board.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_generic_read | ( | light3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Light 3 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 light3_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_generic_write | ( | light3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Light 3 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 light3_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_get_ch0_data | ( | light3_t * | ctx, |
float * | lux | ||
) |
Light 3 read CH0 data function.
This function reads ambient light data from the Channel 0 and performs the calculatios from raw data to Lux.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[out] | lux | : Read ambient ligh in lux. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_get_ch0_fifo_data | ( | light3_t * | ctx, |
float * | lux | ||
) |
Light 3 read CH0 FIFO data function.
This function reads ambient light data from the Channel 0 FIFO and performs the calculatios from raw data to Lux.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[out] | lux | : Read ambient ligh in lux. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_get_ch1_data | ( | light3_t * | ctx, |
float * | lux | ||
) |
Light 3 read CH1 data function.
This function reads ambient light data from the Channel 1 and performs the calculatios from raw data to Lux.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[out] | lux | : Read ambient ligh in lux. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_get_ch1_fifo_data | ( | light3_t * | ctx, |
float * | lux | ||
) |
Light 3 read CH1 FIFO data function.
This function reads ambient light data from the Channel 1 FIFO and performs the calculatios from raw data to Lux.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[out] | lux | : Read ambient ligh in lux. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t light3_get_int_pin | ( | light3_t * | ctx | ) |
Light 3 get INT pin state function.
This function is used to get INT pin state of Light 3 click board.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
err_t light3_init | ( | light3_t * | ctx, |
light3_cfg_t * | cfg | ||
) |
Light 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See light3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_read_reg | ( | light3_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
Light 3 register reading function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_sw_reset | ( | light3_t * | ctx | ) |
Light 3 software reset function.
This function is used to perform software reset.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light3_write_reg | ( | light3_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Light 3 register writing function.
This function writes a desired data into the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See light3_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.