dac16
2.1.0.0
|
API for configuring and manipulating DAC 16 Click driver. More...
Modules | |
DAC 16 Registers List | |
List of registers of DAC 16 Click driver. | |
DAC 16 Registers Settings | |
Settings for registers of DAC 16 Click driver. | |
DAC 16 MikroBUS Map | |
MikroBUS pin mapping of DAC 16 Click driver. | |
Functions | |
void | dac16_cfg_setup (dac16_cfg_t *cfg) |
DAC 16 configuration object setup function. More... | |
void | dac16_drv_interface_sel (dac16_cfg_t *cfg, dac16_drv_t drv_sel) |
DAC 16 driver interface setup function. More... | |
err_t | dac16_init (dac16_t *ctx, dac16_cfg_t *cfg) |
DAC 16 initialization function. More... | |
err_t | dac16_default_cfg (dac16_t *ctx) |
DAC 16 default configuration function. More... | |
err_t | dac16_write_register (dac16_t *ctx, uint8_t reg, uint16_t data_in) |
DAC 16 write register function. More... | |
err_t | dac16_read_register (dac16_t *ctx, uint8_t reg, uint16_t *data_out) |
DAC 16 read register function. More... | |
uint8_t | dac16_get_gp_pin (dac16_t *ctx) |
DAC 16 get GP pin function. More... | |
err_t | dac16_check_communication (dac16_t *ctx) |
DAC 16 check communication function. More... | |
err_t | dac16_set_dac_vout_enable (dac16_t *ctx, uint8_t dac, uint8_t vout_pdn) |
DAC 16 set dac vout enable function. More... | |
err_t | dac16_set_dac_vref (dac16_t *ctx, uint8_t dac, uint8_t vref) |
DAC 16 set dac vref function. More... | |
err_t | dac16_set_dac_margins (dac16_t *ctx, uint8_t dac, uint16_t margin_l, uint16_t margin_h) |
DAC 16 set dac margins function. More... | |
err_t | dac16_set_dac_data (dac16_t *ctx, uint8_t dac, uint16_t dac_data) |
DAC 16 set dac data function. More... | |
err_t | dac16_start_function_gen (dac16_t *ctx, uint8_t dac) |
DAC 16 start function gen function. More... | |
err_t | dac16_stop_function_gen (dac16_t *ctx, uint8_t dac) |
DAC 16 stop function gen function. More... | |
err_t | dac16_config_function_gen (dac16_t *ctx, uint8_t dac, uint8_t waveform, uint8_t code_step, uint8_t slew_rate) |
DAC 16 config function gen function. More... | |
API for configuring and manipulating DAC 16 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dac16_cfg_setup | ( | dac16_cfg_t * | cfg | ) |
DAC 16 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac16_cfg_t object definition for detailed explanation. |
err_t dac16_check_communication | ( | dac16_t * | ctx | ) |
DAC 16 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac16_config_function_gen | ( | dac16_t * | ctx, |
uint8_t | dac, | ||
uint8_t | waveform, | ||
uint8_t | code_step, | ||
uint8_t | slew_rate | ||
) |
DAC 16 config function gen function.
This function configures the function generator for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
[in] | waveform | : Waveform signal:
|
[in] | code_step | : Code step setting. Refer to DAC16_CODE_STEP_x macro definitions for more details. |
[in] | slew_rate | : Slew rate setting. Refer to DAC16_SLEW_RATE_x macro definitions for more details. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac16_default_cfg | ( | dac16_t * | ctx | ) |
DAC 16 default configuration function.
This function executes a default configuration of DAC 16 Click board.
[in] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dac16_drv_interface_sel | ( | dac16_cfg_t * | cfg, |
dac16_drv_t | drv_sel | ||
) |
DAC 16 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 dac16_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See dac16_drv_t object definition for detailed explanation. |
uint8_t dac16_get_gp_pin | ( | dac16_t * | ctx | ) |
DAC 16 get GP pin function.
This function returns the GP pin logic state.
[in] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
err_t dac16_init | ( | dac16_t * | ctx, |
dac16_cfg_t * | cfg | ||
) |
DAC 16 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac16_read_register | ( | dac16_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out | ||
) |
DAC 16 read register function.
This function reads data word from the selected register.
[in] | ctx | : Click context object. See dac16_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 dac16_set_dac_data | ( | dac16_t * | ctx, |
uint8_t | dac, | ||
uint16_t | dac_data | ||
) |
DAC 16 set dac data function.
This function sets the raw DAC data for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_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 dac16_set_dac_margins | ( | dac16_t * | ctx, |
uint8_t | dac, | ||
uint16_t | margin_l, | ||
uint16_t | margin_h | ||
) |
DAC 16 set dac margins function.
This function sets the DAC margin levels for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_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 dac16_set_dac_vout_enable | ( | dac16_t * | ctx, |
uint8_t | dac, | ||
uint8_t | vout_pdn | ||
) |
DAC 16 set dac vout enable function.
This function sets the VOUT power enable bits for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_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 dac16_set_dac_vref | ( | dac16_t * | ctx, |
uint8_t | dac, | ||
uint8_t | vref | ||
) |
DAC 16 set dac vref function.
This function sets the voltage reference for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_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 dac16_start_function_gen | ( | dac16_t * | ctx, |
uint8_t | dac | ||
) |
DAC 16 start function gen function.
This function starts the function generator for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac16_stop_function_gen | ( | dac16_t * | ctx, |
uint8_t | dac | ||
) |
DAC 16 stop function gen function.
This function stops the function generator for the selected DAC channel.
[in] | ctx | : Click context object. See dac16_t object definition for detailed explanation. |
[in] | dac | : DAC channel:
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dac16_write_register | ( | dac16_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
DAC 16 write register function.
This function writes a desired data word to the selected register.
[in] | ctx | : Click context object. See dac16_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.