isoadc5 2.0.0.0
ISO ADC 5 Click Driver

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

Topics

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

Functions

void isoadc5_cfg_setup (isoadc5_cfg_t *cfg)
 ISO ADC 5 configuration object setup function.
 
err_t isoadc5_init (isoadc5_t *ctx, isoadc5_cfg_t *cfg)
 ISO ADC 5 initialization function.
 
err_t isoadc5_write_register (isoadc5_t *ctx, uint8_t reg, uint16_t data_in)
 ISO ADC 5 write register function.
 
err_t isoadc5_read_register (isoadc5_t *ctx, uint8_t reg, uint16_t *data_out)
 ISO ADC 5 read register function.
 
err_t isoadc5_read_register_burst (isoadc5_t *ctx, uint8_t filt, isoadc5_burst_payload_t *payload)
 ISO ADC 5 read register function.
 
err_t isoadc5_read_voltage (isoadc5_t *ctx, uint8_t filt, uint8_t ch, float *volt)
 ISO ADC 5 read voltage function.
 
uint8_t isoadc5_get_int_pin (isoadc5_t *ctx)
 ISO ADC 5 get int pin function.
 

Detailed Description

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

◆ isoadc5_cfg_setup()

void isoadc5_cfg_setup ( isoadc5_cfg_t * cfg)

ISO ADC 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ isoadc5_get_int_pin()

uint8_t isoadc5_get_int_pin ( isoadc5_t * ctx)

ISO ADC 5 get int pin function.

This function returns the INT pin logic state.

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

◆ isoadc5_init()

err_t isoadc5_init ( isoadc5_t * ctx,
isoadc5_cfg_t * cfg )

ISO ADC 5 initialization function.

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

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

◆ isoadc5_read_register()

err_t isoadc5_read_register ( isoadc5_t * ctx,
uint8_t reg,
uint16_t * data_out )

ISO ADC 5 read register function.

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

Parameters
[in]ctx: Click context object. See isoadc5_t object definition for detailed explanation.
[in]reg: Register address [0x00-0x14].
[out]data_out: Read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function also calculates and checks the CRC byte when it is enabled.

◆ isoadc5_read_register_burst()

err_t isoadc5_read_register_burst ( isoadc5_t * ctx,
uint8_t filt,
isoadc5_burst_payload_t * payload )

ISO ADC 5 read register function.

This function reads all filtered or unfiltered ADC data registers as well as the interrupt status register and stores data in the payload structure.

Parameters
[in]ctx: Click context object. See isoadc5_t object definition for detailed explanation.
[in]filt:
  • 0 - Unfiltered ADC
  • 1 - Filtered ADC.
[out]payload: Burst payload structure where the read data is being stored. See isoadc5_burst_payload_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function also calculates and checks the CRC byte when it is enabled.

◆ isoadc5_read_voltage()

err_t isoadc5_read_voltage ( isoadc5_t * ctx,
uint8_t filt,
uint8_t ch,
float * volt )

ISO ADC 5 read voltage function.

This function reads the raw adc data from a desired input channel and converts it to voltage.

Parameters
[in]ctx: Click context object. See isoadc5_t object definition for detailed explanation.
[in]filt:
  • 0 - Unfiltered ADC
  • 1 - Filtered ADC.
[in]ch: Input channel selection [1-4].
[out]volt: Voltage read from a desired input channel.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function also calculates and checks the CRC byte when it is enabled.

◆ isoadc5_write_register()

err_t isoadc5_write_register ( isoadc5_t * ctx,
uint8_t reg,
uint16_t data_in )

ISO ADC 5 write register function.

This function writes two bytes of data to the selected register by using the SPI serial interface.

Parameters
[in]ctx: Click context object. See isoadc5_t object definition for detailed explanation.
[in]reg: Register address [0x00-0x14].
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function also calculates and sends the CRC byte when it is enabled.