This set of functions are for initializing, enabling, and disabling the CTDAC.
Functions | |
cy_en_ctdac_status_t | Cy_CTDAC_Init (CTDAC_Type *base, const cy_stc_ctdac_config_t *config) |
Initialize all CTDAC configuration registers. More... | |
cy_en_ctdac_status_t | Cy_CTDAC_DeInit (CTDAC_Type *base, bool deInitRouting) |
Reset CTDAC registers back to power on reset defaults. More... | |
cy_en_ctdac_status_t | Cy_CTDAC_FastInit (CTDAC_Type *base, const cy_stc_ctdac_fast_config_t *config) |
Initialize the CTDAC to one of the common use modes. More... | |
__STATIC_INLINE void | Cy_CTDAC_Enable (CTDAC_Type *base) |
Power up the CTDAC hardware block. More... | |
__STATIC_INLINE void | Cy_CTDAC_Disable (CTDAC_Type *base) |
Turn off the hardware block. More... | |
cy_en_ctdac_status_t Cy_CTDAC_Init | ( | CTDAC_Type * | base, |
const cy_stc_ctdac_config_t * | config | ||
) |
Initialize all CTDAC configuration registers.
base | Pointer to structure describing registers |
config | Pointer to structure containing configuration data |
cy_en_ctdac_status_t Cy_CTDAC_DeInit | ( | CTDAC_Type * | base, |
bool | deInitRouting | ||
) |
Reset CTDAC registers back to power on reset defaults.
base | Pointer to structure describing registers |
deInitRouting | If true, all switches are reset to their default state. If false, switch registers are untouched. |
cy_en_ctdac_status_t Cy_CTDAC_FastInit | ( | CTDAC_Type * | base, |
const cy_stc_ctdac_fast_config_t * | config | ||
) |
Initialize the CTDAC to one of the common use modes.
This function provides a quick and easy method of configuring the CTDAC when using the PDL driver for device configuration.
The other configuration options are set to:
A separate call to Cy_CTDAC_Enable is needed to turn on the hardware.
base | Pointer to structure describing registers |
config | Pointer to structure containing configuration data for quick initialization. Define your own or use one of the provided structures: |
The following code snippets configures VDDA as the reference source and routes the output directly to Pin 6 (unbuffered).
The following code snippet shows how the CTDAC and CTB blocks can quickly be configured to work together. The code configures the CTDAC to use a buffered output, a buffered reference source from the internal bandgap voltage, and closes all required analog routing switches.
__STATIC_INLINE void Cy_CTDAC_Enable | ( | CTDAC_Type * | base | ) |
Power up the CTDAC hardware block.
base | Pointer to structure describing registers |
__STATIC_INLINE void Cy_CTDAC_Disable | ( | CTDAC_Type * | base | ) |
Turn off the hardware block.
base | Pointer to structure describing registers |