adc17 2.0.0.0
ADC 17 Click Driver

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

Topics

 ADC 17 Registers Settings
 Settings for registers of ADC 17 Click driver.
 
 ADC 17 MikroBUS Map
 MikroBUS pin mapping of ADC 17 Click driver.
 

Functions

void adc17_cfg_setup (adc17_cfg_t *cfg)
 ADC 17 configuration object setup function.
 
err_t adc17_init (adc17_t *ctx, adc17_cfg_t *cfg)
 ADC 17 initialization function.
 
err_t adc17_default_cfg (adc17_t *ctx)
 ADC 17 default configuration function.
 
err_t adc17_write_setup_byte (adc17_t *ctx, uint8_t setup_byte)
 ADC 17 write setup byte function.
 
err_t adc17_write_config_byte (adc17_t *ctx, uint8_t config_byte)
 ADC 17 write config byte function.
 
err_t adc17_set_channel (adc17_t *ctx, uint8_t channel)
 ADC 17 set channel function.
 
err_t adc17_get_voltage (adc17_t *ctx, float *voltage)
 ADC 17 get voltage function.
 

Detailed Description

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

◆ adc17_cfg_setup()

void adc17_cfg_setup ( adc17_cfg_t * cfg)

ADC 17 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adc17_default_cfg()

err_t adc17_default_cfg ( adc17_t * ctx)

ADC 17 default configuration function.

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

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

◆ adc17_get_voltage()

err_t adc17_get_voltage ( adc17_t * ctx,
float * voltage )

ADC 17 get voltage function.

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

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

◆ adc17_init()

err_t adc17_init ( adc17_t * ctx,
adc17_cfg_t * cfg )

ADC 17 initialization function.

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

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

◆ adc17_set_channel()

err_t adc17_set_channel ( adc17_t * ctx,
uint8_t channel )

ADC 17 set channel function.

This function sets the selected channel active by modifying the config byte.

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

◆ adc17_write_config_byte()

err_t adc17_write_config_byte ( adc17_t * ctx,
uint8_t config_byte )

ADC 17 write config byte function.

This function writes a config byte to the ADC chip by using I2C serial interface.

Parameters
[in]ctx: Click context object. See adc17_t object definition for detailed explanation.
[in]config_byte: Config byte to be written ( the value will be stored in ctx->config_byte ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ adc17_write_setup_byte()

err_t adc17_write_setup_byte ( adc17_t * ctx,
uint8_t setup_byte )

ADC 17 write setup byte function.

This function writes a setup byte to the ADC chip by using I2C serial interface.

Parameters
[in]ctx: Click context object. See adc17_t object definition for detailed explanation.
[in]setup_byte: Setup byte to be written ( the value will be stored in ctx->setup_byte ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.