Basic Configuration Functions

group group_ctb_functions_basic

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.

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.

    
    /* Scenario: The opamps are no longer needed to function in Deep Sleep mode
     * so disable Deep Sleep operation. */

    Cy_CTB_SetDeepSleepMode(CTBM0, CY_CTB_DEEPSLEEP_DISABLE);
    
    /* 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. */
    
Return

None

Function Usage

Parameters

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.

    /* 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);
    
Return

None

Function Usage

Parameters

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.

    /* 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, CY_CTB_PUMP_DISABLE);
    Cy_CTB_SetPower(CTBM0, CY_CTB_OPAMP_1, CY_CTB_POWER_MEDIUM, CY_CTB_PUMP_DISABLE);
Return

None

Function Usage

Parameters