ambient23 2.1.0.0
|
API for configuring and manipulating Ambient 23 Click driver. More...
Topics | |
Ambient 23 Registers List | |
List of registers of Ambient 23 Click driver. | |
Ambient 23 Registers Settings | |
Settings for registers of Ambient 23 Click driver. | |
Ambient 23 MikroBUS Map | |
MikroBUS pin mapping of Ambient 23 Click driver. | |
Functions | |
void | ambient23_cfg_setup (ambient23_cfg_t *cfg) |
Ambient 23 configuration object setup function. | |
err_t | ambient23_init (ambient23_t *ctx, ambient23_cfg_t *cfg) |
Ambient 23 initialization function. | |
err_t | ambient23_default_cfg (ambient23_t *ctx) |
Ambient 23 default configuration function. | |
err_t | ambient23_generic_write (ambient23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Ambient 23 I2C writing function. | |
err_t | ambient23_generic_read (ambient23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Ambient 23 I2C reading function. | |
err_t | ambient23_reg_write (ambient23_t *ctx, uint8_t reg, uint16_t data_in) |
Ambient 23 register data writing function. | |
err_t | ambient23_reg_read (ambient23_t *ctx, uint8_t reg, uint16_t *data_out) |
Ambient 23 register reading function. | |
err_t | ambient23_calculate_res (ambient23_t *ctx, float *conversion_mul) |
Ambient 23 get conversion data function. | |
err_t | ambient23_read_light_data (ambient23_t *ctx, float *light_data) |
Ambient 23 get light data function. | |
API for configuring and manipulating Ambient 23 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t ambient23_calculate_res | ( | ambient23_t * | ctx, |
float * | conversion_mul ) |
Ambient 23 get conversion data function.
This function is used to get the conversion multiplier necessary for converting raw ADC value into lux.
[in] | ctx | : Click context object. See ambient23_t object definition for detailed explanation. |
[out] | conversion_mul | : Conversion multiplier. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void ambient23_cfg_setup | ( | ambient23_cfg_t * | cfg | ) |
Ambient 23 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ambient23_cfg_t object definition for detailed explanation. |
err_t ambient23_default_cfg | ( | ambient23_t * | ctx | ) |
Ambient 23 default configuration function.
This function executes a default configuration of Ambient 23 click board.
[in] | ctx | : Click context object. See ambient23_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient23_generic_read | ( | ambient23_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Ambient 23 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 ambient23_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 ambient23_generic_write | ( | ambient23_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Ambient 23 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 ambient23_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 ambient23_init | ( | ambient23_t * | ctx, |
ambient23_cfg_t * | cfg ) |
Ambient 23 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ambient23_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ambient23_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient23_read_light_data | ( | ambient23_t * | ctx, |
float * | light_data ) |
Ambient 23 get light data function.
This function is used to measure light level in lux.
[in] | ctx | : Click context object. See ambient23_t object definition for detailed explanation. |
[out] | light_data | : Measured light level. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient23_reg_read | ( | ambient23_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
Ambient 23 register reading function.
This function reads a 16 bytes of data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ambient23_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient23_reg_write | ( | ambient23_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
Ambient 23 register data writing function.
This function writes a 16 bytes of data into the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ambient23_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.