dac12 2.0.0.0
|
API for configuring and manipulating DAC 12 Click driver. More...
Topics | |
DAC 12 Registers List | |
List of registers of DAC 12 Click driver. | |
DAC 12 Control register Settings | |
Settings for control registers of DAC 12 Click driver. | |
DAC 12 MikroBUS Map | |
MikroBUS pin mapping of DAC 12 Click driver. | |
Functions | |
void | dac12_cfg_setup (dac12_cfg_t *cfg) |
DAC 12 configuration object setup function. | |
err_t | dac12_init (dac12_t *ctx, dac12_cfg_t *cfg) |
DAC 12 initialization function. | |
err_t | dac12_default_cfg (dac12_t *ctx) |
DAC 12 default configuration function. | |
err_t | dac12_write_register (dac12_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 12 write register function. | |
err_t | dac12_read_register (dac12_t *ctx, uint8_t reg, uint16_t *data_out) |
DAC 12 read register function. | |
err_t | dac12_check_communication (dac12_t *ctx) |
DAC 12 check communication function. | |
err_t | dac12_soft_reset (dac12_t *ctx) |
DAC 12 soft reset function. | |
err_t | dac12_set_gain (dac12_t *ctx, uint8_t channel) |
DAC 12 set gain function. | |
err_t | dac12_set_channel_value (dac12_t *ctx, uint8_t channel, uint16_t dac_value) |
DAC 12 set channel value function. | |
err_t | dac12_set_channel_voltage (dac12_t *ctx, uint8_t channel, float voltage) |
DAC 12 set channel voltage function. | |
API for configuring and manipulating DAC 12 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dac12_cfg_setup | ( | dac12_cfg_t * | cfg | ) |
DAC 12 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac12_cfg_t object definition for detailed explanation. |
err_t dac12_check_communication | ( | dac12_t * | ctx | ) |
DAC 12 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac12_default_cfg | ( | dac12_t * | ctx | ) |
DAC 12 default configuration function.
This function executes a default configuration of DAC 12 click board.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac12_init | ( | dac12_t * | ctx, |
dac12_cfg_t * | cfg ) |
DAC 12 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac12_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac12_read_register | ( | dac12_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
DAC 12 read register function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data [2 bytes]. |
0
- Success, -1
- Error.err_t dac12_set_channel_value | ( | dac12_t * | ctx, |
uint8_t | channel, | ||
uint16_t | dac_value ) |
DAC 12 set channel value function.
This function sets the raw DAC value to the specific channels output.
[in] | ctx | : Click context object. See dac12_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 dac12_set_channel_voltage | ( | dac12_t * | ctx, |
uint8_t | channel, | ||
float | voltage ) |
DAC 12 set channel voltage function.
This function sets the output voltage of the specific channels.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
[in] | channel | : Output channel mask. |
[in] | voltage | : Float value of voltage to be set (up to 2.5 V). |
0
- Success, -1
- Error.err_t dac12_set_gain | ( | dac12_t * | ctx, |
uint8_t | channel ) |
DAC 12 set gain function.
This function sets the gain of 2 to the selected channels, the other channels will have their gain disabled.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
[in] | channel | : Output channel mask. |
0
- Success, -1
- Error.err_t dac12_soft_reset | ( | dac12_t * | ctx | ) |
DAC 12 soft reset function.
This function executes the software reset command.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac12_write_register | ( | dac12_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
DAC 12 write register function.
This function writes a desired data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dac12_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written [2 bytes]. |
0
- Success, -1
- Error.