PSoC 6 Peripheral Driver Library

General Description

Functions

cy_en_sysanalog_status_t Cy_SysAnalog_Init (const cy_stc_sysanalog_config_t *config)
 Initialize the AREF block. More...
 
__STATIC_INLINE void Cy_SysAnalog_DeInit (void)
 Reset AREF configuration back to power on reset defaults. More...
 
__STATIC_INLINE uint32_t Cy_SysAnalog_GetIntrCause (void)
 Return the PASS interrupt cause register value. More...
 
__STATIC_INLINE void Cy_SysAnalog_SetDeepSleepMode (cy_en_sysanalog_deep_sleep_t deepSleep)
 Set what parts of the AREF are enabled in Deep Sleep mode. More...
 
__STATIC_INLINE cy_en_sysanalog_deep_sleep_t Cy_SysAnalog_GetDeepSleepMode (void)
 Return Deep Sleep mode configuration as set by Cy_SysAnalog_SetDeepSleepMode. More...
 
__STATIC_INLINE void Cy_SysAnalog_Enable (void)
 Enable the AREF hardware block. More...
 
__STATIC_INLINE void Cy_SysAnalog_Disable (void)
 Disable the AREF hardware block. More...
 
__STATIC_INLINE void Cy_SysAnalog_SetArefMode (cy_en_sysanalog_startup_t startup)
 Set the AREF startup mode from power on reset or from Deep Sleep wakeup. More...
 
__STATIC_INLINE void Cy_SysAnalog_VrefSelect (cy_en_sysanalog_vref_source_t vref)
 Set the source for the Vref. More...
 
__STATIC_INLINE void Cy_SysAnalog_IztatSelect (cy_en_sysanalog_iztat_source_t iztat)
 Set the source for the 1 uA IZTAT. More...
 

Function Documentation

◆ Cy_SysAnalog_Init()

cy_en_sysanalog_status_t Cy_SysAnalog_Init ( const cy_stc_sysanalog_config_t config)

Initialize the AREF block.

Parameters
configPointer to structure containing configuration data. See cy_stc_sysanalog_config_t
Returns
Function Usage
/* Scenario: The AREF is a system wide resource; it is used by multiple blocks (SAR, CTDAC, CTB, and CSDv2).
* If one of these blocks require one of the AREF reference outputs, the AREF must be enabled.
* The AREF block is not meant to be used stand-alone. */
/* The Cy_SysAnalog_Fast_Local configuration is provided by the driver
* to cover a majority of use cases. It is the recommended configuration
* for analog performance; it configures the block for
* fast startup and sources all references with its local generators. */
/* Turn on the hardware block. */
/* After the AREF is enabled, enable the consumer blocks (SAR, CTDAC, CTB, and CSDv2). */

◆ Cy_SysAnalog_DeInit()

__STATIC_INLINE void Cy_SysAnalog_DeInit ( void  )

Reset AREF configuration back to power on reset defaults.

Returns
None
Function Usage
/* Scenario: The AREF is no longer needed. Reset the AREF to power on reset settings. */

◆ Cy_SysAnalog_GetIntrCause()

__STATIC_INLINE uint32_t Cy_SysAnalog_GetIntrCause ( void  )

Return the PASS interrupt cause register value.

There are two interrupts in the PASS:

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

Compare this returned value with the enum values in cy_en_sysanalog_intr_cause_t to determine which block caused/triggered the interrupt.

Returns
uint32_t Interrupt cause register value.
Function Usage
/* Scenario: The device has multiple CTBs or CTDACs and
* that user wants to know which instance caused the global interrupt.
* This function is not useful or needed when the device has only
* one CTB or CTDAC. */
uint32_t intrCause;
if ((uint32_t) CY_SYSANALOG_INTR_CAUSE_CTB0 == (intrCause & (uint32_t) CY_SYSANALOG_INTR_CAUSE_CTB0))
{
/* CTB0 caused the interrupt */
}

◆ Cy_SysAnalog_SetDeepSleepMode()

__STATIC_INLINE void Cy_SysAnalog_SetDeepSleepMode ( cy_en_sysanalog_deep_sleep_t  deepSleep)

