dac13 2.1.0.0
|
API for configuring and manipulating DAC 13 Click driver. More...
Topics | |
DAC 13 Registers List | |
List of registers of DAC 13 Click driver. | |
DAC 13 Registers Settings | |
Settings for registers of DAC 13 Click driver. | |
DAC 13 MikroBUS Map | |
MikroBUS pin mapping of DAC 13 Click driver. | |
Functions | |
void | dac13_cfg_setup (dac13_cfg_t *cfg) |
DAC 13 configuration object setup function. | |
err_t | dac13_init (dac13_t *ctx, dac13_cfg_t *cfg) |
DAC 13 initialization function. | |
err_t | dac13_default_cfg (dac13_t *ctx) |
DAC 13 default configuration function. | |
err_t | dac13_generic_write (dac13_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
DAC 13 data writing function. | |
err_t | dac13_generic_read (dac13_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
DAC 13 data reading function. | |
err_t | dac13_write_register (dac13_t *ctx, uint8_t reg, uint8_t data_in) |
DAC 13 write register function. | |
err_t | dac13_read_register (dac13_t *ctx, uint8_t reg, uint8_t *data_out) |
DAC 13 read register function. | |
err_t | dac13_write_register_16b (dac13_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 13 write register 16b function. | |
err_t | dac13_read_register_16b (dac13_t *ctx, uint8_t reg, uint16_t *data_out) |
DAC 13 read register 16b function. | |
void | dac13_set_ldc_pin (dac13_t *ctx, uint8_t state) |
DAC 13 set ldc pin function. | |
void | dac13_set_rst_pin (dac13_t *ctx, uint8_t state) |
DAC 13 set rst pin function. | |
uint8_t | dac13_get_alert_pin (dac13_t *ctx) |
DAC 13 get alert pin function. | |
void | dac13_reset_device (dac13_t *ctx) |
DAC 13 reset device function. | |
err_t | dac13_check_communication (dac13_t *ctx) |
DAC 13 check communication function. | |
err_t | dac13_set_output_range (dac13_t *ctx, uint8_t out_range) |
DAC 13 set output range function. | |
err_t | dac13_set_dac_value (dac13_t *ctx, uint16_t dac_value) |
DAC 13 set dac value function. | |
err_t | dac13_set_output_voltage (dac13_t *ctx, float voltage) |
DAC 13 set output voltage function. | |
API for configuring and manipulating DAC 13 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dac13_cfg_setup | ( | dac13_cfg_t * | cfg | ) |
DAC 13 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac13_cfg_t object definition for detailed explanation. |
err_t dac13_check_communication | ( | dac13_t * | ctx | ) |
DAC 13 check communication function.
This function checks the communication by reading and verifying the product and vendor IDs.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac13_default_cfg | ( | dac13_t * | ctx | ) |
DAC 13 default configuration function.
This function executes a default configuration of DAC 13 click board.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac13_generic_read | ( | dac13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
DAC 13 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dac13_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 dac13_generic_write | ( | dac13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
DAC 13 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dac13_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. uint8_t dac13_get_alert_pin | ( | dac13_t * | ctx | ) |
DAC 13 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
err_t dac13_init | ( | dac13_t * | ctx, |
dac13_cfg_t * | cfg ) |
DAC 13 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac13_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac13_read_register | ( | dac13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
DAC 13 read register function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dac13_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 dac13_read_register_16b | ( | dac13_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
DAC 13 read register 16b function.
This function reads two bytes of data starting from the selected register in descending order by using SPI serial interface.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac13_reset_device | ( | dac13_t * | ctx | ) |
DAC 13 reset device function.
This function resets the device by toggling the reset pin.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
err_t dac13_set_dac_value | ( | dac13_t * | ctx, |
uint16_t | dac_value ) |
DAC 13 set dac value function.
This function sets the raw DAC value.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | dac_value | : 16-bit raw DAC value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac13_set_ldc_pin | ( | dac13_t * | ctx, |
uint8_t | state ) |
DAC 13 set ldc pin function.
This function sets the LDC pin logic state.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t dac13_set_output_range | ( | dac13_t * | ctx, |
uint8_t | out_range ) |
DAC 13 set output range function.
This function sets the output voltage range and as well as the ctx->v_zero_scale and ctx->v_full_scale variables for the selected range.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | out_range | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac13_set_output_voltage | ( | dac13_t * | ctx, |
float | voltage ) |
DAC 13 set output voltage function.
This function sets the DAC output voltage.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | voltage | : Float value of voltage to be set. The voltage range depends on the dac13_set_output_range setting. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac13_set_rst_pin | ( | dac13_t * | ctx, |
uint8_t | state ) |
DAC 13 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t dac13_write_register | ( | dac13_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
DAC 13 write register function.
This function writes a desired data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dac13_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. err_t dac13_write_register_16b | ( | dac13_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
DAC 13 write register 16b function.
This function writes two bytes of data starting from the selected register in descending order by using SPI serial interface.
[in] | ctx | : Click context object. See dac13_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.