adc24
2.1.0.0
|
API for configuring and manipulating ADC 24 Click driver. More...
Modules | |
ADC 24 Control Register Settings | |
Settings for control register of ADC 24 Click driver. | |
ADC 24 MikroBUS Map | |
MikroBUS pin mapping of ADC 24 Click driver. | |
Functions | |
void | adc24_cfg_setup (adc24_cfg_t *cfg) |
ADC 24 configuration object setup function. More... | |
err_t | adc24_init (adc24_t *ctx, adc24_cfg_t *cfg) |
ADC 24 initialization function. More... | |
err_t | adc24_generic_write (adc24_t *ctx, uint16_t control) |
ADC 24 data writing function. More... | |
err_t | adc24_generic_read (adc24_t *ctx, uint16_t *data_out) |
ADC 24 data reading function. More... | |
err_t | adc24_get_adc_data (adc24_t *ctx, adc24_ctrl_t ctrl, uint8_t *in_pos, uint16_t *adc_data) |
ADC 24 get ADC data function. More... | |
err_t | adc24_get_voltage (adc24_t *ctx, adc24_ctrl_t ctrl, uint8_t *in_pos, float *voltage) |
ADC 24 get voltage level function. More... | |
API for configuring and manipulating ADC 24 Click driver.
void adc24_cfg_setup | ( | adc24_cfg_t * | cfg | ) |
ADC 24 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See adc24_cfg_t object definition for detailed explanation. |
err_t adc24_generic_read | ( | adc24_t * | ctx, |
uint16_t * | data_out | ||
) |
ADC 24 data reading function.
This function reads a output data by using the SPI serial interface.
[in] | ctx | : Click context object. See adc24_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc24_generic_write | ( | adc24_t * | ctx, |
uint16_t | control | ||
) |
ADC 24 data writing function.
This function writes a desired control data by using the SPI serial interface.
[in] | ctx | : Click context object. See adc24_t object definition for detailed explanation. |
[in] | control | : Control register bit mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc24_get_adc_data | ( | adc24_t * | ctx, |
adc24_ctrl_t | ctrl, | ||
uint8_t * | in_pos, | ||
uint16_t * | adc_data | ||
) |
ADC 24 get ADC data function.
This function reads a conversion result and selected channel by using the SPI serial interface.
[in] | ctx | : Click context object. See adc24_t object definition for detailed explanation. |
[in] | ctrl | : Control register object. See adc24_ctrl_t object definition for detailed explanation. |
[out] | in_pos | : Voltage input channel position [0-15]. |
[out] | adc_data | : 12-bit ADC raw data value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc24_get_voltage | ( | adc24_t * | ctx, |
adc24_ctrl_t | ctrl, | ||
uint8_t * | in_pos, | ||
float * | voltage | ||
) |
ADC 24 get voltage level function.
This function reads the results of 12-bit ADC raw data and converts them to proportional voltage levels by using the SPI serial interface.
[in] | ctx | : Click context object. See adc24_t object definition for detailed explanation. |
[in] | ctrl | : Control register object. See adc24_ctrl_t object definition for detailed explanation. |
[out] | in_pos | : Voltage input channel position [0-15]. |
[out] | voltage | : Output voltage level [0-2.5] or [0-5.0]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t adc24_init | ( | adc24_t * | ctx, |
adc24_cfg_t * | cfg | ||
) |
ADC 24 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See adc24_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See adc24_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.