Set what parts of the AREF are enabled in Deep Sleep mode.

  • Disable AREF IP block
  • Enable IPTAT generator for fast wakeup from Deep Sleep mode. IPTAT outputs for CTBs are disabled.
  • Enable IPTAT generator and IPTAT outputs for CTB
  • Enable all generators and outputs: IPTAT, IZTAT, and 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.
Parameters
deepSleepSelect a value from cy_en_sysanalog_deep_sleep_t
Returns
None
Function Usage
/* Scenario:
* The CTB opamps are using the current references from the AREF block.
* The CTDAC is using the 1.2 V voltage reference from the AREF block.
* The user wants the CTB and CTDAC to be enabled in Deep Sleep mode.
* In order for the CTB and CTDAC to function in Deep Sleep mode, the references
* from the AREF block must also be enabled for Deep Sleep operation. */

◆ Cy_SysAnalog_GetDeepSleepMode()

__STATIC_INLINE cy_en_sysanalog_deep_sleep_t Cy_SysAnalog_GetDeepSleepMode ( void  )

Return Deep Sleep mode configuration as set by Cy_SysAnalog_SetDeepSleepMode.

Returns
A value from cy_en_sysanalog_deep_sleep_t
Function Usage
/* Scenario: As a system wide resource, the AREF Deep Sleep mode configuration
* affects all consumer blocks. The Deep Sleep mode settings should be queried
* before it is modified as to not affect other blocks. */
/* Don't enable the voltage reference, VREF, in Deep Sleep unless
* it is needed by other blocks (e.g. the CTDAC) as it will consume more power. */
{
}

◆ Cy_SysAnalog_Enable()

__STATIC_INLINE void Cy_SysAnalog_Enable ( void  )

Enable the AREF hardware block.

Returns
None
Function Usage
/* Scenario: The AREF block has been initialized and needs to be enabled. */
/* After the AREF is enabled, enable the consumer blocks (SAR, CTDAC, CTB, and CSDv2). */

◆ Cy_SysAnalog_Disable()

__STATIC_INLINE void Cy_SysAnalog_Disable ( void  )

Disable the AREF hardware block.

Returns
None
Function Usage
/* Scenario: The AREF block is no longer needed.
* That is, all the consumer blocks (SAR, CTDAC, CTB, and CSDv2) have been disabled.
* Disable the AREF block to save power. */

◆ Cy_SysAnalog_SetArefMode()

__STATIC_INLINE void Cy_SysAnalog_SetArefMode ( cy_en_sysanalog_startup_t  startup)

Set the AREF startup mode from power on reset or from Deep Sleep wakeup.

The AREF can startup in a normal or fast mode.

If fast startup is desired from Deep Sleep wakeup, the IPTAT generators must be enabled during Deep Sleep. This is a minimum Deep Sleep mode setting of CY_SYSANALOG_DEEPSLEEP_IPTAT_1 (see also Cy_SysAnalog_SetDeepSleepMode).

Parameters
startupValue from enum cy_en_sysanalog_startup_t
Returns
None
Function Usage
/* Scenario: The fast startup mode is desired. */

◆ Cy_SysAnalog_VrefSelect()

__STATIC_INLINE void Cy_SysAnalog_VrefSelect ( cy_en_sysanalog_vref_source_t  vref)

Set the source for the Vref.

The Vref can come from:

  • the locally generated 1.2 V reference
  • the SRSS, which provides a 0.8 V reference (not available to the AREF in Deep Sleep mode)
  • an external device pin

The locally generated reference has higher accuracy, more stability over temperature, and lower noise than the SRSS reference.

Parameters
vrefValue from enum cy_en_sysanalog_vref_source_t
Returns
None
Function Usage
/* Select the local 1.2 V generator as the Vref source for optimal analog performance. */

◆ Cy_SysAnalog_IztatSelect()

__STATIC_INLINE void Cy_SysAnalog_IztatSelect ( cy_en_sysanalog_iztat_source_t  iztat)

Set the source for the 1 uA IZTAT.

The IZTAT can come from:

  • the locally generated IZTAT
  • the SRSS (not available to the AREF in Deep Sleep mode)

The locally generated reference has higher accuracy, more stability over temperature, and lower noise than the SRSS reference.

Parameters
iztatValue from enum cy_en_sysanalog_iztat_source_t
Returns
None
Function Usage
/* Select the local generator as the IZTAT source for optimal analog performance. */