dac10
2.0.0.0
|
API for configuring and manipulating DAC 10 Click driver. More...
Modules | |
DAC 10 Registers List | |
List of registers of DAC 10 Click driver. | |
DAC 10 Registers Settings | |
Settings for registers of DAC 10 Click driver. | |
DAC 10 MikroBUS Map | |
MikroBUS pin mapping of DAC 10 Click driver. | |
Functions | |
void | dac10_cfg_setup (dac10_cfg_t *cfg) |
DAC 10 configuration object setup function. More... | |
err_t | dac10_init (dac10_t *ctx, dac10_cfg_t *cfg) |
DAC 10 initialization function. More... | |
err_t | dac10_reg_write (dac10_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 10 I2C writing function. More... | |
err_t | dac10_reg_read (dac10_t *ctx, uint8_t reg, uint16_t *data_in) |
DAC 10 I2C reading function. More... | |
err_t | dac10_set_dac_value (dac10_t *ctx, uint16_t data_in) |
DAC 10 set dac value function. More... | |
err_t | dac10_set_output_voltage (dac10_t *ctx, float vref, float voltage) |
DAC 10 set output voltage function. More... | |
err_t | dac10_set_output_voltage_int_vref (dac10_t *ctx, float voltage) |
DAC 10 set output voltage with internal reference function. More... | |
err_t | dac10_set_dac_margin_high (dac10_t *ctx, uint16_t data_in) |
DAC 10 set dac margin high function. More... | |
err_t | dac10_set_dac_margin_low (dac10_t *ctx, uint16_t data_in) |
DAC 10 set dac margin low function. More... | |
err_t | dac10_check_device_id (dac10_t *ctx) |
DAC 10 check device ID function. More... | |
err_t | dac10_enable_dac (dac10_t *ctx) |
DAC 10 enable DAC output function. More... | |
API for configuring and manipulating DAC 10 Click driver.
void dac10_cfg_setup | ( | dac10_cfg_t * | cfg | ) |
DAC 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac10_cfg_t object definition for detailed explanation. |
err_t dac10_check_device_id | ( | dac10_t * | ctx | ) |
DAC 10 check device ID function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac10_enable_dac | ( | dac10_t * | ctx | ) |
DAC 10 enable DAC output function.
This function enables the DAC output.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac10_init | ( | dac10_t * | ctx, |
dac10_cfg_t * | cfg | ||
) |
DAC 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac10_reg_read | ( | dac10_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_in | ||
) |
DAC 10 I2C reading function.
This function reads two bytes of data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_in | : Output read data. |
0
- Success, -1
- Error.err_t dac10_reg_write | ( | dac10_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
DAC 10 I2C writing function.
This function writes a two bytes of data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error.err_t dac10_set_dac_margin_high | ( | dac10_t * | ctx, |
uint16_t | data_in | ||
) |
DAC 10 set dac margin high function.
This function sets the DAC MARGIH HIGH register to a desired value.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | data_in | : 10-bit data input. |
0
- Success, -1
- Error.err_t dac10_set_dac_margin_low | ( | dac10_t * | ctx, |
uint16_t | data_in | ||
) |
DAC 10 set dac margin low function.
This function sets the DAC MARGIH LOW register to a desired value.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | data_in | : 10-bit data input. |
0
- Success, -1
- Error.err_t dac10_set_dac_value | ( | dac10_t * | ctx, |
uint16_t | data_in | ||
) |
DAC 10 set dac value function.
This function sets the DAC DATA register to a desired value.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | data_in | : 10-bit DAC data. |
0
- Success, -1
- Error.err_t dac10_set_output_voltage | ( | dac10_t * | ctx, |
float | vref, | ||
float | voltage | ||
) |
DAC 10 set output voltage function.
This function sets the output voltage depending on the vref value defined by the VCC SEL on-board jumper. VREF and Voltage values can be either in Volts or Milivolts.
[in] | ctx | : Click context object. See dac10_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 dac10_set_output_voltage_int_vref | ( | dac10_t * | ctx, |
float | voltage | ||
) |
DAC 10 set output voltage with internal reference function.
This function sets the output voltage with the internal reference enabled.
[in] | ctx | : Click context object. See dac10_t object definition for detailed explanation. |
[in] | voltage | : Float value to be set as output voltage ( in Volts ). |
0
- Success, -1
- Error.