adc12
2.0.0.0
|
API for configuring and manipulating ADC 12 Click driver. More...
Modules | |
ADC 12 Commands List | |
List of commands of ADC 12 Click driver. | |
ADC 12 Registers Settings | |
Settings for registers of ADC 12 Click driver. | |
ADC 12 MikroBUS Map | |
MikroBUS pin mapping of ADC 12 Click driver. | |
Functions | |
void | adc12_cfg_setup (adc12_cfg_t *cfg) |
ADC 12 configuration object setup function. More... | |
err_t | adc12_init (adc12_t *ctx, adc12_cfg_t *cfg) |
ADC 12 initialization function. More... | |
err_t | adc12_send_cmd (adc12_t *ctx, uint8_t cmd_byte) |
ADC 12 send command function. More... | |
err_t | adc12_read_data (adc12_t *ctx, uint16_t *data_out) |
ADC 12 read data function. More... | |
void | adc12_set_sd_mode (adc12_t *ctx, uint8_t sd_mode) |
ADC 12 set the Single-Ended/Differential Inputs function. More... | |
uint8_t | adc12_get_sd_mode (adc12_t *ctx) |
ADC 12 get the Single-Ended/Differential Inputs function. More... | |
void | adc12_set_pd_mode (adc12_t *ctx, uint8_t pd_mode) |
ADC 12 set the Power-Down mode function. More... | |
uint8_t | adc12_get_pd_mode (adc12_t *ctx) |
ADC 12 get the Power-Down mode function. More... | |
err_t | adc12_read_raw_data (adc12_t *ctx, uint8_t ch, uint16_t *data_out) |
ADC 12 read raw ADC data function. More... | |
err_t | adc12_read_voltage (adc12_t *ctx, uint8_t ch, uint16_t vref, float *data_out) |
ADC 12 read voltage function. More... | |
API for configuring and manipulating ADC 12 Click driver.
void adc12_cfg_setup | ( | adc12_cfg_t * | cfg | ) |
ADC 12 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc12_cfg_t object definition for detailed explanation. |
uint8_t adc12_get_pd_mode | ( | adc12_t * | ctx | ) |
ADC 12 get the Power-Down mode function.
This function returns the currently set value for the power-down mode.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
uint8_t adc12_get_sd_mode | ( | adc12_t * | ctx | ) |
ADC 12 get the Single-Ended/Differential Inputs function.
This function returns the currently set value for the input mode.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
err_t adc12_init | ( | adc12_t * | ctx, |
adc12_cfg_t * | cfg | ||
) |
ADC 12 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc12_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t adc12_read_data | ( | adc12_t * | ctx, |
uint16_t * | data_out | ||
) |
ADC 12 read data function.
This function reads two bytes of data from the click board via I2C serial interface.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[out] | data_out | : Read data output. |
0
- Success, -1
- Error.err_t adc12_read_raw_data | ( | adc12_t * | ctx, |
uint8_t | ch, | ||
uint16_t * | data_out | ||
) |
ADC 12 read raw ADC data function.
This function reads raw 12-bit ADC data from the desired channel.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[in] | ch | : Value that defines the ADC channel. |
[out] | data_out | : 12-bit RAW ADC data output. |
0
- Success, -1
- Error.err_t adc12_read_voltage | ( | adc12_t * | ctx, |
uint8_t | ch, | ||
uint16_t | vref, | ||
float * | data_out | ||
) |
ADC 12 read voltage function.
This function reads the voltage in milivolts from the desired channel.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[in] | ch | : Value that defines the ADC channel. |
[in] | vref | : Reference voltage value. |
[out] | data_out | : ADC voltage in milivolts. |
0
- Success, -1
- Error.err_t adc12_send_cmd | ( | adc12_t * | ctx, |
uint8_t | cmd_byte | ||
) |
ADC 12 send command function.
This function sends a desired command byte to the click board via I2C serial interface.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[in] | cmd_byte | : Command byte. |
0
- Success, -1
- Error.void adc12_set_pd_mode | ( | adc12_t * | ctx, |
uint8_t | pd_mode | ||
) |
ADC 12 set the Power-Down mode function.
This function sets the power-down mode.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[in] | pd_mode | : Value that defines power-down mode. |
void adc12_set_sd_mode | ( | adc12_t * | ctx, |
uint8_t | sd_mode | ||
) |
ADC 12 set the Single-Ended/Differential Inputs function.
This function sets the input mode.
[out] | ctx | : Click context object. See adc12_t object definition for detailed explanation. |
[in] | sd_mode | : Value that defines input mode. |