isoadc2 2.0.0.0
ISO ADC 2 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ isoadc2_cfg_setup()

void isoadc2_cfg_setup ( isoadc2_cfg_t * cfg)

ISO ADC 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ isoadc2_generic_read()

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.

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

◆ isoadc2_generic_write()

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.

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

◆ isoadc2_get_mv()

err_t isoadc2_get_mv ( isoadc2_t * ctx,
uint16_t * voltage )

ISO ADC 2 voltage data reading function.

Function converts data to mV value.

Parameters
[in]ctx: Click context object. See isoadc2_t object definition for detailed explanation.
[out]voltage: Converted mV data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ isoadc2_init()

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.

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

◆ isoadc2_read_adc()

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

Parameters
[in]ctx: Click context object. See isoadc2_t object definition for detailed explanation.
[out]adc_val: Raw ADC data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.