dac11 2.0.0.0
|
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. | |
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.
void dac11_cfg_setup | ( | dac11_cfg_t * | cfg | ) |
DAC 11 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac11_cfg_t object definition for detailed explanation. |
err_t dac11_default_cfg | ( | dac11_t * | ctx | ) |
DAC 11 default configuration function.
This function executes a default configuration of DAC 11 click board.
[in] | ctx | : Click context object. See dac11_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See dac11_t object definition for detailed explanation. |
[in] | dac_value | : 12-bit raw DAC value. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.