adc21 2.1.0.0
|
API for configuring and manipulating ADC 21 Click driver. More...
Topics | |
ADC 21 Settings | |
Settings of ADC 21 Click driver. | |
ADC 21 MikroBUS Map | |
MikroBUS pin mapping of ADC 21 Click driver. | |
Functions | |
void | adc21_cfg_setup (adc21_cfg_t *cfg) |
ADC 21 configuration object setup function. | |
err_t | adc21_init (adc21_t *ctx, adc21_cfg_t *cfg) |
ADC 21 initialization function. | |
err_t | adc21_read_raw_adc (adc21_t *ctx, uint8_t channel, uint16_t *raw_adc) |
ADC 21 read raw adc function. | |
err_t | adc21_read_voltage (adc21_t *ctx, uint8_t channel, float avcc, float *voltage) |
ADC 21 read voltage function. | |
API for configuring and manipulating ADC 21 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void adc21_cfg_setup | ( | adc21_cfg_t * | cfg | ) |
ADC 21 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc21_cfg_t object definition for detailed explanation. |
err_t adc21_init | ( | adc21_t * | ctx, |
adc21_cfg_t * | cfg ) |
ADC 21 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc21_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc21_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc21_read_raw_adc | ( | adc21_t * | ctx, |
uint8_t | channel, | ||
uint16_t * | raw_adc ) |
ADC 21 read raw adc function.
This function reads raw ADC value from the selected channel by using SPI serial interface.
[in] | ctx | : Click context object. See adc21_t object definition for detailed explanation. |
[in] | channel | : Input channel selection (0-7). |
[out] | raw_adc | : 12-bit raw ADC value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc21_read_voltage | ( | adc21_t * | ctx, |
uint8_t | channel, | ||
float | avcc, | ||
float * | voltage ) |
ADC 21 read voltage function.
This function reads raw ADC value from the selected channel and converts it to proportional voltage level depending on the avcc selection.
[in] | ctx | : Click context object. See adc21_t object definition for detailed explanation. |
[in] | channel | : Input channel selection (0-7). |
[in] | avcc | : Voltage on AVCC (3.3V by default). |
[out] | voltage | : Output voltage level [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.