isoadc 2.1.0.0
ISO ADC Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ isoadc_cfg_setup()

void isoadc_cfg_setup ( isoadc_cfg_t * cfg)

ISO ADC configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See isoadc_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ isoadc_get_current()

float isoadc_get_current ( float voltage)

ISO ADC get current function.

This function converts a shunt voltage input to a load current in milliampers.

Parameters
[in]voltage: Voltage on a shunt resistor in millivolts.
Returns
Load current in milliampers.
Note
None.

◆ isoadc_get_power()

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.

Parameters
[in]ctx: Click context object. See isoadc_t object definition for detailed explanation.
[in]voltage: Voltage on a shunt resistor in millivolts.
Returns
Electrical power in watts.
Note
None.

◆ isoadc_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc_read_raw_adc()

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.

Parameters
[in]ctx: Click context object. See isoadc_t object definition for detailed explanation.
[out]data_out: 16-bit ADC raw value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc_read_voltage()

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.

Parameters
[in]ctx: Click context object. See isoadc_t object definition for detailed explanation.
[out]voltage: Voltage on a shunt resistor in millivolts.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc_set_vext()

void isoadc_set_vext ( isoadc_t * ctx,
float vext )

ISO ADC set vext function.

This function sets the external voltage reference (5V by default).

Parameters
[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).
Returns
None.
Note
None.