dac15 2.1.0.0
|
API for configuring and manipulating DAC 15 Click driver. More...
Topics | |
DAC 15 Registers List | |
List of registers of DAC 15 Click driver. | |
DAC 15 Registers Settings | |
Settings for registers of DAC 15 Click driver. | |
DAC 15 MikroBUS Map | |
MikroBUS pin mapping of DAC 15 Click driver. | |
Functions | |
void | dac15_cfg_setup (dac15_cfg_t *cfg) |
DAC 15 configuration object setup function. | |
void | dac15_drv_interface_selection (dac15_cfg_t *cfg, dac15_drv_t drv_sel) |
DAC 15 driver interface setup function. | |
err_t | dac15_init (dac15_t *ctx, dac15_cfg_t *cfg) |
DAC 15 initialization function. | |
err_t | dac15_default_cfg (dac15_t *ctx) |
DAC 15 default configuration function. | |
err_t | dac15_generic_write (dac15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
DAC 15 data writing function. | |
err_t | dac15_generic_read (dac15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
DAC 15 data reading function. | |
err_t | dac15_write_reg (dac15_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 15 write register function. | |
err_t | dac15_read_reg (dac15_t *ctx, uint8_t reg, uint16_t *data_out) |
DAC 15 read register function. | |
void | dac15_power_up_to_zero_scale (dac15_t *ctx) |
DAC 15 DACs power up to zero scale function. | |
void | dac15_power_up_to_midscale (dac15_t *ctx) |
DAC 15 DACs s power up to midscale function. | |
err_t | dac15_get_device_id (dac15_t *ctx, uint16_t *device_id) |
DAC 15 get device ID function. | |
err_t | dac15_set_sync_mode (dac15_t *ctx) |
DAC 15 set sync mode function. | |
err_t | dac15_soft_reset (dac15_t *ctx) |
DAC 15 soft reset function. | |
err_t | dac15_set_dac_data (dac15_t *ctx, uint8_t dac_sel, uint16_t dac_data) |
DAC 15 set DAC data function. | |
err_t | dac15_get_dac_data (dac15_t *ctx, uint8_t dac_sel, uint16_t *dac_data) |
DAC 15 get DAC data function. | |
err_t | dac15_set_dac_vout (dac15_t *ctx, uint8_t dac_sel, float vtg) |
DAC 15 set DAC output voltage function. | |
err_t | dac15_get_dac_vout (dac15_t *ctx, uint8_t dac_sel, float *vtg) |
DAC 15 get DAC output voltage function. | |
API for configuring and manipulating DAC 15 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dac15_cfg_setup | ( | dac15_cfg_t * | cfg | ) |
DAC 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac15_cfg_t object definition for detailed explanation. |
err_t dac15_default_cfg | ( | dac15_t * | ctx | ) |
DAC 15 default configuration function.
This function executes a default configuration of DAC 15 click board.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac15_drv_interface_selection | ( | dac15_cfg_t * | cfg, |
dac15_drv_t | drv_sel ) |
DAC 15 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See dac15_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See dac15_drv_t object definition for detailed explanation. |
err_t dac15_generic_read | ( | dac15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
DAC 15 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_generic_write | ( | dac15_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
DAC 15 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_get_dac_data | ( | dac15_t * | ctx, |
uint8_t | dac_sel, | ||
uint16_t * | dac_data ) |
DAC 15 get DAC data function.
This function read the raw DAC data for the selected DAC channel of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | dac_sel | : DAC Vout channel:
|
[out] | dac_data | : DAC raw data, 16-bit. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_get_dac_vout | ( | dac15_t * | ctx, |
uint8_t | dac_sel, | ||
float * | vtg ) |
DAC 15 get DAC output voltage function.
This function reads the DAC output voltage for the selected DAC channel of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | dac_sel | : DAC Vout channel:
|
[out] | vtg | : DAC output voltage [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_get_device_id | ( | dac15_t * | ctx, |
uint16_t * | device_id ) |
DAC 15 get device ID function.
This function reads device ID data of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[out] | device_id | : Device ID. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_init | ( | dac15_t * | ctx, |
dac15_cfg_t * | cfg ) |
DAC 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac15_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac15_power_up_to_midscale | ( | dac15_t * | ctx | ) |
DAC 15 DACs s power up to midscale function.
This function sets DACs s power up to midscale of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
void dac15_power_up_to_zero_scale | ( | dac15_t * | ctx | ) |
DAC 15 DACs power up to zero scale function.
This function sets DACs power up to zero scale of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
err_t dac15_read_reg | ( | dac15_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
DAC 15 read register function.
This function reads data word from the selected register of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_set_dac_data | ( | dac15_t * | ctx, |
uint8_t | dac_sel, | ||
uint16_t | dac_data ) |
DAC 15 set DAC data function.
This function sets the raw DAC data for the selected DAC channel of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | dac_sel | : DAC Vout channel:
|
[in] | dac_data | : DAC raw data, 16-bit. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_set_dac_vout | ( | dac15_t * | ctx, |
uint8_t | dac_sel, | ||
float | vtg ) |
DAC 15 set DAC output voltage function.
This function sets the DAC output voltage for the selected DAC channel of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | dac_sel | : DAC Vout channel:
|
[in] | vtg | : DAC output voltage [0V-3.3V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_set_sync_mode | ( | dac15_t * | ctx | ) |
DAC 15 set sync mode function.
This function set sync mode to synchronously load those DACs of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_soft_reset | ( | dac15_t * | ctx | ) |
DAC 15 soft reset function.
This function resets the device to its default state of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac15_write_reg | ( | dac15_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
DAC 15 write register function.
This function writes a desired data word to the selected register of the DAC80502, Dual, 16-Bit, 14-Bit, and 12-Bit, 1-LSB INL, Voltage-Output DACs With Precision Internal Reference on the USB-C Sink 3 Click board™.
[in] | ctx | : Click context object. See dac15_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.