isoadc6 2.1.0.0
ISO ADC 6 Click Driver

API for configuring and manipulating ISO ADC 6 Click driver. More...

Topics

 ISO ADC 6 Registers List
 List of registers of ISO ADC 6 Click driver.
 
 ISO ADC 6 Registers Settings
 Settings for registers of ISO ADC 6 Click driver.
 
 ISO ADC 6 MikroBUS Map
 MikroBUS pin mapping of ISO ADC 6 Click driver.
 
 Isoadc6_cmd
 

Functions

void isoadc6_cfg_setup (isoadc6_cfg_t *cfg)
 ISO ADC 6 configuration object setup function.
 
err_t isoadc6_init (isoadc6_t *ctx, isoadc6_cfg_t *cfg)
 ISO ADC 6 initialization function.
 
err_t isoadc6_default_cfg (isoadc6_t *ctx)
 ISO ADC 6 default configuration function.
 
err_t isoadc6_generic_write (isoadc6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 ISO ADC 6 data writing function.
 
err_t isoadc6_generic_read (isoadc6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 ISO ADC 6 data reading function.
 
err_t isoadc6_write_byte (isoadc6_t *ctx, uint8_t reg, uint8_t data_in)
 ISO ADC 6 byte writing function.
 
err_t isoadc6_read_byte (isoadc6_t *ctx, uint8_t reg, uint8_t *data_out)
 ISO ADC 6 byte reading function.
 
err_t isoadc6_write_word (isoadc6_t *ctx, uint8_t reg, uint16_t data_in)
 ISO ADC 6 word writing function.
 
err_t isoadc6_read_word (isoadc6_t *ctx, uint8_t reg, uint16_t *data_out)
 ISO ADC 6 word reading function.
 
err_t isoadc6_write_dword (isoadc6_t *ctx, uint8_t reg, uint32_t data_in)
 ISO ADC 6 dword writing function.
 
err_t isoadc6_read_dword (isoadc6_t *ctx, uint8_t reg, uint32_t *data_out)
 ISO ADC 6 dword reading function.
 
err_t isoadc6_get_device_id (isoadc6_t *ctx, uint8_t *device_id, uint8_t *sil_rev)
 ISO ADC 6 get device ID function.
 
err_t isoadc6_set_channel (isoadc6_t *ctx, uint8_t sel_ch, uint16_t ch_data)
 ISO ADC 6 set channel function.
 
err_t isoadc6_set_ch_config (isoadc6_t *ctx, uint16_t cfg_data)
 ISO ADC 6 set channel config function.
 
err_t isoadc6_set_adc_control (isoadc6_t *ctx, uint16_t adc_ctrl)
 ISO ADC 6 set ADC control function.
 
err_t isoadc6_set_ch_offset (isoadc6_t *ctx, uint32_t offset)
 ISO ADC 6 set channel offset function.
 
err_t isoadc6_get_ch_offset (isoadc6_t *ctx, uint32_t *offset)
 ISO ADC 6 get channel offset function.
 
err_t isoadc6_set_ch_gain (isoadc6_t *ctx, uint32_t gain)
 ISO ADC 6 set channel gain function.
 
err_t isoadc6_get_ch_gain (isoadc6_t *ctx, uint32_t *gain)
 ISO ADC 6 get channel gain function.
 
err_t isoadc6_get_adc_data (isoadc6_t *ctx, uint32_t *adc_data)
 ISO ADC 6 get ADC data function.
 
err_t isoadc6_get_voltage (isoadc6_t *ctx, float *voltage)
 ISO ADC 6 get voltage level function.
 

Detailed Description

API for configuring and manipulating ISO ADC 6 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

◆ isoadc6_cfg_setup()

void isoadc6_cfg_setup ( isoadc6_cfg_t * cfg)

ISO ADC 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ isoadc6_default_cfg()

err_t isoadc6_default_cfg ( isoadc6_t * ctx)

ISO ADC 6 default configuration function.

This function executes a default configuration of ISO ADC 6 click board.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ isoadc6_generic_read()

err_t isoadc6_generic_read ( isoadc6_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

ISO ADC 6 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 isoadc6_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.
Note
None.

◆ isoadc6_generic_write()

err_t isoadc6_generic_write ( isoadc6_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

ISO ADC 6 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 isoadc6_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.
Note
None.

◆ isoadc6_get_adc_data()

err_t isoadc6_get_adc_data ( isoadc6_t * ctx,
uint32_t * adc_data )

ISO ADC 6 get ADC data function.

This function is used to read 24-Bit ADC raw data value of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[out]ch_data: 24-Bit ADC data value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_get_ch_gain()

err_t isoadc6_get_ch_gain ( isoadc6_t * ctx,
uint32_t * gain )

ISO ADC 6 get channel gain function.

This function reads a channel gain data of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[out]ch_data: Channel gain.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_get_ch_offset()

err_t isoadc6_get_ch_offset ( isoadc6_t * ctx,
uint32_t * offset )

ISO ADC 6 get channel offset function.

This function reads a channel offset data of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[out]ch_data: Channel offset.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_get_device_id()

err_t isoadc6_get_device_id ( isoadc6_t * ctx,
uint8_t * device_id,
uint8_t * sil_rev )

ISO ADC 6 get device ID function.

This function read the device ID and silicon revision of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[out]device_id: Device ID.
[out]sil_rev: Silicon revision.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_get_voltage()

err_t isoadc6_get_voltage ( isoadc6_t * ctx,
float * voltage )

ISO ADC 6 get voltage level function.

This function reads results of 24-bit ADC raw data and converts them to proportional voltage level [V], of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[out]voltage:Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_init()

err_t isoadc6_init ( isoadc6_t * ctx,
isoadc6_cfg_t * cfg )

ISO ADC 6 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See isoadc6_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_read_byte()

err_t isoadc6_read_byte ( isoadc6_t * ctx,
uint8_t reg,
uint8_t * data_out )

ISO ADC 6 byte reading function.

This function reads a desired data byte from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read 8-bit data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_read_dword()

err_t isoadc6_read_dword ( isoadc6_t * ctx,
uint8_t reg,
uint32_t * data_out )

ISO ADC 6 dword reading function.

This function reads a desired data dword from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read 32-bit data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_read_word()

err_t isoadc6_read_word ( isoadc6_t * ctx,
uint8_t reg,
uint16_t * data_out )

ISO ADC 6 word reading function.

This function reads a desired data word from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read 16-bit data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_set_adc_control()

err_t isoadc6_set_adc_control ( isoadc6_t * ctx,
uint16_t adc_ctrl )

ISO ADC 6 set ADC control function.

This function sets the ADC control configuration of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]adc_ctrl_data: ADC control configuration data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_set_ch_config()

err_t isoadc6_set_ch_config ( isoadc6_t * ctx,
uint16_t cfg_data )

ISO ADC 6 set channel config function.

This function sets the configuration of the channel settings of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]ch_data: Configuration data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_set_ch_gain()

err_t isoadc6_set_ch_gain ( isoadc6_t * ctx,
uint32_t gain )

ISO ADC 6 set channel gain function.

This function sets the channel gain of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]ch_data: Channel offset.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_set_ch_offset()

err_t isoadc6_set_ch_offset ( isoadc6_t * ctx,
uint32_t offset )

ISO ADC 6 set channel offset function.

This function sets the channel offset of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]ch_data: Channel offset.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_set_channel()

err_t isoadc6_set_channel ( isoadc6_t * ctx,
uint8_t sel_ch,
uint16_t ch_data )

ISO ADC 6 set channel function.

This function sets the channel configuration of the AD7124-8, 8-Channel, Low Noise, Low Power, 24-Bit, Sigma-Delta ADC with PGA and Reference wired with ADuM341E, 5.7 kV rms Quad Digital Isolators on the ISO ADC 6 Click board™.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]sel_ch: Channel selection [0-8].
[in]ch_data: Channel config data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_write_byte()

err_t isoadc6_write_byte ( isoadc6_t * ctx,
uint8_t reg,
uint8_t data_in )

ISO ADC 6 byte writing function.

This function writes a desired data byte to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: 8-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_write_dword()

err_t isoadc6_write_dword ( isoadc6_t * ctx,
uint8_t reg,
uint32_t data_in )

ISO ADC 6 dword writing function.

This function writes a desired data dword to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: 32-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc6_write_word()

err_t isoadc6_write_word ( isoadc6_t * ctx,
uint8_t reg,
uint16_t data_in )

ISO ADC 6 word writing function.

This function writes a desired data word to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc6_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.