adc19 2.0.0.0
|
API for configuring and manipulating ADC 19 Click driver. More...
Topics | |
ADC 19 Settings | |
Settings of ADC 19 Click driver. | |
ADC 19 MikroBUS Map | |
MikroBUS pin mapping of ADC 19 Click driver. | |
Functions | |
void | adc19_cfg_setup (adc19_cfg_t *cfg) |
ADC 19 configuration object setup function. | |
err_t | adc19_init (adc19_t *ctx, adc19_cfg_t *cfg) |
ADC 19 initialization function. | |
void | adc19_set_vref (adc19_t *ctx, float vref) |
ADC 19 set vref function. | |
err_t | adc19_set_input_channel (adc19_t *ctx, uint8_t input_ch) |
ADC 19 set input channel function. | |
err_t | adc19_get_voltage (adc19_t *ctx, float *voltage) |
ADC 19 get voltage function. | |
API for configuring and manipulating ADC 19 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void adc19_cfg_setup | ( | adc19_cfg_t * | cfg | ) |
ADC 19 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc19_cfg_t object definition for detailed explanation. |
err_t adc19_get_voltage | ( | adc19_t * | ctx, |
float * | voltage ) |
ADC 19 get voltage function.
This function reads the voltage from the previously selected channel by using SPI serial interface.
[in] | ctx | : Click context object. See adc19_t object definition for detailed explanation. |
[out] | voltage | : Voltage value [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc19_init | ( | adc19_t * | ctx, |
adc19_cfg_t * | cfg ) |
ADC 19 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc19_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc19_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc19_set_input_channel | ( | adc19_t * | ctx, |
uint8_t | input_ch ) |
ADC 19 set input channel function.
This function sets the selected input channel active by modifying the control register.
[in] | ctx | : Click context object. See adc19_t object definition for detailed explanation. |
[in] | input_ch | : Input channel number (1-2). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void adc19_set_vref | ( | adc19_t * | ctx, |
float | vref ) |
ADC 19 set vref function.
This function sets the voltage reference value that will be used for voltage calculation.
[in] | ctx | : Click context object. See adc19_t object definition for detailed explanation. |
[in] | vref | : Voltage reference 3.3V or 5.0V. |