MTB CAT1 Peripheral driver library

General Description

This set of functions is for controlling the two CTDAC analog switches, CVD, and CO6.

These are advanced functions. The switches will be managed by the reference source and output mode selections when initializing the hardware.

Functions

void Cy_CTDAC_SetAnalogSwitch (CTDAC_Type *base, uint32_t switchMask, cy_en_ctdac_switch_state_t state)
 Provide firmware control of the CTDAC switches. More...
 
__STATIC_INLINE uint32_t Cy_CTDAC_GetAnalogSwitch (const CTDAC_Type *base)
 Return the state (open or close) of the CTDAC switches. More...
 
__STATIC_INLINE void Cy_CTDAC_SetSwitchCO6 (CTDAC_Type *base, cy_en_ctdac_switch_state_t state)
 Open or close switch CO6 that controls whether the output gets routed directly to a pin or through Opamp0 of the CTB. More...
 
__STATIC_INLINE void Cy_CTDAC_OpenAllSwitches (CTDAC_Type *base)
 Open all switches in the CTDAC (CO6 and CVD). More...
 

Function Documentation

◆ Cy_CTDAC_SetAnalogSwitch()

void Cy_CTDAC_SetAnalogSwitch ( CTDAC_Type base,
uint32_t  switchMask,
cy_en_ctdac_switch_state_t  state 
)

Provide firmware control of the CTDAC switches.

Each call to this function can open a set of switches or close a set of switches.

Note
The switches are configured by the reference source and output mode selections during initialization.
Parameters
basePointer to structure describing registers
switchMaskThe mask of the switches to either open or close. Select one or more values from cy_en_ctdac_switches_t and "OR" them together.
stateOpen or close the switch(es). Select a value from cy_en_ctdac_switch_state_t.
Returns
None
Function Usage
/* Scenario: In addition to buffering the DAC output through Opamp0 of the connecting
* CTB, route the DAC output to a dedicated device pin by closing the CO6 switch. */

◆ Cy_CTDAC_GetAnalogSwitch()

__STATIC_INLINE uint32_t Cy_CTDAC_GetAnalogSwitch ( const CTDAC_Type base)

Return the state (open or close) of the CTDAC switches.

Note
The switches will be managed by the reference source and output mode selections when initializing the hardware.
Parameters
basePointer to structure describing registers
Returns
Switch state. Compare this value to the masks found in cy_en_ctdac_switches_t.

◆ Cy_CTDAC_SetSwitchCO6()

__STATIC_INLINE void Cy_CTDAC_SetSwitchCO6 ( CTDAC_Type base,
cy_en_ctdac_switch_state_t  state 
)

Open or close switch CO6 that controls whether the output gets routed directly to a pin or through Opamp0 of the CTB.

This function calls Cy_CTDAC_SetAnalogSwitch with the switchMask set to CY_CTDAC_SWITCH_CO6_MASK.

Note
The switches is configured by the output mode selections during initialization.
This switch will temporarily be opened for deglitching if the deglitch mode is CY_CTDAC_DEGLITCHMODE_UNBUFFERED or CY_CTDAC_DEGLITCHMODE_BOTH.
Parameters
basePointer to structure describing registers
stateState of the switch, open or close.
Returns
None
Function Usage
/* Scenario: In addition to buffering the DAC output through Opamp0 of the connecting
* CTB, route the DAC output to a dedicated device pin by closing the CO6 switch. */

◆ Cy_CTDAC_OpenAllSwitches()

__STATIC_INLINE void Cy_CTDAC_OpenAllSwitches ( CTDAC_Type base)

Open all switches in the CTDAC (CO6 and CVD).

Parameters
basePointer to structure describing registers
Returns
None
Function Usage
/* Scenario: Reset all the switches to destroy all previous connections. */