This set of functions are for initializing, enabling, and disabling the CTB.
Functions | |
cy_en_ctb_status_t | Cy_CTB_Init (CTBM_Type *base, const cy_stc_ctb_config_t *config) |
Initialize or restore the CTB and both opamps according to the provided settings. More... | |
cy_en_ctb_status_t | Cy_CTB_OpampInit (CTBM_Type *base, cy_en_ctb_opamp_sel_t opampNum, const cy_stc_ctb_opamp_config_t *config) |
Initialize each opamp separately without impacting analog routing. More... | |
cy_en_ctb_status_t | Cy_CTB_DeInit (CTBM_Type *base, bool deInitRouting) |
Reset CTB registers back to power on reset defaults. More... | |
cy_en_ctb_status_t | Cy_CTB_FastInit (CTBM_Type *base, const cy_stc_ctb_fast_config_oa0_t *config0, const cy_stc_ctb_fast_config_oa1_t *config1) |
Initialize each opamp of the CTB to one of the common use modes. More... | |
__STATIC_INLINE void | Cy_CTB_Enable (CTBM_Type *base) |
Power up the CTB hardware block. More... | |
__STATIC_INLINE void | Cy_CTB_Disable (CTBM_Type *base) |
Power down the CTB hardware block. More... | |
cy_en_ctb_status_t Cy_CTB_Init | ( | CTBM_Type * | base, |
const cy_stc_ctb_config_t * | config | ||
) |
Initialize or restore the CTB and both opamps according to the provided settings.
Parameters are usually set only once, at initialization.
base | Pointer to structure describing registers |
config | Pointer to structure containing configuration data for entire CTB |
The following code snippet configures Opamp0 as a comparator and Opamp1 as an opamp follower with 10x drive. The terminals are routed to external pins by closing the switches shown.
cy_en_ctb_status_t Cy_CTB_OpampInit | ( | CTBM_Type * | base, |
cy_en_ctb_opamp_sel_t | opampNum, | ||
const cy_stc_ctb_opamp_config_t * | config | ||
) |
Initialize each opamp separately without impacting analog routing.
Intended for use by automatic analog routing and configuration tools to configure each opamp without having to integrate the settings with those of the other opamp first.
Can also be used to configure both opamps to have the same settings.
base | Pointer to structure describing registers |
opampNum | CY_CTB_OPAMP_0, CY_CTB_OPAMP_1, or CY_CTB_OPAMP_BOTH |
config | Pointer to structure containing configuration data |
cy_en_ctb_status_t Cy_CTB_DeInit | ( | CTBM_Type * | base, |
bool | deInitRouting | ||
) |
Reset CTB registers back to power on reset defaults.
base | Pointer to structure describing registers |
deInitRouting | If true, all analog routing switches are reset to their default state. If false, analog switch registers are untouched. |
cy_en_ctb_status_t Cy_CTB_FastInit | ( | CTBM_Type * | base, |
const cy_stc_ctb_fast_config_oa0_t * | config0, | ||
const cy_stc_ctb_fast_config_oa1_t * | config1 | ||
) |
Initialize each opamp of the CTB to one of the common use modes.
This function provides a quick and easy method of configuring the CTB using pre-defined configurations. Only routing switches required for the selected mode are configured, leaving final input and output connections to the user. Additional use modes that relate to the CTDAC are provided to support easy configuration of the CTDAC output buffer and input reference buffer.
The fast configuration structures define the opamp power, mode, and routing. This function sets the other configuration options of the CTB to:
base | Pointer to structure describing registers |
config0 | Pointer to structure containing configuration data for quick initialization of Opamp0. Defined your own or use one of the provided structures: |
config1 | Pointer to structure containing configuration data for quick initialization of Opamp1. Defined your own or use one of the provided structures: |
__STATIC_INLINE void Cy_CTB_Enable | ( | CTBM_Type * | base | ) |
Power up the CTB hardware block.
base | Pointer to structure describing registers |
__STATIC_INLINE void Cy_CTB_Disable | ( | CTBM_Type * | base | ) |
Power down the CTB hardware block.
base | Pointer to structure describing registers |