adac3 2.0.0.0
ADAC 3 Click Driver

API for configuring and manipulating ADAC 3 Click driver. More...

Topics

 ADAC 3 Registers Settings
 Settings for registers of ADAC 3 Click driver.
 
 ADAC 3 MikroBUS Map
 MikroBUS pin mapping of ADAC 3 Click driver.
 

Functions

void adac3_cfg_setup (adac3_cfg_t *cfg)
 ADAC 3 configuration object setup function.
 
err_t adac3_init (adac3_t *ctx, adac3_cfg_t *cfg)
 ADAC 3 initialization function.
 
err_t adac3_default_cfg (adac3_t *ctx)
 ADAC 3 default configuration function.
 
err_t adac3_write_control (adac3_t *ctx, uint8_t control)
 ADAC 3 write control function.
 
err_t adac3_write_dac (adac3_t *ctx, uint8_t dac)
 ADAC 3 write dac function.
 
err_t adac3_read_adc (adac3_t *ctx, uint8_t *adc)
 ADAC 3 read adc function.
 

Detailed Description

API for configuring and manipulating ADAC 3 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

◆ adac3_cfg_setup()

void adac3_cfg_setup ( adac3_cfg_t * cfg)

ADAC 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ adac3_default_cfg()

err_t adac3_default_cfg ( adac3_t * ctx)

ADAC 3 default configuration function.

This function executes a default configuration of ADAC 3 click board.

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

◆ adac3_init()

err_t adac3_init ( adac3_t * ctx,
adac3_cfg_t * cfg )

ADAC 3 initialization function.

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

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

◆ adac3_read_adc()

err_t adac3_read_adc ( adac3_t * ctx,
uint8_t * adc )

ADAC 3 read adc function.

This function reads the AD conversion byte by using I2C serial interface.

Parameters
[in]ctx: Click context object. See adac3_t object definition for detailed explanation.
[out]adc: AD conversion byte.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ adac3_write_control()

err_t adac3_write_control ( adac3_t * ctx,
uint8_t control )

ADAC 3 write control function.

This function writes a control byte by using I2C serial interface.

Parameters
[in]ctx: Click context object. See adac3_t object definition for detailed explanation.
[in]control: Control byte to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't affect DAC value.

◆ adac3_write_dac()

err_t adac3_write_dac ( adac3_t * ctx,
uint8_t dac )

ADAC 3 write dac function.

This function writes a DAC byte by using I2C serial interface.

Parameters
[in]ctx: Click context object. See adac3_t object definition for detailed explanation.
[in]dac: DAC value [0-255].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't affect control byte.