isoadc7  2.1.0.0
Modules | Functions
ISO ADC 7 Click Driver

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

Modules

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

Functions

void isoadc7_cfg_setup (isoadc7_cfg_t *cfg)
 ISO ADC 7 configuration object setup function. More...
 
err_t isoadc7_init (isoadc7_t *ctx, isoadc7_cfg_t *cfg)
 ISO ADC 7 initialization function. More...
 
err_t isoadc7_default_cfg (isoadc7_t *ctx)
 ISO ADC 7 default configuration function. More...
 
err_t isoadc7_write_reg (isoadc7_t *ctx, uint8_t reg, uint16_t data_in)
 ISO ADC 7 write reg function. More...
 
err_t isoadc7_write_regs (isoadc7_t *ctx, uint8_t reg, uint16_t *data_in, uint8_t len)
 ISO ADC 7 write regs function. More...
 
err_t isoadc7_read_reg (isoadc7_t *ctx, uint8_t reg, uint16_t *data_out)
 ISO ADC 7 read reg function. More...
 
err_t isoadc7_read_regs (isoadc7_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t len)
 ISO ADC 7 read regs function. More...
 
err_t isoadc7_standby (isoadc7_t *ctx)
 ISO ADC 7 standby function. More...
 
err_t isoadc7_wakeup (isoadc7_t *ctx)
 ISO ADC 7 wakeup function. More...
 
err_t isoadc7_lock (isoadc7_t *ctx)
 ISO ADC 7 lock function. More...
 
err_t isoadc7_unlock (isoadc7_t *ctx)
 ISO ADC 7 unlock function. More...
 
err_t isoadc7_sw_reset (isoadc7_t *ctx)
 ISO ADC 7 sw reset function. More...
 
void isoadc7_reset_device (isoadc7_t *ctx)
 ISO ADC 7 reset device function. More...
 
void isoadc7_set_rst_pin (isoadc7_t *ctx, uint8_t state)
 ISO ADC 7 set RST pin function. More...
 
void isoadc7_enable_osc (isoadc7_t *ctx)
 ISO ADC 7 enable osc function. More...
 
void isoadc7_disable_osc (isoadc7_t *ctx)
 ISO ADC 7 disable osc function. More...
 
uint8_t isoadc7_get_drdy_pin (isoadc7_t *ctx)
 ISO ADC 7 get DRDY pin function. More...
 
err_t isoadc7_check_id (isoadc7_t *ctx)
 ISO ADC 7 check ID function. More...
 
err_t isoadc7_set_word_size (isoadc7_t *ctx, uint8_t word_size)
 ISO ADC 7 set word size function. More...
 
err_t isoadc7_set_gain (isoadc7_t *ctx, uint8_t gain_ch0, uint8_t gain_ch1, uint8_t gain_ch2)
 ISO ADC 7 set gain function. More...
 
err_t isoadc7_read_data (isoadc7_t *ctx, isoadc7_data_t *data_out)
 ISO ADC 7 read data function. More...
 
err_t isoadc7_read_voltage (isoadc7_t *ctx, float *ch0, float *ch1, float *ch2)
 ISO ADC 7 read voltage function. More...
 

Detailed Description

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

◆ isoadc7_cfg_setup()

void isoadc7_cfg_setup ( isoadc7_cfg_t cfg)

ISO ADC 7 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ isoadc7_check_id()

err_t isoadc7_check_id ( isoadc7_t ctx)

ISO ADC 7 check ID function.

This function checks the communication by reading and verifying the device ID.

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

◆ isoadc7_default_cfg()

err_t isoadc7_default_cfg ( isoadc7_t ctx)

ISO ADC 7 default configuration function.

This function executes a default configuration of ISO ADC 7 Click board.

Parameters
[in]ctx: Click context object. See isoadc7_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.

◆ isoadc7_disable_osc()

void isoadc7_disable_osc ( isoadc7_t ctx)

ISO ADC 7 disable osc function.

This function disables the 8.192 MHz oscillator by setting the XEN pin to low logic state.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ isoadc7_enable_osc()

void isoadc7_enable_osc ( isoadc7_t ctx)

ISO ADC 7 enable osc function.

