adc22 2.1.0.0
ADC 22 Click Driver

API for configuring and manipulating ADC 22 Click driver. More...

Topics

 ADC 22 commands List
 List of commands of ADC 22 Click driver.
 
 ADC 22 Registers List
 List of registers of ADC 22 Click driver.
 
 ADC 22 Registers Settings
 Settings for registers of ADC 22 Click driver.
 
 ADC 22 MikroBUS Map
 MikroBUS pin mapping of ADC 22 Click driver.
 

Functions

void adc22_cfg_setup (adc22_cfg_t *cfg)
 ADC 22 configuration object setup function.
 
err_t adc22_init (adc22_t *ctx, adc22_cfg_t *cfg)
 ADC 22 initialization function.
 
err_t adc22_default_cfg (adc22_t *ctx)
 ADC 22 default configuration function.
 
void adc22_hw_reset (adc22_t *ctx)
 ADC 22 HW reset function.
 
uint8_t adc22_get_interrupt (adc22_t *ctx)
 ADC 22 get interrupt function.
 
uint8_t adc22_get_rvs (adc22_t *ctx)
 ADC 22 get RVS function.
 
err_t adc22_write_reg (adc22_t *ctx, uint8_t w_cmd, uint8_t reg, uint8_t data_in)
 ADC 22 data writing function.
 
err_t adc22_read_reg (adc22_t *ctx, uint8_t r_cmd, uint8_t reg, uint8_t *data_out)
 ADC 22 data reading function.
 
err_t adc22_get_adc_raw_data (adc22_t *ctx, uint16_t *raw_adc)
 ADC 22 get ADC raw data function.
 
err_t adc22_get_voltage (adc22_t *ctx, float *voltage)
 ADC 22 get voltage level function.
 
err_t adc22_set_device_addr (adc22_t *ctx, uint8_t device_addr)
 ADC 22 set device address function.
 
err_t adc22_get_device_id (adc22_t *ctx, uint8_t *device_id)
 ADC 22 get device ID function.
 
err_t adc22_set_sdo_mode (adc22_t *ctx, uint8_t sdo_mode)
 ADC 22 set SDO mode function.
 
err_t adc22_en_out_data_parity (adc22_t *ctx)
 ADC 22 enable output data parity function.
 
err_t adc22_set_range (adc22_t *ctx, adc22_range_sel_t range)
 ADC 22 set range function.
 
err_t adc22_get_range (adc22_t *ctx, uint8_t *range)
 ADC 22 get range function.
 

Detailed Description

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

◆ adc22_cfg_setup()

void adc22_cfg_setup ( adc22_cfg_t * cfg)

ADC 22 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adc22_default_cfg()

err_t adc22_default_cfg ( adc22_t * ctx)

ADC 22 default configuration function.

This function executes a default configuration of ADC 22 click board.

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

◆ adc22_en_out_data_parity()

err_t adc22_en_out_data_parity ( adc22_t * ctx)

ADC 22 enable output data parity function.

This function enables output data parity and configure output value [1's] of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_get_adc_raw_data()

err_t adc22_get_adc_raw_data ( adc22_t * ctx,
uint16_t * raw_adc )

ADC 22 get ADC raw data function.

This function reads a 12-bit ADC raw data of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

Parameters
[in]ctx: Click context object. See adc22_t object definition for detailed explanation.
[out]raw_adc: 12-bit ADC raw data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc22_get_device_id()

err_t adc22_get_device_id ( adc22_t * ctx,
uint8_t * device_id )

ADC 22 get device ID function.

This function reads the device address ID of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_get_interrupt()

uint8_t adc22_get_interrupt ( adc22_t * ctx)

ADC 22 get interrupt function.

This function get states of the interrupt [INT] pin of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

Parameters
[in]ctx: Click context object. See adc22_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ adc22_get_range()

err_t adc22_get_range ( adc22_t * ctx,
uint8_t * range )

ADC 22 get range function.

This function reads the operating input range of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_get_rvs()

uint8_t adc22_get_rvs ( adc22_t * ctx)

ADC 22 get RVS function.

This function get states of the reflects status [RVS] pin of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

Parameters
[in]ctx: Click context object. See adc22_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ adc22_get_voltage()

err_t adc22_get_voltage ( adc22_t * ctx,
float * voltage )

ADC 22 get voltage level function.

This function reads results of 12-bit ADC raw data and converts them to proportional voltage level, depending on the configured operating input range of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_hw_reset()

void adc22_hw_reset ( adc22_t * ctx)

ADC 22 HW reset function.

This function resets the module by toggling the reset [RST] pin of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_init()

err_t adc22_init ( adc22_t * ctx,
adc22_cfg_t * cfg )

ADC 22 initialization function.

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

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

◆ adc22_read_reg()

err_t adc22_read_reg ( adc22_t * ctx,
uint8_t r_cmd,
uint8_t reg,
uint8_t * data_out )

ADC 22 data reading function.

This function reads a data bytes from the selected register by using desired read command of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

Parameters
[in]ctx: Click context object. See adc22_t object definition for detailed explanation.
[in]r_cmd: Raed command. See #adc22_cmd 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.

◆ adc22_set_device_addr()

err_t adc22_set_device_addr ( adc22_t * ctx,
uint8_t device_addr )

ADC 22 set device address function.

This function sets the device address of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_set_range()

err_t adc22_set_range ( adc22_t * ctx,
adc22_range_sel_t range )

ADC 22 set range function.

This function sets operating input range of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

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

◆ adc22_set_sdo_mode()

err_t adc22_set_sdo_mode ( adc22_t * ctx,
uint8_t sdo_mode )

ADC 22 set SDO mode function.

This function configure desired SDO operation mode of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

Parameters
[in]ctx: Click context object. See adc22_t object definition for detailed explanation.
[in]sdo_mode: SDO operation mode [1-3].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc22_write_reg()

err_t adc22_write_reg ( adc22_t * ctx,
uint8_t w_cmd,
uint8_t reg,
uint8_t data_in )

ADC 22 data writing function.

This function writes a desired data to the selected register by using desired write command of the ADS8665IPW, 12-Bit, High-Speed, Single-Supply, SAR ADC Data Acquisition System With Programmable, Bipolar Input Ranges on the ADC 22 Click board™.

Parameters
[in]ctx: Click context object. See adc22_t object definition for detailed explanation.
[in]w_cmd: Write command. See #adc22_cmd 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.