ambient16 2.0.0.0
|
API for configuring and manipulating Ambient 16 Click driver. More...
Modules | |
Ambient 16 Registers List | |
List of registers of Ambient 16 Click driver. | |
Ambient 16 Registers Settings | |
Settings for registers of Ambient 16 Click driver. | |
Ambient 16 MikroBUS Map | |
MikroBUS pin mapping of Ambient 16 Click driver. | |
Functions | |
void | ambient16_cfg_setup (ambient16_cfg_t *cfg) |
Ambient 16 configuration object setup function. More... | |
err_t | ambient16_init (ambient16_t *ctx, ambient16_cfg_t *cfg) |
Ambient 16 initialization function. More... | |
err_t | ambient16_default_cfg (ambient16_t *ctx) |
Ambient 16 default configuration function. More... | |
err_t | ambient16_generic_write (ambient16_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Ambient 16 I2C writing function. More... | |
err_t | ambient16_generic_read (ambient16_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Ambient 16 I2C reading function. More... | |
uint8_t | ambient16_get_int_state (ambient16_t *ctx) |
Ambient 16 get INT state function. More... | |
err_t | ambient16_set_reg (ambient16_t *ctx, uint8_t reg, uint8_t value) |
Ambient 16 set register value function. More... | |
err_t | ambient16_send_cmd (ambient16_t *ctx, uint8_t cmd) |
Ambient 16 send command function. More... | |
err_t | ambient16_sw_reset (ambient16_t *ctx) |
Ambient 16 software reset function. More... | |
err_t | ambient16_int_reset (ambient16_t *ctx) |
Ambient 16 interrupt reset function. More... | |
err_t | ambient16_set_th_low (ambient16_t *ctx, uint16_t th_val) |
Ambient 16 set interrupt threshold lower level function. More... | |
err_t | ambient16_set_th_high (ambient16_t *ctx, uint16_t th_val) |
Ambient 16 set interrupt threshold upper level function. More... | |
err_t | ambient16_set_gain (ambient16_t *ctx, uint8_t data0_gain, uint8_t data1_gain) |
Ambient 16 set ADC gain function. More... | |
err_t | ambient16_get_part_id (ambient16_t *ctx, uint8_t *part_id) |
Ambient 16 get part ID function. More... | |
err_t | ambient16_get_data (ambient16_t *ctx, uint16_t *data0, uint16_t *data1) |
Ambient 16 get ADC data function. More... | |
err_t | ambient16_read_data (ambient16_t *ctx, float *data0, float *data1) |
Ambient 16 get data function. More... | |
void | ambient16_set_wait (ambient16_t *ctx, uint8_t wait_mode) |
Ambient 16 set wait function. More... | |
API for configuring and manipulating Ambient 16 Click driver.
void ambient16_cfg_setup | ( | ambient16_cfg_t * | cfg | ) |
Ambient 16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ambient16_cfg_t object definition for detailed explanation. |
err_t ambient16_default_cfg | ( | ambient16_t * | ctx | ) |
Ambient 16 default configuration function.
This function executes a default configuration of Ambient 16 click board.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ambient16_generic_read | ( | ambient16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
Ambient 16 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 ambient16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t ambient16_generic_write | ( | ambient16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
Ambient 16 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 ambient16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t ambient16_get_data | ( | ambient16_t * | ctx, |
uint16_t * | data0, | ||
uint16_t * | data1 | ||
) |
Ambient 16 get ADC data function.
This function is used for reading ADC data from DATA0 and DATA1 by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[out] | data0 | : Output read data from DATA0. |
[out] | data1 | : Output read data from DATA1. |
0
- Success, -1
- Error.uint8_t ambient16_get_int_state | ( | ambient16_t * | ctx | ) |
Ambient 16 get INT state function.
This function reads a state of the INT pin.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
1
- Pin state high, 0
- Pin state low. err_t ambient16_get_part_id | ( | ambient16_t * | ctx, |
uint8_t * | part_id | ||
) |
Ambient 16 get part ID function.
This function is used for reading part ID by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[out] | part_id | : Part ID. |
0
- Success, -1
- Error.err_t ambient16_init | ( | ambient16_t * | ctx, |
ambient16_cfg_t * | cfg | ||
) |
Ambient 16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ambient16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ambient16_int_reset | ( | ambient16_t * | ctx | ) |
Ambient 16 interrupt reset function.
This function executes an interrupt reset of Ambient 16 click board.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t ambient16_read_data | ( | ambient16_t * | ctx, |
float * | data0, | ||
float * | data1 | ||
) |
Ambient 16 get data function.
This function is used for reading data from DATA0 and DATA1 by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[out] | data0 | : Output read data from DATA0 in lux. |
[out] | data1 | : Output read data from DATA1 in lux. |
0
- Success, -1
- Error.err_t ambient16_send_cmd | ( | ambient16_t * | ctx, |
uint8_t | cmd | ||
) |
Ambient 16 send command function.
This function sends a desired command by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | cmd | : Data to be written. |
0
- Success, -1
- Error.err_t ambient16_set_gain | ( | ambient16_t * | ctx, |
uint8_t | data0_gain, | ||
uint8_t | data1_gain | ||
) |
Ambient 16 set ADC gain function.
This function is used for setting ADC gain mode by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | data0_gain | : Gain setting of ADC for DATA0. |
[in] | data1_gain | : Gain setting of ADC for DATA1. |
0
- Success, -1
- Error.err_t ambient16_set_reg | ( | ambient16_t * | ctx, |
uint8_t | reg, | ||
uint8_t | value | ||
) |
Ambient 16 set register value function.
This function writes a desired value into a selected register by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | value | : Data to be written. |
0
- Success, -1
- Error.err_t ambient16_set_th_high | ( | ambient16_t * | ctx, |
uint16_t | th_val | ||
) |
Ambient 16 set interrupt threshold upper level function.
This function is used for setting interrupt threshold upper level by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | th_val | : Treshold data to be written. |
0
- Success, -1
- Error.err_t ambient16_set_th_low | ( | ambient16_t * | ctx, |
uint16_t | th_val | ||
) |
Ambient 16 set interrupt threshold lower level function.
This function is used for setting interrupt threshold lower level by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | th_val | : Treshold data to be written. |
0
- Success, -1
- Error.void ambient16_set_wait | ( | ambient16_t * | ctx, |
uint8_t | wait_mode | ||
) |
Ambient 16 set wait function.
This function is used for enabling wait mode by using I2C serial interface.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
[in] | wait_mode | : Wait mode data. |
err_t ambient16_sw_reset | ( | ambient16_t * | ctx | ) |
Ambient 16 software reset function.
This function executes a software reset of Ambient 16 click board.
[in] | ctx | : Click context object. See ambient16_t object definition for detailed explanation. |
0
- Success, -1
- Error.