CC26xx Driver Library
[aux_sysif.h] AUX System Interface

Functions

void AUXSYSIFOpModeChange (uint32_t targetOpMode)
 Changes the AUX operational mode to the requested target mode. More...
 

Detailed Description

Function Documentation

void AUXSYSIFOpModeChange ( uint32_t  targetOpMode)

Changes the AUX operational mode to the requested target mode.

This function controls the change of the AUX operational mode. The function controls the change of the current operational mode to the operational mode target by adhering to rules specified by HW.

Parameters
targetOpModeAUX operational mode:
Returns
None

Referenced by TrimAfterColdResetWakeupFromShutDown().

68 {
69  uint32_t currentOpMode;
70  uint32_t currentOrder;
71  uint32_t nextMode;
72 
73  // Check the argument
74  ASSERT((targetOpMode == AUX_SYSIF_OPMODEREQ_REQ_PDLP)||
75  (targetOpMode == AUX_SYSIF_OPMODEREQ_REQ_PDA) ||
76  (targetOpMode == AUX_SYSIF_OPMODEREQ_REQ_LP) ||
77  (targetOpMode == AUX_SYSIF_OPMODEREQ_REQ_A));
78 
79  do {
80  currentOpMode = HWREG(AUX_SYSIF_BASE + AUX_SYSIF_O_OPMODEREQ);
81  while ( currentOpMode != HWREG(AUX_SYSIF_BASE + AUX_SYSIF_O_OPMODEACK));
82  if (currentOpMode != targetOpMode)
83  {
84  currentOrder = g_OpMode_to_order[currentOpMode];
85  if ( currentOrder < g_OpMode_to_order[targetOpMode])
86  {
87  nextMode = g_Order_to_OpMode[currentOrder + 1];
88  }
89  else
90  {
91  nextMode = g_Order_to_OpMode[currentOrder - 1];
92  }
93  HWREG(AUX_SYSIF_BASE + AUX_SYSIF_O_OPMODEREQ) = nextMode;
94  }
95  } while ( currentOpMode != targetOpMode );
96 }
static const uint8_t g_Order_to_OpMode[4]
Definition: aux_sysif.c:59
#define ASSERT(expr)
Definition: debug.h:73
static const uint8_t g_OpMode_to_order[4]
Definition: aux_sysif.c:58

Macro Definition Documentation

#define AUX_SYSIF_OPMODE_TARGET_A   (AUX_SYSIF_OPMODEREQ_REQ_A)
#define AUX_SYSIF_OPMODE_TARGET_LP   (AUX_SYSIF_OPMODEREQ_REQ_LP)
#define AUX_SYSIF_OPMODE_TARGET_PDA   (AUX_SYSIF_OPMODEREQ_REQ_PDA)
#define AUX_SYSIF_OPMODE_TARGET_PDLP   (AUX_SYSIF_OPMODEREQ_REQ_PDLP)