adc11 2.0.0.0
ADC 11 Click Driver

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

Topics

 ADC 11 MikroBUS Map
 MikroBUS pin mapping of ADC 11 Click driver.
 

Functions

void adc11_cfg_setup (adc11_cfg_t *cfg)
 ADC 11 configuration object setup function.
 
err_t adc11_init (adc11_t *ctx, adc11_cfg_t *cfg)
 ADC 11 initialization function.
 
err_t adc11_generic_read (adc11_t *ctx, uint16_t *adc_data)
 ADC 11 data reading function.
 
err_t adc11_set_calibration (adc11_t *ctx, adc11_calibration_data_t *adc_val)
 ADC 11 set calibration function.
 
err_t adc11_get_voltage (adc11_t *ctx, adc11_calibration_data_t *adc_val, float *voltage)
 ADC 11 get voltage function.
 

Detailed Description

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

◆ adc11_cfg_setup()

void adc11_cfg_setup ( adc11_cfg_t * cfg)

ADC 11 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adc11_generic_read()

err_t adc11_generic_read ( adc11_t * ctx,
uint16_t * adc_data )

ADC 11 data reading function.

This function reads a 16-bit ADC data from the LTC1864 µPower, 16-Bit, 250ksps 1- and 2-Channel ADCs in MSOP by using SPI serial interface.

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

◆ adc11_get_voltage()

err_t adc11_get_voltage ( adc11_t * ctx,
adc11_calibration_data_t * adc_val,
float * voltage )

ADC 11 get voltage function.

This function read ADC value and calculate voltage ( V ) of the LTC1864 µPower, 16-Bit, 250ksps 1- and 2-Channel ADCs in MSOP by using SPI serial interface.

Parameters
[in]ctx: Click context object. See adc11_t object definition for detailed explanation.
[out]voltage: voltage data ( V ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The function samples ADC 100 times in short intervals of 1 millisecond, which makes the total delay in function approximately 100 millisecond.

◆ adc11_init()

err_t adc11_init ( adc11_t * ctx,
adc11_cfg_t * cfg )

ADC 11 initialization function.

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

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

◆ adc11_set_calibration()

err_t adc11_set_calibration ( adc11_t * ctx,
adc11_calibration_data_t * adc_val )

ADC 11 set calibration function.

This function sets the calibration value into the calibration data structure of the LTC1864 µPower, 16-Bit, 250ksps 1- and 2-Channel ADCs in MSOP by using SPI serial interface.

Parameters
[in]ctx: Click context object. See adc11_t object definition for detailed explanation.
[out]adc_val: Pointer to the memory location of the structure where data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The function samples ADC 100 times in short intervals of 1 millisecond, which makes the total delay in function approximately 100 millisecond.