adc19 2.0.0.0
ADC 19 Click Driver

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

Topics

 ADC 19 Settings
 Settings of ADC 19 Click driver.
 
 ADC 19 MikroBUS Map
 MikroBUS pin mapping of ADC 19 Click driver.
 

Functions

void adc19_cfg_setup (adc19_cfg_t *cfg)
 ADC 19 configuration object setup function.
 
err_t adc19_init (adc19_t *ctx, adc19_cfg_t *cfg)
 ADC 19 initialization function.
 
void adc19_set_vref (adc19_t *ctx, float vref)
 ADC 19 set vref function.
 
err_t adc19_set_input_channel (adc19_t *ctx, uint8_t input_ch)
 ADC 19 set input channel function.
 
err_t adc19_get_voltage (adc19_t *ctx, float *voltage)
 ADC 19 get voltage function.
 

Detailed Description

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

◆ adc19_cfg_setup()

void adc19_cfg_setup ( adc19_cfg_t * cfg)

ADC 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adc19_get_voltage()

err_t adc19_get_voltage ( adc19_t * ctx,
float * voltage )

ADC 19 get voltage function.

This function reads the voltage from the previously selected channel by using SPI serial interface.

Parameters
[in]ctx: Click context object. See adc19_t object definition for detailed explanation.
[out]voltage: Voltage value [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc19_init()

err_t adc19_init ( adc19_t * ctx,
adc19_cfg_t * cfg )

ADC 19 initialization function.

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

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

◆ adc19_set_input_channel()

err_t adc19_set_input_channel ( adc19_t * ctx,
uint8_t input_ch )

ADC 19 set input channel function.

This function sets the selected input channel active by modifying the control register.

Parameters
[in]ctx: Click context object. See adc19_t object definition for detailed explanation.
[in]input_ch: Input channel number (1-2).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adc19_set_vref()

void adc19_set_vref ( adc19_t * ctx,
float vref )

ADC 19 set vref function.

This function sets the voltage reference value that will be used for voltage calculation.

Parameters
[in]ctx: Click context object. See adc19_t object definition for detailed explanation.
[in]vref: Voltage reference 3.3V or 5.0V.
Returns
None.
Note
None.