isoadc 2.1.0.0
|
API for configuring and manipulating ISO ADC Click driver. More...
Topics | |
ISO ADC Settings | |
Settings of ISO ADC Click driver. | |
ISO ADC MikroBUS Map | |
MikroBUS pin mapping of ISO ADC Click driver. | |
Functions | |
void | isoadc_cfg_setup (isoadc_cfg_t *cfg) |
ISO ADC configuration object setup function. | |
err_t | isoadc_init (isoadc_t *ctx, isoadc_cfg_t *cfg) |
ISO ADC initialization function. | |
err_t | isoadc_read_raw_adc (isoadc_t *ctx, uint16_t *data_out) |
ISO ADC read raw ADC function. | |
void | isoadc_set_vext (isoadc_t *ctx, float vext) |
ISO ADC set vext function. | |
err_t | isoadc_read_voltage (isoadc_t *ctx, float *voltage) |
ISO ADC read voltage function. | |
float | isoadc_get_current (float voltage) |
ISO ADC get current function. | |
float | isoadc_get_power (isoadc_t *ctx, float voltage) |
ISO ADC get power function. | |
API for configuring and manipulating ISO ADC Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void isoadc_cfg_setup | ( | isoadc_cfg_t * | cfg | ) |
ISO ADC configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See isoadc_cfg_t object definition for detailed explanation. |
float isoadc_get_current | ( | float | voltage | ) |
ISO ADC get current function.
This function converts a shunt voltage input to a load current in milliampers.
[in] | voltage | : Voltage on a shunt resistor in millivolts. |
float isoadc_get_power | ( | isoadc_t * | ctx, |
float | voltage ) |
ISO ADC get power function.
This function converts a shunt voltage input to electrical power in watts.
[in] | ctx | : Click context object. See isoadc_t object definition for detailed explanation. |
[in] | voltage | : Voltage on a shunt resistor in millivolts. |
err_t isoadc_init | ( | isoadc_t * | ctx, |
isoadc_cfg_t * | cfg ) |
ISO ADC initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See isoadc_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See isoadc_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc_read_raw_adc | ( | isoadc_t * | ctx, |
uint16_t * | data_out ) |
ISO ADC read raw ADC function.
This function reads a raw 16-bit ADC value by using SPI serial interface.
[in] | ctx | : Click context object. See isoadc_t object definition for detailed explanation. |
[out] | data_out | : 16-bit ADC raw value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t isoadc_read_voltage | ( | isoadc_t * | ctx, |
float * | voltage ) |
ISO ADC read voltage function.
This function reads a raw ADC in ISOADC_ADC_NUM_AVERAGES number of samples and converts it to a shunt voltage in millivolts.
[in] | ctx | : Click context object. See isoadc_t object definition for detailed explanation. |
[out] | voltage | : Voltage on a shunt resistor in millivolts. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void isoadc_set_vext | ( | isoadc_t * | ctx, |
float | vext ) |
ISO ADC set vext function.
This function sets the external voltage reference (5V by default).
[in] | ctx | : Click context object. See isoadc_t object definition for detailed explanation. |
[in] | vext | : Voltage reference to be set (4.5V to 5.5V). |