dac9 2.0.0.0
|
API for configuring and manipulating DAC 9 Click driver. More...
Topics | |
DAC 9 Registers List | |
List of registers of DAC 9 Click driver. | |
DAC 9 Registers Settings | |
Settings for registers of DAC 9 Click driver. | |
DAC 9 MikroBUS Map | |
MikroBUS pin mapping of DAC 9 Click driver. | |
Functions | |
void | dac9_cfg_setup (dac9_cfg_t *cfg) |
DAC 9 configuration object setup function. | |
void | dac9_drv_interface_selection (dac9_cfg_t *cfg, dac9_drv_t drv_sel) |
DAC 9 driver interface setup function. | |
err_t | dac9_init (dac9_t *ctx, dac9_cfg_t *cfg) |
DAC 9 initialization function. | |
err_t | dac9_generic_write (dac9_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
DAC 9 data writing function. | |
err_t | dac9_generic_read (dac9_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
DAC 9 data reading function. | |
err_t | dac9_enable_sync (dac9_t *ctx, uint8_t en_sync) |
Enable synchronous function. | |
err_t | dac9_set_config (dac9_t *ctx, uint16_t en_ref_pwdwn, uint16_t en_dac_pwdwn) |
Set config function. | |
err_t | dac9_set_gain (dac9_t *ctx, uint16_t en_ref_div, uint16_t en_buff_gain) |
Set gain function. | |
void | dac9_set_synchronously_load (dac9_t *ctx) |
Set synchronously load function. | |
void | dac9_soft_reset (dac9_t *ctx) |
Set reset function. | |
uint8_t | dac9_get_ref_alarm (dac9_t *ctx) |
Get ref alarm function. | |
err_t | dac9_set_vout (dac9_t *ctx, uint16_t vout_mv) |
Set Vout function. | |
API for configuring and manipulating DAC 9 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dac9_cfg_setup | ( | dac9_cfg_t * | cfg | ) |
DAC 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dac9_cfg_t object definition for detailed explanation. |
void dac9_drv_interface_selection | ( | dac9_cfg_t * | cfg, |
dac9_drv_t | drv_sel ) |
DAC 9 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 dac9_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See dac9_drv_t object definition for detailed explanation. |
err_t dac9_enable_sync | ( | dac9_t * | ctx, |
uint8_t | en_sync ) |
Enable synchronous function.
The function is used to set synchronous or asynchronous mode.
[in] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
[in] | en_sync | : DAC output mode |
0
- Success, -1
- Error.err_t dac9_generic_read | ( | dac9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
DAC 9 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See dac9_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.err_t dac9_generic_write | ( | dac9_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
DAC 9 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See dac9_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.uint8_t dac9_get_ref_alarm | ( | dac9_t * | ctx | ) |
Get ref alarm function.
The function is used to get reference alarm of the device.
[in] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
0x00
- Ok., 0x01
- Difference between the reference and supply pins is below a minimum analog threshold. err_t dac9_init | ( | dac9_t * | ctx, |
dac9_cfg_t * | cfg ) |
DAC 9 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dac9_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dac9_set_config | ( | dac9_t * | ctx, |
uint16_t | en_ref_pwdwn, | ||
uint16_t | en_dac_pwdwn ) |
Set config function.
The function is used to set the devices configuration.
[in] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
[in] | en_ref_pwdwn | : Internal reference mode. |
[in] | en_dac_pwdwn | : DAC in power-up mode. |
0
- Success, -1
- Error.err_t dac9_set_gain | ( | dac9_t * | ctx, |
uint16_t | en_ref_div, | ||
uint16_t | en_buff_gain ) |
Set gain function.
The function is used to set gain and internal voltage reference.
[in] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
[in] | en_ref_div | : Reference voltage mode. |
[in] | en_buff_gain | : DAC gain mode. |
0
- Success, -1
- Error.void dac9_set_synchronously_load | ( | dac9_t * | ctx | ) |
Set synchronously load function.
The function is used to set 'LDAC' bit in order to synchronously load the DAC in synchronous mode, This bit is self resetting.
[in] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
err_t dac9_set_vout | ( | dac9_t * | ctx, |
uint16_t | vout_mv ) |
Set Vout function.
The function is used set Vout ( mV ) by calculating input data and writing it to the DAC data register.
[in] | ctx | : Click context object. See dac9_t object definition for detailed explanation. |
[in] | vout_mv | : Vout in mV. |
0
- Success, -1
- Error.