isoadc
2.1.0.0
|
API for configuring and manipulating ISO ADC Click driver. More...
Modules | |
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. More... | |
err_t | isoadc_init (isoadc_t *ctx, isoadc_cfg_t *cfg) |
ISO ADC initialization function. More... | |
err_t | isoadc_read_raw_adc (isoadc_t *ctx, uint16_t *data_out) |
ISO ADC read raw ADC function. More... | |
void | isoadc_set_vext (isoadc_t *ctx, float vext) |
ISO ADC set vext function. More... | |
err_t | isoadc_read_voltage (isoadc_t *ctx, float *voltage) |
ISO ADC read voltage function. More... | |
float | isoadc_get_current (float voltage) |
ISO ADC get current function. More... | |
float | isoadc_get_power (isoadc_t *ctx, float voltage) |
ISO ADC get power function. More... | |
API for configuring and manipulating ISO ADC Click driver.
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). |