dac14
2.1.0.0
|
API for configuring and manipulating DAC 14 Click driver. More...
Modules | |
DAC 14 Registers List | |
List of registers of DAC 14 Click driver. | |
DAC 14 Registers Settings | |
Settings for registers of DAC 14 Click driver. | |
DAC 14 MikroBUS Map | |
MikroBUS pin mapping of DAC 14 Click driver. | |
Functions | |
void | dac14_cfg_setup (dac14_cfg_t *cfg) |
DAC 14 configuration object setup function. More... | |
void | dac14_drv_interface_selection (dac14_cfg_t *cfg, dac14_drv_t drv_sel) |
DAC 14 driver interface setup function. More... | |
err_t | dac14_init (dac14_t *ctx, dac14_cfg_t *cfg) |
DAC 14 initialization function. More... | |
err_t | dac14_default_cfg (dac14_t *ctx) |
DAC 14 default configuration function. More... | |
err_t | dac14_write_register (dac14_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 14 write register function. More... | |
err_t | dac14_read_register (dac14_t *ctx, uint8_t reg, uint16_t *data_out) |
DAC 14 read register function. More... | |
uint8_t | dac14_get_int_pin (dac14_t *ctx) |
DAC 14 get int pin function. More... | |
err_t | dac14_check_communication (dac14_t *ctx) |
DAC 14 check communication function. More... | |
err_t | dac14_set_dac_vout_enable (dac14_t *ctx, uint8_t dac, uint8_t vout_pdn) |
DAC 14 set dac vout enable function. More... | |
err_t | dac14_set_dac_vref (dac14_t *ctx, uint8_t dac, uint8_t vref) |
DAC 14 set dac vref function. More... | |
err_t | dac14_set_dac_margins (dac14_t *ctx, uint8_t dac, uint16_t margin_l, uint16_t margin_h) |
DAC 14 set dac margins function. More... | |
err_t | dac14_set_dac_data (dac14_t *ctx, uint8_t dac, uint16_t dac_data) |
DAC 14 set dac data function. More... | |
err_t | dac14_start_function_gen (dac14_t *ctx, uint8_t dac) |
DAC 14 start function gen function. More... | |
err_t | dac14_stop_function_gen (dac14_t *ctx, uint8_t dac) |
DAC 14 stop function gen function. More... | |
err_t | dac14_config_function_gen (dac14_t *ctx, uint8_t dac, uint8_t waveform, uint8_t code_step, uint8_t slew_rate) |
DAC 14 config function gen function. More... | |
API for configuring and manipulating DAC 14 Click driver.
void dac14_cfg_setup | ( | dac14_cfg_t * | cfg | ) |
DAC 14 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac14_cfg_t object definition for detailed explanation. |
err_t dac14_check_communication | ( | dac14_t * | ctx | ) |
DAC 14 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_config_function_gen | ( | dac14_t * | ctx, |
uint8_t | dac, | ||
uint8_t | waveform, | ||
uint8_t | code_step, | ||
uint8_t | slew_rate | ||
) |
DAC 14 config function gen function.
This function configures the function generator for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
[in] | waveform | : Waveform signal:
|
[in] | code_step | : Code step setting. Refer to DAC14_CODE_STEP_x macro definitions for more details. |
[in] | slew_rate | : Slew rate setting. Refer to DAC14_SLEW_RATE_x macro definitions for more details. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_default_cfg | ( | dac14_t * | ctx | ) |
DAC 14 default configuration function.
This function executes a default configuration of DAC 14 click board.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac14_drv_interface_selection | ( | dac14_cfg_t * | cfg, |
dac14_drv_t | drv_sel | ||
) |
DAC 14 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 dac14_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See dac14_drv_t object definition for detailed explanation. |
uint8_t dac14_get_int_pin | ( | dac14_t * | ctx | ) |
DAC 14 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
err_t dac14_init | ( | dac14_t * | ctx, |
dac14_cfg_t * | cfg | ||
) |
DAC 14 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac14_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_read_register | ( | dac14_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
DAC 14 read register function.
This function reads data word from the selected register.
[in] | ctx | : Click context object. See dac14_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 dac14_set_dac_data | ( | dac14_t * | ctx, |
uint8_t | dac, | ||
uint16_t | dac_data | ||
) |
DAC 14 set dac data function.
This function sets the raw DAC data for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
[in] | dac_data | : Raw DAC data (0-1023). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_set_dac_margins | ( | dac14_t * | ctx, |
uint8_t | dac, | ||
uint16_t | margin_l, | ||
uint16_t | margin_h | ||
) |
DAC 14 set dac margins function.
This function sets the DAC margin levels for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
[in] | margin_l | : Margin LOW (must be <= Margin HIGH) in a range of DAC data (0-1023). |
[in] | margin_h | : Margin HIGH (must be >= Margin LOW) in a range of DAC data (0-1023). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_set_dac_vout_enable | ( | dac14_t * | ctx, |
uint8_t | dac, | ||
uint8_t | vout_pdn | ||
) |
DAC 14 set dac vout enable function.
This function sets the VOUT power enable bits for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
[in] | vout_pdn | : VOUT PDN bits:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_set_dac_vref | ( | dac14_t * | ctx, |
uint8_t | dac, | ||
uint8_t | vref | ||
) |
DAC 14 set dac vref function.
This function sets the voltage reference for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
[in] | vref | : Voltage reference:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_start_function_gen | ( | dac14_t * | ctx, |
uint8_t | dac | ||
) |
DAC 14 start function gen function.
This function starts the function generator for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_stop_function_gen | ( | dac14_t * | ctx, |
uint8_t | dac | ||
) |
DAC 14 stop function gen function.
This function stops the function generator for the selected DAC channel.
[in] | ctx | : Click context object. See dac14_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac14_write_register | ( | dac14_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
DAC 14 write register function.
This function writes a desired data word to the selected register.
[in] | ctx | : Click context object. See dac14_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.