1.28.19 Reset Controller (RSTC)
The Reset Controller (RSTC), driven by power-on reset (POR) cells, software, external reset pin and peripheral events, handles all the resets of the system without any external components. It reports which reset occurred last. The RSTC also drives simultaneously the external reset and the peripheral and processor resets.
-
Driven by Embedded Poweron Reset, Software, External Reset Pin and Peripheral Events
-
Management of All System Resets, Including
-
External Devices through an I/O Multiplexed Output Reset Pin
-
Processor
-
Peripheral Set
-
-
Reset Source Status
-
Status of the Last Reset
-
Either VDDCORE, VDDIN33 and VDDBU POR Reset, Software Reset, User Reset, Watchdog Reset, 32.768 kHz Crystal Oscillator Failure Detection Reset, CPU Clock Failure Detection
-
-
External Reset Signal Control and Shaping
Using The Library
The reset controller (RSTC) peripheral library provides API to find the cause of last device reset.
RSTC for LED Switcher:
void rstcCallback( uintptr_t context ) { (void) context; msgId = MsgRstcResetInterruptOccurred; if( LedBlueSolid == ledColorType ) { ledColorType = LedGreenSolid; } else { ledColorType = LedBlueSolid; } } void ledUpdate( void ) { LED_GREEN_Toggle(); } int main( void ) { /* Initialize all modules */ SYS_Initialize( NULL ); RSTC_CallbackRegister(rstcCallback, (uintptr_t) NULL ); ledColorType = LedGreenFlash; msgId = MsgBannerBreak; showMsg(); msgId = MsgBannerTitle; showMsg(); msgId = MsgBannerBreak; showMsg(); msgId = MsgSw3Prompt; showMsg(); msgId = MsgInputResult; showMsg(); while( 1 ) { ledUpdate(); showMsg(); } /* Execution should not come here during normal operation */ return( EXIT_FAILURE ); }
Library Interface
Reset Controller peripheral library provides the following interfaces:
Functions
Name | Description |
---|---|
RSTC_Initialize | Initializes RSTC module with the user configuration |
RSTC_Reset | Resets the processor and all the embedded peripherals, if RSTC_RESET type is "RSTC_RESET_PROC ". Asserts the NRST pin, if RSTC_RESET type is "RSTC_RESET_EXT " |
RSTC_NRSTPinRead | This API used to read the NRST pin level, sampled on each "Master Clock(MCK)" rising edge |
RSTC_ResetCauseGet | Reports the cause of the last reset |
RSTC_CallbackRegister | Allows a client to identify a callback function |
Data types and constants
Name | Type | Description |
---|---|---|
RSTC_RESET_CAUSE | Struct | Identifiers for the cause of reset |
RSTC_RESET_TYPE | Enum | Identifiers for the type of reset to perform |
RSTC_CALLBACK | Typedef | RSTC Callback Function Pointer |