adc23 2.1.0.0
ADC 23 Click Driver

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

Topics

 ADC 23 Registers List
 List of registers of ADC 23 Click driver.
 
 ADC 23 Registers Settings
 Settings for registers of ADC 23 Click driver.
 
 ADC 23 MikroBUS Map
 MikroBUS pin mapping of ADC 23 Click driver.
 
 Adc23_cmd
 

Functions

void adc23_cfg_setup (adc23_cfg_t *cfg)
 ADC 23 configuration object setup function.
 
err_t adc23_init (adc23_t *ctx, adc23_cfg_t *cfg)
 ADC 23 initialization function.
 
err_t adc23_default_cfg (adc23_t *ctx)
 ADC 23 default configuration function.
 
err_t adc23_generic_write (adc23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 ADC 23 data writing function.
 
err_t adc23_generic_read (adc23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 ADC 23 data reading function.
 
err_t adc23_generic_transfer (adc23_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t len)
 ADC 23 data transfer function.
 
err_t adc23_read_reg_cmd (adc23_t *ctx, uint8_t reg, uint16_t *data_out, uint8_t *reg_data_out)
 ADC 23 read register command function.
 
err_t adc23_read_reg_data (adc23_t *ctx, uint8_t reg, uint32_t *data_out, uint8_t *reg_data_out)
 ADC 23 read register data function.
 
err_t adc23_write_reg_cmd (adc23_t *ctx, uint8_t reg, uint8_t data_in, uint16_t *data_out)
 ADC 23 write register command function.
 
err_t adc23_write_reg_data (adc23_t *ctx, uint8_t reg, uint8_t data_in, uint32_t *data_out)
 ADC 23 write register data function.
 
err_t adc23_sw_reset (adc23_t *ctx)
 ADC 23 software reset function.
 
err_t adc23_start_conversion (adc23_t *ctx)
 ADC 23 start conversion function.
 
err_t adc23_stop_conversion (adc23_t *ctx)
 ADC 23 stop conversion function.
 
err_t adc23_read_conversion_data (adc23_t *ctx, int32_t *adc_data)
 ADC 23 read conversion data function.
 
err_t adc23_get_voltage (adc23_t *ctx, float *voltage)
 ADC 23 read get voltage level function.
 
void adc23_set_start (adc23_t *ctx)
 ADC 23 set start function.
 
void adc23_set_stop (adc23_t *ctx)
 ADC 23 set stop function.
 
void adc23_hw_reset (adc23_t *ctx)
 ADC 23 hardware reset function.
 
uint8_t adc23_get_data_ready (adc23_t *ctx)
 ADC 23 get data ready function.
 

Detailed Description

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

◆ adc23_cfg_setup()

void adc23_cfg_setup ( adc23_cfg_t * cfg)

ADC 23 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adc23_default_cfg()

err_t adc23_default_cfg ( adc23_t * ctx)

ADC 23 default configuration function.

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

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

◆ adc23_generic_read()

err_t adc23_generic_read ( adc23_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

ADC 23 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 adc23_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.

◆ adc23_generic_transfer()

err_t adc23_generic_transfer ( adc23_t * ctx,
uint8_t * data_in,
uint8_t * data_out,
uint8_t len )

ADC 23 data transfer function.

This function writes and reads a desired number of data bytes by using SPI serial interface.

Parameters
[in]ctx: Click context object. See adc23_t object definition for detailed explanation.
[in]data_in: Data to be written.
[out]data_out: Output read data.
[in]len: Number of bytes to be transferred (write/read).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc23_generic_write()

err_t adc23_generic_write ( adc23_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

ADC 23 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 adc23_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.

◆ adc23_get_data_ready()

uint8_t adc23_get_data_ready ( adc23_t * ctx)

ADC 23 get data ready function.

This function get states of the data ready [DRY] pin of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

Parameters
[in]ctx: Click context object. See adc23_t object definition for detailed explanation.
Returns
  • 0 - Conversion data are ready,
  • 1 - Conversions are started or resynchronized.
Note
None.

◆ adc23_get_voltage()

err_t adc23_get_voltage ( adc23_t * ctx,
float * voltage )

ADC 23 read get voltage level function.

This function reads results of 24-bit ADC raw data and converts them to proportional voltage level [mV], of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

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

◆ adc23_hw_reset()

void adc23_hw_reset ( adc23_t * ctx)

ADC 23 hardware reset function.

This function resets the module by toggling the reset [RST] pin of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

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

◆ adc23_init()

err_t adc23_init ( adc23_t * ctx,
adc23_cfg_t * cfg )

ADC 23 initialization function.

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

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

◆ adc23_read_conversion_data()

err_t adc23_read_conversion_data ( adc23_t * ctx,
int32_t * adc_data )

ADC 23 read conversion data function.

This function is used to read 24-Bit ADC raw data value of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

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

◆ adc23_read_reg_cmd()

err_t adc23_read_reg_cmd ( adc23_t * ctx,
uint8_t reg,
uint16_t * data_out,
uint8_t * reg_data_out )

ADC 23 read register command function.

This function is used to read register data and follows an off-frame protocol in which the read command is sent in one frame and the 16-Bit ADC responds with register data in the next frame of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

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

◆ adc23_read_reg_data()

err_t adc23_read_reg_data ( adc23_t * ctx,
uint8_t reg,
uint32_t * data_out,
uint8_t * reg_data_out )

ADC 23 read register data function.

This function is used to read register operation using the maximum 40-bit frame size in full-duplex operation and follows an off-frame protocol in which the read command is sent in one frame and the 24-Bit ADC responds with register data in the next frame of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

Parameters
[in]ctx: Click context object. See adc23_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data, 24-Bit ADC value.
[out]reg_data_out: Output read of register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc23_set_start()

void adc23_set_start ( adc23_t * ctx)

ADC 23 set start function.

This function is used for the synchronization control of the ADC converts continuously of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

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

◆ adc23_set_stop()

void adc23_set_stop ( adc23_t * ctx)

ADC 23 set stop function.

This function is used to stop the ADC converts continuously of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™.

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

◆ adc23_start_conversion()

err_t adc23_start_conversion ( adc23_t * ctx)

ADC 23 start conversion function.

This function performs the conversion start command of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™

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

◆ adc23_stop_conversion()

err_t adc23_stop_conversion ( adc23_t * ctx)

ADC 23 stop conversion function.

This function performs the conversion stop command of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™

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

◆ adc23_sw_reset()

err_t adc23_sw_reset ( adc23_t * ctx)

ADC 23 software reset function.

This function performs the reset sequence of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™

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

◆ adc23_write_reg_cmd()

err_t adc23_write_reg_cmd ( adc23_t * ctx,
uint8_t reg,
uint8_t data_in,
uint16_t * data_out )

ADC 23 write register command function.

This function is used to write register data performed in a single frame of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™

Parameters
[in]ctx: Click context object. See adc23_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[out]data_out: Output read data, 16-Bit ADC value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc23_write_reg_data()

err_t adc23_write_reg_data ( adc23_t * ctx,
uint8_t reg,
uint8_t data_in,
uint32_t * data_out )

ADC 23 write register data function.

This function is used to write register data performed in a 24-Bit frame size of the ADS127L11, 400-kSPS, Wide-Bandwidth, 24-Bit, Delta-Sigma ADC on the ADC 23 Click board™

Parameters
[in]ctx: Click context object. See adc23_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[out]data_out: Output read data, 24-Bit ADC value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.