isoadc2 2.0.0.0
|
API for configuring and manipulating ISO ADC 2 Click driver. More...
Topics | |
ISO ADC 2 Registers Settings | |
Settings for registers of ISO ADC 2 Click driver. | |
ISO ADC 2 MikroBUS Map | |
MikroBUS pin mapping of ISO ADC 2 Click driver. | |
Functions | |
void | isoadc2_cfg_setup (isoadc2_cfg_t *cfg) |
ISO ADC 2 configuration object setup function. | |
err_t | isoadc2_init (isoadc2_t *ctx, isoadc2_cfg_t *cfg) |
ISO ADC 2 initialization function. | |
err_t | isoadc2_generic_write (isoadc2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
ISO ADC 2 data writing function. | |
err_t | isoadc2_generic_read (isoadc2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
ISO ADC 2 data reading function. | |
err_t | isoadc2_read_adc (isoadc2_t *ctx, uint16_t *adc_val) |
ISO ADC 2 ADC data reading function. | |
err_t | isoadc2_get_mv (isoadc2_t *ctx, uint16_t *voltage) |
ISO ADC 2 voltage data reading function. | |
API for configuring and manipulating ISO ADC 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void isoadc2_cfg_setup | ( | isoadc2_cfg_t * | cfg | ) |
ISO ADC 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See isoadc2_cfg_t object definition for detailed explanation. |
err_t isoadc2_generic_read | ( | isoadc2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
ISO ADC 2 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc2_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.err_t isoadc2_generic_write | ( | isoadc2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
ISO ADC 2 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc2_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.err_t isoadc2_get_mv | ( | isoadc2_t * | ctx, |
uint16_t * | voltage ) |
ISO ADC 2 voltage data reading function.
Function converts data to mV value.
[in] | ctx | : Click context object. See isoadc2_t object definition for detailed explanation. |
[out] | voltage | : Converted mV data. |
0
- Success, -1
- Error.err_t isoadc2_init | ( | isoadc2_t * | ctx, |
isoadc2_cfg_t * | cfg ) |
ISO ADC 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See isoadc2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See isoadc2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t isoadc2_read_adc | ( | isoadc2_t * | ctx, |
uint16_t * | adc_val ) |
ISO ADC 2 ADC data reading function.
Generic function for reading 12bit ADC data from device
[in] | ctx | : Click context object. See isoadc2_t object definition for detailed explanation. |
[out] | adc_val | : Raw ADC data. |
0
- Success, -1
- Error.