CAT2 Peripheral Driver Library
Basic Configuration Functions

This set of functions is for configuring basic usage of the CTB. More...

Functions

void Cy_CTB_SetDeepSleepMode (CTBM_Type *base, bool deepSleep)
 Enables or disables the entire CTB (not per opamp) in Deep Sleep mode. More...
 
void Cy_CTB_SetOutputMode (CTBM_Type *base, cy_en_ctb_opamp_sel_t opampNum, cy_en_ctb_output_t outputMode)
 Sets the opamp Output mode to internal (1x) drive, external (10x) drive, or Comparator mode. More...
 
void Cy_CTB_SetPower (CTBM_Type *base, cy_en_ctb_opamp_sel_t opampNum, cy_en_ctb_power_t power, bool pump)
 Configures the power level and charge pump for a specific opamp. More...
 
void Cy_CTB_SetPumpClkSource (CTBM_Type *base, cy_en_ctb_clk_pump_source_t pumpClk)
 Sets the clock source for both charge pumps in the CTB. More...
 

Detailed Description

This set of functions is for configuring basic usage of the CTB.

Function Documentation

◆ Cy_CTB_SetDeepSleepMode()

void Cy_CTB_SetDeepSleepMode ( CTBM_Type *  base,
bool  deepSleep 
)

Enables or disables the entire CTB (not per opamp) in Deep Sleep mode.

If enabled, ensure that only internal CTB switches are used for routing. Switches on AMUXBUSA and AMUXBUSB are not enabled in Deep Sleep. See the Configuration Dependencies section for more information.

Note
In Deep Sleep mode, the charge pumps are disabled so the input range of the opamps is reduced to 0 V to VDDA - 1.5 V.
Parameters
baseThe pointer to structure-describing registers.
deepSleepEnable operation in Deep Sleep power mode
Function Usage
/* Scenario: The opamps are no longer needed to function in Deep Sleep mode
* so disable Deep Sleep operation. */
Cy_CTB_SetDeepSleepMode(CTBM0, false);
/* This is a low level function that only configures the CTB block. */

◆ Cy_CTB_SetOutputMode()

void Cy_CTB_SetOutputMode ( CTBM_Type *  base,
cy_en_ctb_opamp_sel_t  opampNum,
cy_en_ctb_output_t  outputMode 
)

Sets the opamp Output mode to internal (1x) drive, external (10x) drive, or Comparator mode.

Parameters
baseThe pointer to structure-describing registers.
opampNumCY_CTB_OPAMP_0, CY_CTB_OPAMP_1, or CY_CTB_OPAMP_BOTH
outputModeOpamp mode selection. Select a value from cy_en_ctb_output_t.
Function Usage
/* Scenario: Start using Opamp0 as a comparator instead of an opamp by
* turning off the 1x and 10x output stages. The comparator functionality
* has already been configured with Cy_CTB_CompSetConfig() or during initialization. */
Cy_CTB_SetOutputMode(CTBM0, CY_CTB_OPAMP_0, CY_CTB_MODE_COMP);

◆ Cy_CTB_SetPower()

void Cy_CTB_SetPower ( CTBM_Type *  base,
cy_en_ctb_opamp_sel_t  opampNum,
cy_en_ctb_power_t  power,
bool  pump 
)

Configures the power level and charge pump for a specific opamp.

At higher power levels, the opamp consumes more current but provides more gain bandwidth. Enabling the charge pump increases the current but provides a rail-to-rail input range. Disabling the charge pump limits the input range to VDDA - 1.5 V. See the device datasheet for performance specifications.

Parameters
baseThe pointer to structure-describing registers.
opampNumCY_CTB_OPAMP_0, CY_CTB_OPAMP_1, or CY_CTB_OPAMP_BOTH
powerPower mode selection. Select a value from cy_en_ctb_power_t.
pumpEnable or disable the charge pump.
Function Usage
/* Scenario: Opamp0 is no longer needed so turn it off to save power.
* Opamp1 is still being used but the full input range and bandwidth is not needed
* so turn off the charge pump and reduce the power level to medium to save power. */
Cy_CTB_SetPower(CTBM0, CY_CTB_OPAMP_0, CY_CTB_POWER_OFF, false);

◆ Cy_CTB_SetPumpClkSource()

void Cy_CTB_SetPumpClkSource ( CTBM_Type *  base,
cy_en_ctb_clk_pump_source_t  pumpClk 
)

Sets the clock source for both charge pumps in the CTB.

Recall that each opamp has its own charge pump.

Parameters
baseThe pointer to structure-describing registers.
pumpClkClock source selection for the pump. See cy_en_ctb_clk_pump_source_t.
Function Usage
/* Scenario: Use a 24 MHz clock from the High frequency clock for the charge pump clock. */
/* Select the source for the pump clock to be the High frequency clock. */
/* Scenario: Use a 24 MHz clock from the SRSS for the charge pump clock. */
/* Set the source to IMO, which has been configured for 24 MHz. */
/* Select the source for the pump clock to be from the SRSS. */