ambient20 2.1.0.0
|
API for configuring and manipulating Ambient 20 Click driver. More...
Modules | |
Ambient 20 Registers List | |
List of registers of Ambient 20 Click driver. | |
Ambient 20 Registers Settings | |
Settings for registers of Ambient 20 Click driver. | |
Ambient 20 MikroBUS Map | |
MikroBUS pin mapping of Ambient 20 Click driver. | |
Functions | |
void | ambient20_cfg_setup (ambient20_cfg_t *cfg) |
Ambient 20 configuration object setup function. More... | |
err_t | ambient20_init (ambient20_t *ctx, ambient20_cfg_t *cfg) |
Ambient 20 initialization function. More... | |
err_t | ambient20_default_cfg (ambient20_t *ctx) |
Ambient 20 default configuration function. More... | |
err_t | ambient20_generic_write (ambient20_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Ambient 20 I2C writing function. More... | |
err_t | ambient20_generic_read (ambient20_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Ambient 20 I2C reading function. More... | |
err_t | ambient20_sw_reset (ambient20_t *ctx) |
Ambient 20 software reset function. More... | |
err_t | ambient20_get_manufacturer_id (ambient20_t *ctx, uint8_t *manufacturer_id) |
Ambient 20 read manufacturer id function. More... | |
err_t | ambient20_get_part_id (ambient20_t *ctx, uint8_t *part_id) |
Ambient 20 read part id function. More... | |
err_t | ambient20_enable_wait_mode (ambient20_t *ctx) |
Ambient 20 enable wait mode function. More... | |
err_t | ambient20_disable_wait_mode (ambient20_t *ctx) |
Ambient 20 disable wait mode function. More... | |
err_t | ambient20_set_meas_mode (ambient20_t *ctx, uint8_t meas_mode) |
Ambient 20 set measurement mode function. More... | |
err_t | ambient20_set_gain (ambient20_t *ctx, uint8_t data0_gain, uint8_t data1_gain) |
Ambient 20 set data gain function. More... | |
err_t | ambient20_enable_meas (ambient20_t *ctx) |
Ambient 20 enable measurements function. More... | |
err_t | ambient20_disable_meas (ambient20_t *ctx) |
Ambient 20 disable measurements function. More... | |
err_t | ambient20_check_valid (ambient20_t *ctx) |
Ambient 20 check valid bit function. More... | |
err_t | ambient20_read_data0 (ambient20_t *ctx, uint16_t *data0_out) |
Ambient 20 read data0 function. More... | |
err_t | ambient20_read_data1 (ambient20_t *ctx, uint16_t *data1_out) |
Ambient 20 read data1 function. More... | |
API for configuring and manipulating Ambient 20 Click driver.
void ambient20_cfg_setup | ( | ambient20_cfg_t * | cfg | ) |
Ambient 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ambient20_cfg_t object definition for detailed explanation. |
err_t ambient20_check_valid | ( | ambient20_t * | ctx | ) |
Ambient 20 check valid bit function.
This function is used to check valid bit of the Ambient 20 Click. Valid bit is used to check status of the AMBIENT20_MODE_CONTROL1_REG, AMBIENT20_MODE_CONTROL2_REG and AMBIENT20_MODE_CONTROL3_REG data.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Measurment data is updated, -1
- Measurment data is not updated. err_t ambient20_default_cfg | ( | ambient20_t * | ctx | ) |
Ambient 20 default configuration function.
This function executes a default configuration of Ambient 20 click board.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_disable_meas | ( | ambient20_t * | ctx | ) |
Ambient 20 disable measurements function.
This function is used to disable measurment mode of the Ambient 20 Click.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_disable_wait_mode | ( | ambient20_t * | ctx | ) |
Ambient 20 disable wait mode function.
This function disables wait mode. Wait mode can be enabled only when MEAS_MODE is set in 55mS mode. When this mode is active, measurement time is same as in 100mS mode.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_enable_meas | ( | ambient20_t * | ctx | ) |
Ambient 20 enable measurements function.
This function is used to set the Ambient 20 Click into measurment mode.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_enable_wait_mode | ( | ambient20_t * | ctx | ) |
Ambient 20 enable wait mode function.
This function is enableing wait mode. Wait mode can be enabled only when MEAS_MODE is set in 55mS mode. When this mode is active, measurement time is same as in 100mS mode.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_generic_read | ( | ambient20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Ambient 20 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 ambient20_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 ambient20_generic_write | ( | ambient20_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Ambient 20 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 ambient20_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 ambient20_get_manufacturer_id | ( | ambient20_t * | ctx, |
uint8_t * | manufacturer_id | ||
) |
Ambient 20 read manufacturer id function.
This function is performing reading of the manufacturer id by using I2C serial interface.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[out] | manufacturer_id | : Read manufacturer id. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_get_part_id | ( | ambient20_t * | ctx, |
uint8_t * | part_id | ||
) |
Ambient 20 read part id function.
This function is performing reading of the part id by using I2C serial interface.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[out] | part_id | : Read part id. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_init | ( | ambient20_t * | ctx, |
ambient20_cfg_t * | cfg | ||
) |
Ambient 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ambient20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_read_data0 | ( | ambient20_t * | ctx, |
uint16_t * | data0_out | ||
) |
Ambient 20 read data0 function.
This function is used to read data0 channel data.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[out] | data0_out | : Data0 read data. |
0
- Measurment data is updated, -1
- Measurment data is not updated. err_t ambient20_read_data1 | ( | ambient20_t * | ctx, |
uint16_t * | data1_out | ||
) |
Ambient 20 read data1 function.
This function is used to read data1 channel data.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[out] | data1_out | : Data1 read data. |
0
- Measurment data is updated, -1
- Measurment data is not updated. err_t ambient20_set_gain | ( | ambient20_t * | ctx, |
uint8_t | data0_gain, | ||
uint8_t | data1_gain | ||
) |
Ambient 20 set data gain function.
This function is used to set ADC data gain. This function only uses 3 alredy provided modes, other settings are prohibited.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[in] | data0_gain | : Data 0 gain value. |
[in] | data1_gain | : Data 1 gain value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_set_meas_mode | ( | ambient20_t * | ctx, |
uint8_t | meas_mode | ||
) |
Ambient 20 set measurement mode function.
This function is used to set measurement mode for DATA0 and DATA0, provided modes are 100mS and 55mS mode.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
[in] | meas_mode | : Measurement mode value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ambient20_sw_reset | ( | ambient20_t * | ctx | ) |
Ambient 20 software reset function.
This function is performing software reset by setting SW_RESET bit by using I2C serial interface.
[in] | ctx | : Click context object. See ambient20_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.