PSoC 6 Peripheral Driver Library
Reference Current Mode Functions

General Description

This set of functions impacts all opamps on the chip.

Notice how some of these functions do not take a base address input. When calling Cy_CTB_SetCurrentMode for a CTB instance on the device, it should be called for all other CTB instances as well. This is because there is only one IPTAT level (1 uA or 100 nA) chip wide.

Functions

void Cy_CTB_SetCurrentMode (CTBM_Type *base, cy_en_ctb_current_mode_t currentMode)
 High level function to configure the current modes of the opamps. More...
 
__STATIC_INLINE void Cy_CTB_SetIptatLevel (cy_en_ctb_iptat_t iptat)
 Set the IPTAT reference level to 1 uA or 100 nA. More...
 
__STATIC_INLINE void Cy_CTB_SetClkPumpSource (cy_en_ctb_clk_pump_source_t clkPump)
 Set the clock source for both charge pumps in the CTB. More...
 
__STATIC_INLINE void Cy_CTB_EnableRedirect (void)
 Normally, the AREF IZTAT is routed to the CTB IZTAT and the AREF IPTAT is routed to the CTB IPTAT: More...
 
__STATIC_INLINE void Cy_CTB_DisableRedirect (void)
 Disable the redirection of the AREF IPTAT to the CTB IZTAT for all opamps on the device as enabled by Cy_CTB_EnableRedirect. More...
 

Function Documentation

◆ Cy_CTB_SetCurrentMode()

void Cy_CTB_SetCurrentMode ( CTBM_Type base,
cy_en_ctb_current_mode_t  currentMode 
)

High level function to configure the current modes of the opamps.

This function configures all opamps of the CTB to the same current mode. These modes are differentiated by the reference current level, the opamp input range, and the Deep Sleep mode operation.

  • The reference current level is set using Cy_CTB_SetIptatLevel
  • When 1 uA current level is used in Deep Sleep,
    • All generators in the AREF must be enabled in Deep Sleep. That is, Cy_SysAnalog_SetDeepSleepMode is called with CY_SYSANALOG_DEEPSLEEP_IPTAT_IZTAT_VREF.
  • When 100 nA current level is used,
    • Cy_CTB_EnableRedirect is called to route the AREF IPTAT reference to the opamp IZTAT and disable the opamps IPTAT.
    • The IPTAT generator is enabled in Deep Sleep. That is, Cy_SysAnalog_SetDeepSleepMode is called with CY_SYSANALOG_DEEPSLEEP_IPTAT_2 unless it is already configured for CY_SYSANALOG_DEEPSLEEP_IPTAT_IZTAT_VREF.
Note
The IPTAT level is a chip wide configuration so multiple opamps cannot operate at different IPTAT levels. When calling Cy_CTB_SetCurrentMode for a CTB instance on the device, it should be called for all other CTB instances as well.
Current Mode IPTAT Level Input Range Deep Sleep Operation
CY_CTB_CURRENT_HIGH_ACTIVE 1 uA Rail-to-Rail (charge pump enabled) Disabled in Deep Sleep
CY_CTB_CURRENT_HIGH_ACTIVE_DEEPSLEEP 1 uA 0 - VDDA-1.5 V (charge pump disabled) Enabled in Deep Sleep
CY_CTB_CURRENT_LOW_ACTIVE_DEEPSLEEP 100 nA 0 - VDDA-1.5 V (charge pump disabled) Enabled in Deep Sleep
Note
The output range of the opamp is 0.2 V to VDDA - 0.2 V (depending on output load).
Parameters
basePointer to structure describing registers
currentModeCurrent mode selection
Returns
None
Function Usage
/* Scenario: Configure all CTBs on the device to use a 1 uA IPTAT reference.
* Enable the charge pump and disable Deep Sleep operation for both opamps in the specified CTB block. */

◆ Cy_CTB_SetIptatLevel()

__STATIC_INLINE void Cy_CTB_SetIptatLevel ( cy_en_ctb_iptat_t  iptat)

Set the IPTAT reference level to 1 uA or 100 nA.

The IPTAT generator is used by the CTB for slope offset drift.

Parameters
iptatValue from enum cy_en_ctb_iptat_t
Returns
None
Function Usage
/* Scenario: Configure all CTBs on the device to use a 100 nA IPTAT reference
* for ultra low power. In order for the opamps to function with a 100 nA
* IPTAT reference, Cy_CTB_EnableRedirect() must be called.
*
* This is a low level function that only configures the IPTAT reference level.
* The preferred method is the Cy_CTB_SetCurrentMode() as it is a high
* level function that configures both the IPTAT reference and the current
* redirection. */

◆ Cy_CTB_SetClkPumpSource()

__STATIC_INLINE void Cy_CTB_SetClkPumpSource ( cy_en_ctb_clk_pump_source_t  clkPump)

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

Recall that each opamp has its own charge pump. The clock can come from:

Parameters
clkPumpClock source selection (SRSS or PeriClk) for the pump. Select a value from cy_en_ctb_clk_pump_source_t
Returns
None
Function Usage
/* Scenario: Use a 24 Mhz clock from the SRSS for the charge pump clock. */
/* Set the source to clock Path 0, which has been configured for 100 MHz FLL. */
/* Divide the 100 Mhz by 4. */
/* Select the source for the pump clock to be from the SRSS. */
Function Usage
/* Scenario: Use a 25 Mhz clock from the PeriClk dividers for the charge pump clock. */
uint32_t dividerNum = 1UL;
uint32_t dividerValue = 1UL;
/* Use the 8-bit divider type and divider number 1 from the PeriClk, which has been configured for 50 MHz. */
Cy_SysClk_PeriphAssignDivider(PCLK_PASS_CLOCK_PUMP_PERI, CY_SYSCLK_DIV_8_BIT, dividerNum);
/* Divide the 50 MHz PeriClk by 2 (dividerValue + 1). */
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, dividerNum, dividerValue);
/* Select the source for the pump clock to be from the PeriClk dividers. */

◆ Cy_CTB_EnableRedirect()

__STATIC_INLINE void Cy_CTB_EnableRedirect ( void  )

Normally, the AREF IZTAT is routed to the CTB IZTAT and the AREF IPTAT is routed to the CTB IPTAT:

  • CTB.IZTAT = AREF.IZTAT
  • CTB.IPTAT = AREF.IPTAT

However, the AREF IPTAT can be redirected to the CTB IZTAT and the CTB IPTAT is off.

  • CTB.IZTAT = AREF.IPTAT
  • CTB.IPTAT = HiZ

The redirection applies to all opamps on the device and should be used when the IPTAT bias level is set to 100 nA (see Cy_CTB_SetIptatLevel).

When the CTB.IPTAT is HiZ, the CTB cannot compensate for the slope of the offset across temperature.

Returns
None
Function Usage
/* Scenario: All CTBs on the device have been configured to use
* a 100 nA IPTAT reference. Redirect the AREF IPTAT current to the CTB IZTAT
* for proper functionality.
*
* This is a low level function that only enables the current redirection.
* The preferred method is the Cy_CTB_SetCurrentMode() as it is a high
* level function that configures both the current redirection and the
* IPTAT reference. */

◆ Cy_CTB_DisableRedirect()

__STATIC_INLINE void Cy_CTB_DisableRedirect ( void  )

Disable the redirection of the AREF IPTAT to the CTB IZTAT for all opamps on the device as enabled by Cy_CTB_EnableRedirect.

Returns
None