This function enables the 8.192 MHz oscillator by setting the XEN pin to high logic state.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ isoadc7_get_drdy_pin()

uint8_t isoadc7_get_drdy_pin ( isoadc7_t ctx)

ISO ADC 7 get DRDY pin function.

This function returns the DRDY pin logic state.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ isoadc7_init()

err_t isoadc7_init ( isoadc7_t ctx,
isoadc7_cfg_t cfg 
)

ISO ADC 7 initialization function.

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

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

◆ isoadc7_lock()

err_t isoadc7_lock ( isoadc7_t ctx)

ISO ADC 7 lock function.

This function locks the device settings.

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

◆ isoadc7_read_data()

err_t isoadc7_read_data ( isoadc7_t ctx,
isoadc7_data_t data_out 
)

ISO ADC 7 read data function.

This function reads the status register and raw data of all three channels.

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

◆ isoadc7_read_reg()

err_t isoadc7_read_reg ( isoadc7_t ctx,
uint8_t  reg,
uint16_t *  data_out 
)

ISO ADC 7 read reg function.

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

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

◆ isoadc7_read_regs()

err_t isoadc7_read_regs ( isoadc7_t ctx,
uint8_t  reg,
uint16_t *  data_out,
uint8_t  len 
)

ISO ADC 7 read regs function.

This function reads a desired number of data words starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of words to be read [2-23].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc7_read_voltage()

err_t isoadc7_read_voltage ( isoadc7_t ctx,
float *  ch0,
float *  ch1,
float *  ch2 
)

ISO ADC 7 read voltage function.

This function reads the voltage measurements of all three channels.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
[out]ch0: Voltage measurement from channel 0 in millivolts.
[out]ch1: Voltage measurement from channel 1 in millivolts.
[out]ch2: Voltage measurement from channel 2 in millivolts.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc7_reset_device()

void isoadc7_reset_device ( isoadc7_t ctx)

ISO ADC 7 reset device function.

This function resets the device by toggling the RST pin.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ isoadc7_set_gain()

err_t isoadc7_set_gain ( isoadc7_t ctx,
uint8_t  gain_ch0,
uint8_t  gain_ch1,
uint8_t  gain_ch2 
)

ISO ADC 7 set gain function.

This function sets the gain level for all channels.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
[in]gain_ch0: Gain level of channel 0 [0-7].
[in]gain_ch1: Gain level of channel 1 [0-7].
[in]gain_ch2: Gain level of channel 2 [0-7].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc7_set_rst_pin()

void isoadc7_set_rst_pin ( isoadc7_t ctx,
uint8_t  state 
)

ISO ADC 7 set RST pin function.

This function sets the RST pin logic state.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ isoadc7_set_word_size()

err_t isoadc7_set_word_size ( isoadc7_t ctx,
uint8_t  word_size 
)

ISO ADC 7 set word size function.

This function sets the data word size to 2, 3, or 4 bytes.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
[in]word_size: Word size in bytes [2-4].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ isoadc7_standby()

err_t isoadc7_standby ( isoadc7_t ctx)

ISO ADC 7 standby function.

This function sets the device to standby mode.

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

◆ isoadc7_sw_reset()

err_t isoadc7_sw_reset ( isoadc7_t ctx)

ISO ADC 7 sw reset function.

This function performs the device software reset.

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

◆ isoadc7_unlock()

err_t isoadc7_unlock ( isoadc7_t ctx)

ISO ADC 7 unlock function.

This function unlocks the device settings.

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

◆ isoadc7_wakeup()

err_t isoadc7_wakeup ( isoadc7_t ctx)

ISO ADC 7 wakeup function.

This function wakes up the device from standby mode.

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

◆ isoadc7_write_reg()

err_t isoadc7_write_reg ( isoadc7_t ctx,
uint8_t  reg,
uint16_t  data_in 
)

ISO ADC 7 write reg function.

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

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

◆ isoadc7_write_regs()

err_t isoadc7_write_regs ( isoadc7_t ctx,
uint8_t  reg,
uint16_t *  data_in,
uint8_t  len 
)

ISO ADC 7 write regs function.

This function writes a desired number of data words starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc7_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of words to be written [1-23].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.