MTB CAT1 Peripheral driver library
Basic Configuration Functions

General Description

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

Functions

void Cy_CTB_SetDeepSleepMode (CTBM_Type *base, cy_en_ctb_deep_sleep_t deepSleep)
 Enable or disable 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_mode_t mode)
 Set the opamp output mode to 1x drive, 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, cy_en_ctb_pump_t pump)
 Configure the power level and charge pump for a specific opamp. More...
 

Function Documentation

◆ Cy_CTB_SetDeepSleepMode()

void Cy_CTB_SetDeepSleepMode ( CTBM_Type base,
cy_en_ctb_deep_sleep_t  deepSleep 
)

Enable or disable the entire CTB (not per opamp) in Deep Sleep mode.

If enabled, the AREF block must also be enabled for Deep Sleep to provide the needed reference currents to the opamps (see Cy_SysAnalog_SetDeepSleepMode). Additionally, 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
basePointer to structure describing registers
deepSleepCY_CTB_DEEPSLEEP_DISABLE or CY_CTB_DEEPSLEEP_ENABLE from cy_en_ctb_deep_sleep_t.
Returns
None
Function Usage
/* Scenario: The opamps are no longer needed to function in Deep Sleep mode
* so disable Deep Sleep operation. */
/* This is a low level function that only configures the CTB block.
* The preferred method is the Cy_CTB_SetCurrentMode() as it is a high
* level function that configures both the CTB and the AREF block. */

◆ Cy_CTB_SetOutputMode()

void Cy_CTB_SetOutputMode ( CTBM_Type base,
cy_en_ctb_opamp_sel_t  opampNum,
cy_en_ctb_mode_t  mode 
)

Set the opamp output mode to 1x drive, 10x drive, or comparator mode.

Parameters
basePointer to structure describing registers
opampNumCY_CTB_OPAMP_0, CY_CTB_OPAMP_1, or CY_CTB_OPAMP_BOTH
modeOpamp mode selection. Select a value from cy_en_ctb_mode_t.
Returns
None
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,
cy_en_ctb_pump_t  pump 
)

Configure 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 current but provides 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
basePointer 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. Select a value from cy_en_ctb_pump_t.
Returns
None
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_1, CY_CTB_POWER_MEDIUM, CY_CTB_PUMP_DISABLE);