dac11 2.0.0.0
DAC 11 Click Driver

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

Topics

 DAC 11 Commands List
 List of commands of DAC 11 Click driver.
 
 DAC 11 Control register Settings
 Settings for control registers of DAC 11 Click driver.
 
 DAC 11 MikroBUS Map
 MikroBUS pin mapping of DAC 11 Click driver.
 

Functions

void dac11_cfg_setup (dac11_cfg_t *cfg)
 DAC 11 configuration object setup function.
 
err_t dac11_init (dac11_t *ctx, dac11_cfg_t *cfg)
 DAC 11 initialization function.
 
err_t dac11_default_cfg (dac11_t *ctx)
 DAC 11 default configuration function.
 
err_t dac11_generic_write (dac11_t *ctx, uint16_t *data_in, uint8_t len)
 DAC 11 generic write function.
 
err_t dac11_write_control_reg (dac11_t *ctx, uint8_t cmd, uint16_t data_in)
 DAC 11 write control register function.
 
err_t dac11_set_all_ch_value (dac11_t *ctx, uint16_t dac_value)
 DAC 11 set all channels value function.
 
err_t dac11_set_all_ch_voltage (dac11_t *ctx, float vref, float voltage)
 DAC 11 set all channels voltage function.
 
err_t dac11_set_specific_ch_value (dac11_t *ctx, uint8_t channel, uint16_t dac_value)
 DAC 11 set specific channels value function.
 
err_t dac11_set_specific_ch_voltage (dac11_t *ctx, uint8_t channel, float vref, float voltage)
 DAC 11 set specific channels voltage function.
 

Detailed Description

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

◆ dac11_cfg_setup()

void dac11_cfg_setup ( dac11_cfg_t * cfg)

DAC 11 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dac11_default_cfg()

err_t dac11_default_cfg ( dac11_t * ctx)

DAC 11 default configuration function.

This function executes a default configuration of DAC 11 click board.

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

◆ dac11_generic_write()

err_t dac11_generic_write ( dac11_t * ctx,
uint16_t * data_in,
uint8_t len )

DAC 11 generic write function.

This function writes a desired number of control bytes by using SPI serial interface.

Parameters
[in]ctx: Click context object. See dac11_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]len: Number of registers to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Writing to more than one control register is used for daisy-chain operations.

◆ dac11_init()

err_t dac11_init ( dac11_t * ctx,
dac11_cfg_t * cfg )

DAC 11 initialization function.

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

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

◆ dac11_set_all_ch_value()

err_t dac11_set_all_ch_value ( dac11_t * ctx,
uint16_t dac_value )

DAC 11 set all channels value function.

This function sets the raw DAC value to all channels output.

Parameters
[in]ctx: Click context object. See dac11_t object definition for detailed explanation.
[in]dac_value: 12-bit raw DAC value.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ dac11_set_all_ch_voltage()

err_t dac11_set_all_ch_voltage ( dac11_t * ctx,
float vref,
float voltage )

DAC 11 set all channels voltage function.

This function sets the output voltage of all channels depending on the vref value defined by the VCC SEL on-board jumper. The VREF and Voltage values can be either in Volts or Milivolts.

Parameters
[in]ctx: Click context object. See dac11_t object definition for detailed explanation.
[in]vref: VREF value defined by VCC SEL on-board jumper.
[in]voltage: Float value to be set as output voltage.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ dac11_set_specific_ch_value()

err_t dac11_set_specific_ch_value ( dac11_t * ctx,
uint8_t channel,
uint16_t dac_value )

DAC 11 set specific channels value function.

This function sets the raw DAC value to the specific channels output.

Parameters
[in]ctx: Click context object. See dac11_t object definition for detailed explanation.
[in]channel: Output channel mask.
[in]dac_value: 12-bit raw DAC value.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ dac11_set_specific_ch_voltage()

err_t dac11_set_specific_ch_voltage ( dac11_t * ctx,
uint8_t channel,
float vref,
float voltage )

DAC 11 set specific channels voltage function.

This function sets the output voltage of the specific channels depending on the vref value defined by the VCC SEL on-board jumper. The VREF and Voltage values can be either in Volts or Milivolts.

Parameters
[in]ctx: Click context object. See dac11_t object definition for detailed explanation.
[in]channel: Output channel mask.
[in]vref: VREF value defined by VCC SEL on-board jumper.
[in]voltage: Float value to be set as output voltage.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ dac11_write_control_reg()

err_t dac11_write_control_reg ( dac11_t * ctx,
uint8_t cmd,
uint16_t data_in )

DAC 11 write control register function.

This function writes data to a single control register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See dac11_t object definition for detailed explanation.
[in]cmd: 4-bit command of control registers.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.