adc10 2.0.0.0
ADC 10 Click Driver

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

Topics

 ADC 10 Commands List
 List of commands of ADC 10 Click driver.
 
 ADC 10 Device Settings
 Settings for registers of ADC 10 Click driver.
 
 ADC 10 MikroBUS Map
 MikroBUS pin mapping of ADC 10 Click driver.
 

Functions

void adc10_cfg_setup (adc10_cfg_t *cfg)
 ADC 10 configuration object setup function.
 
err_t adc10_init (adc10_t *ctx, adc10_cfg_t *cfg)
 ADC 10 initialization function.
 
void adc10_default_cfg (adc10_t *ctx)
 ADC 10 default configuration function.
 
err_t adc10_generic_write (adc10_t *ctx, char *data_buf, uint16_t len)
 ADC 10 data writing function.
 
err_t adc10_generic_read (adc10_t *ctx, char *data_buf, uint16_t max_len)
 ADC 10 data reading function.
 
void adc10_hw_reset (adc10_t *ctx)
 ADC 10 Hardware reset function.
 
uint8_t adc10_check_drdy (adc10_t *ctx)
 ADC 10 Check DRDY function.
 
void adc10_send_command (adc10_t *ctx, uint8_t cmd)
 ADC 10 Send command function.
 
void adc10_reset (adc10_t *ctx)
 ADC 10 Software reset function.
 
void adc10_start_sync (adc10_t *ctx)
 ADC 10 Start the synchronization function.
 
void adc10_shutdown (adc10_t *ctx)
 ADC 10 Shutdown function.
 
void adc10_write_reg (adc10_t *ctx, uint8_t reg, uint8_t tx_data)
 ADC 10 Write register function.
 
uint8_t adc10_read_reg (adc10_t *ctx, uint8_t reg)
 ADC 10 Read register function.
 
int32_t adc10_get_ch_output (adc10_t *ctx, uint8_t sel_ch)
 ADC 10 Get the channel output function.
 
float adc10_calc_voltage (adc10_t *ctx, int32_t adc_data, float vref, uint8_t gain)
 ADC 10 Calculate the voltage function.
 
void adc10_set_config (adc10_t *ctx, adc10_settings_t cfg_data)
 ADC 10 Set configuration function.
 
void adc10_get_config (adc10_t *ctx, adc10_settings_t *cfg_data)
 ADC 10 Get configuration function.
 

Detailed Description

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

◆ adc10_calc_voltage()

float adc10_calc_voltage ( adc10_t * ctx,
int32_t adc_data,
float vref,
uint8_t gain )

ADC 10 Calculate the voltage function.

This function reads the ADC output of the channel ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]adc_data: 24-bits of data ( two's complement format ) ADC data.
[in]vref: Voltage reference ( mV ).
[in]gain: Gain.
Returns
float voltage data ( mV ).
Note
None.

◆ adc10_cfg_setup()

void adc10_cfg_setup ( adc10_cfg_t * cfg)

ADC 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adc10_check_drdy()

uint8_t adc10_check_drdy ( adc10_t * ctx)

ADC 10 Check DRDY function.

This function indicates when a new conversion result is ready for retrieval of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
Returns
  • 0x00 ( ADC10_NEW_DATA_IS_READY ) - Data ready,
  • 0x01 ( ADC10_NEW_DATA_NOT_READY ) - No new data.
Note
None.

◆ adc10_default_cfg()

void adc10_default_cfg ( adc10_t * ctx)

ADC 10 default configuration function.

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

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
Returns
Nothing.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ adc10_generic_read()

err_t adc10_generic_read ( adc10_t * ctx,
char * data_buf,
uint16_t max_len )

ADC 10 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.
Note
None.

◆ adc10_generic_write()

err_t adc10_generic_write ( adc10_t * ctx,
char * data_buf,
uint16_t len )

ADC 10 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ adc10_get_ch_output()

int32_t adc10_get_ch_output ( adc10_t * ctx,
uint8_t sel_ch )

ADC 10 Get the channel output function.

This function reads the ADC output of the channel ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]sel_ch:
  • 0x00 ( ADC10_ANALOG_INPUT_CH_0 ) - Analog input 0.
  • 0x01 ( ADC10_ANALOG_INPUT_CH_1 ) - Analog input 1.
  • 0x02 ( ADC10_ANALOG_INPUT_CH_2 ) - Analog input 2.
  • 0x03 ( ADC10_ANALOG_INPUT_CH_3 ) - Analog input 3.
Returns
24-bits of data ( two's complement format ) ADC data.
Note
None.

◆ adc10_get_config()

void adc10_get_config ( adc10_t * ctx,
adc10_settings_t * cfg_data )

ADC 10 Get configuration function.

This function get configuration data of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[out]adc10_settings_t: Click settings configuration object.
Returns
Nothing.
Note
None.

◆ adc10_hw_reset()

void adc10_hw_reset ( adc10_t * ctx)

ADC 10 Hardware reset function.

This function perform a hardware reset the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

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

◆ adc10_init()

err_t adc10_init ( adc10_t * ctx,
adc10_cfg_t * cfg )

ADC 10 initialization function.

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

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

◆ adc10_read_reg()

uint8_t adc10_read_reg ( adc10_t * ctx,
uint8_t reg )

ADC 10 Read register function.

This function perform a read the byte of data to the targeted 8-bit register address of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]reg: Register address.
Returns
Output read data.
Note
None.

◆ adc10_reset()

void adc10_reset ( adc10_t * ctx)

ADC 10 Software reset function.

This function perform a software reset ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

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

◆ adc10_send_command()

void adc10_send_command ( adc10_t * ctx,
uint8_t cmd )

ADC 10 Send command function.

This function sends the desired command to the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]cmd: Commands instruction.
Returns
Nothing.
Note
None.

◆ adc10_set_config()

void adc10_set_config ( adc10_t * ctx,
adc10_settings_t cfg_data )

ADC 10 Set configuration function.

This function set configuration data of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]adc10_settings_t: Click settings configuration object.
Returns
Nothing.
Note
None.

◆ adc10_shutdown()

void adc10_shutdown ( adc10_t * ctx)

ADC 10 Shutdown function.

This function perform a shutdown of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

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

◆ adc10_start_sync()

void adc10_start_sync ( adc10_t * ctx)

ADC 10 Start the synchronization function.

This function send start sync command to the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

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

◆ adc10_write_reg()

void adc10_write_reg ( adc10_t * ctx,
uint8_t reg,
uint8_t tx_data )

ADC 10 Write register function.

This function perform a writes the byte of data to the targeted 8-bit register address of the ADS122U04 24-Bit, 4-Channel, 2-kSPS, Delta-Sigma ADC With UART Interface on the ADC 10 click board.

Parameters
[in]ctx: Click context object. See adc10_t object definition for detailed explanation.
[in]reg: Register address.
[in]tx_data: Data to be written.
Returns
Nothing.
Note
None.