1.35.10 Reset Controller (RSTC)
The Reset Controller (RSTC) handles all the resets of the system and generates following reset signals:
-
Processor Reset: Resets processor and also resets the Watchdog Timer
-
Peripheral Reset: Resets the peripheral
-
External Reset: Drives the NRST pin
The following are the sources of reset:
-
General Reset: A general reset occurs when a VDDIO poweronreset is detected, a brownout or a voltage regulation loss is detected by the Supply Controller.
-
Backup Reset: A backup reset occurs when the chip exits from Backup mode.
-
Watchdog Reset: The watchdog reset occurs when it times out
-
Software Reset: The RSTC offers commands to assert processor reset and external reset
-
User Reset: A user reset is generated when a low level is detected on the NRST pin
Using The Library
The RSTC Peripheral library provides API's for the following:
-
To generate a software reset to reset the processor and all the embedded peripherals including the memory.
-
To find the cause of last device reset
-
Poll the NRST pin status or register interrupt callback when it is used as GPIO
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 including the memory system and, in particular, the Remap Command or this function asserts NRST Pin |
RSTC_NRSTPinRead | Reads the NRST pin level, sampled on each "Master Clock(MCK)" rising edge |
RSTC_ResetCauseGet | Reports the cause of the last reset |
RSTC_CallbackRegister | Allows application to register callback with PLIB |
Data types and constants
Name | Type | Description |
---|---|---|
RSTC_RESET_CAUSE | Struct | Identifies the type of reset |
RSTC_RESET_TYPE | Enum | Identifies the type of reset, either Processor reset or External Reset |
RSTC_CALLBACK | Typedef | RSTC Callback Function Pointer |