MTB CAT1 Peripheral driver library
SysAnalog (System Analog Reference Block)

General Description

This driver provides an interface for configuring the Analog Reference (AREF), Low Power Oscillator (LpOsc), Deep Sleep Clock and Timer blocks and querying the INTR_CAUSE register of the Programmable Analog SubSystem (PASS) hardware block.

The functions and other declarations used in this driver are in cy_sysanalog.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.

PASS block structure

passv2_diagram.png

The Programmable Analog SubSystem (PASS) hardware block contains a set of analog subblocks such as AREF, CTB, SAR, analog routing switches and others. In order to provide a firmware interface to PASS, subblocks are united into groups, which have their own drivers: SysAnalog, CTB and SAR.

SysAnalog Features Description

SysAnalog driver includes the following features:

The following sections describe how to initialize driver features:

AREF

The AREF block has the following features:

The locally generated references are the recommended sources for blocks in the PASS because they have tighter accuracy, temperature stability, and lower noise than the SRSS references. The SRSS references can be used to save power if the low accuracy and higher noise can be tolerated.

aref_block_diagram.png

The outputs of the AREF are consumed by multiple blocks in the PASS and by the CapSense (CSDv2) block. In some cases, these blocks have the option of using the references from the AREF. This selection would be in the respective drivers for these blocks. In some cases, these blocks require the references from the AREF to function.

AREF OutputSARCTDACCTBCSDv2
VREF optional optional optional
IZTAT required optional optional
IPTAT required

This driver provides a function to query the INTR_CAUSE register of the PASS. There are two interrupts in the PASS:

  1. one global interrupt for all CTBs (up to 4)
  2. one global interrupt for all CTDACs (up to 4)

Because the interrupts are global, the INTR_CAUSE register is needed to query which hardware instance triggered the interrupt.

AREF Configuration

To configure the AREF, call Cy_SysAnalog_Init and provide a pointer to the configuration structure, cy_stc_sysanalog_config_t. Three predefined structures are provided in this driver to cover a majority of use cases:

After initialization, call Cy_SysAnalog_Enable to enable the hardware.

Deep Sleep Operation

The AREF current and voltage references can be enabled to operate in Deep Sleep mode with Cy_SysAnalog_SetDeepSleepMode. There are four options for Deep Sleep operation:

Recall that the CTB requires the IPTAT reference. For the CTB to operate at the 1 uA current mode in Deep Sleep mode, the AREF must be enabled for CY_SYSANALOG_DEEPSLEEP_IPTAT_IZTAT_VREF. For the CTB to operate at the 100 nA current mode in Deep Sleep mode, the AREF must be enabled for CY_SYSANALOG_DEEPSLEEP_IPTAT_2 minimum. In this lower current mode, the AREF IPTAT must be redirected to the CTB IZTAT. See the high level function Cy_CTB_SetCurrentMode in the CTB PDL driver.

If the CTDAC is configured to use the VREF in Deep Sleep mode, the AREF must be enabled for CY_SYSANALOG_DEEPSLEEP_IPTAT_IZTAT_VREF.

Note
The SRSS references are not available to the AREF in Deep Sleep mode. When operating in Deep Sleep mode, the local or external references must be selected.

Low Power Oscillator

Features:

Low Power Oscillator clocking mode is configured by cy_stc_sysanalog_deep_sleep_config_t::lpOscDsMode configuration structure item, which should be passed as a parameter to Cy_SysAnalog_DeepSleepInit function. See Low Power Oscillator Functions for other Low Power Oscillator control functions.

Deep Sleep Clock

Features:

Deep Sleep clock is configurable by cy_stc_sysanalog_deep_sleep_config_t::dsClkSource and cy_stc_sysanalog_deep_sleep_config_t::dsClkdivider configuration structure items, which should be passed as a parameter to Cy_SysAnalog_DeepSleepInit function.

Timer

Features:

Timer is configurable by cy_stc_sysanalog_deep_sleep_config_t::timerClock and cy_stc_sysanalog_deep_sleep_config_t::timerPeriod configuration structure items, which should be passed as a parameter to Cy_SysAnalog_DeepSleepInit function. Also see Timer Functions for other Timer configuration and control functions.

Low Power Oscillator, Deep Sleep Clock and Timer Configuration

To configure Low Power Oscillator, Deep Sleep Clock and Timer blocks, call Cy_SysAnalog_DeepSleepInit function and provide pointer to PASS block and pointer to the cy_stc_sysanalog_deep_sleep_config_t configuration structure. In order to start Low Power Oscillator and Timer, call corresponding enable functions:

/* Initializes Deep Sleep features */
{
/*.lpOscDsMode */ CY_SYSANALOG_LPOSC_ALWAYS_ON,
/*.timerPeriod */ 4000UL
};
{
/* Enable LpOsc and Timer blocks. */
}

More Information

For more information on the AREF, Deep Sleep Clock and Timer, refer to the technical reference manual (TRM).

Changelog

VersionChangesReason for Change
2.10 The CY_SYSANALOG_STARTUP_NORMAL and Cy_SysAnalog_SetArefMode are deprecated. The HW is anyways initialized with the CY_SYSANALOG_STARTUP_FAST. User experience enhancement.
2.0 Added new features: LPOSC, DSCLK, TIMER. New silicon family support.
1.10.1 Minor documentation updates. Documentation enhancement.
1.10 Flattened the organization of the driver source code into the single source directory and the single include directory. Driver library directory-structure simplification.
Added register access layer. Use register access macros instead of direct register access using dereferenced pointers. Makes register access device-independent, so that the PDL does not need to be recompiled for each supported part number.
1.0 Initial version

API Reference

 Macros
 
 Functions
 
 Global Variables
 
 Data Structures
 
 Enumerated Types