light4
2.1.0.0
|
API for configuring and manipulating Light 4 Click driver. More...
Modules | |
Light 4 Registers List | |
List of registers of Light 4 Click driver. | |
Light 4 Registers Settings | |
Settings for registers of Light 4 Click driver. | |
Light 4 MikroBUS Map | |
MikroBUS pin mapping of Light 4 Click driver. | |
Functions | |
void | light4_cfg_setup (light4_cfg_t *cfg) |
Light 4 configuration object setup function. More... | |
err_t | light4_init (light4_t *ctx, light4_cfg_t *cfg) |
Light 4 initialization function. More... | |
err_t | light4_default_cfg (light4_t *ctx) |
Light 4 default configuration function. More... | |
err_t | light4_generic_write (light4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Light 4 I2C writing function. More... | |
err_t | light4_generic_read (light4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Light 4 I2C reading function. More... | |
void | light4_set_en_pin (light4_t *ctx, uint8_t pin_state) |
Light 4 set EN pin function. More... | |
void | light4_set_snc_pin (light4_t *ctx, uint8_t pin_state) |
Light 4 set SNC pin function. More... | |
uint8_t | light4_get_int_pin (light4_t *ctx) |
Light 4 get INT pin function. More... | |
err_t | light4_write_reg (light4_t *ctx, uint8_t reg, uint8_t data_in) |
Light 4 Register writing function. More... | |
err_t | light4_read_reg (light4_t *ctx, uint8_t reg, uint8_t *data_out) |
Light 4 Register reading function. More... | |
err_t | light4_sw_reset (light4_t *ctx) |
Light 4 Software reset function. More... | |
err_t | light4_read_channel_data (light4_t *ctx, uint8_t channel_sel, float *channel_data) |
Light 4 get channel data function. More... | |
API for configuring and manipulating Light 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void light4_cfg_setup | ( | light4_cfg_t * | cfg | ) |
Light 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See light4_cfg_t object definition for detailed explanation. |
err_t light4_default_cfg | ( | light4_t * | ctx | ) |
Light 4 default configuration function.
This function executes a default configuration of Light 4 click board.
[in] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light4_generic_read | ( | light4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Light 4 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 light4_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 light4_generic_write | ( | light4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Light 4 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 light4_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. uint8_t light4_get_int_pin | ( | light4_t * | ctx | ) |
Light 4 get INT pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
err_t light4_init | ( | light4_t * | ctx, |
light4_cfg_t * | cfg | ||
) |
Light 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See light4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light4_read_channel_data | ( | light4_t * | ctx, |
uint8_t | channel_sel, | ||
float * | channel_data | ||
) |
Light 4 get channel data function.
This function is used to read data from selected channel of Light 4 click board.
[in] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
[in] | channel_sel | : Channel selection. |
[out] | channel_data | : Read channel data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light4_read_reg | ( | light4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Light 4 Register reading function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See light4_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. void light4_set_en_pin | ( | light4_t * | ctx, |
uint8_t | pin_state | ||
) |
Light 4 set EN pin function.
This function sets the EN pin logic state.
[in] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void light4_set_snc_pin | ( | light4_t * | ctx, |
uint8_t | pin_state | ||
) |
Light 4 set SNC pin function.
This function sets the SNC pin logic state.
[in] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t light4_sw_reset | ( | light4_t * | ctx | ) |
Light 4 Software reset function.
This function is used to perform software reset of Light 4 click board.
[in] | ctx | : Click context object. See light4_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t light4_write_reg | ( | light4_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Light 4 Register writing function.
This function writes a byte into the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See light4_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.