Reset controller used to initiate resets and find sources of occurred resets.
More...
Reset controller used to initiate resets and find sources of occurred resets.
Module Operation
The DriverLib APIs for the MSP432 Reset Control are a set of power functions that enables programmers to manipulate all aspects of a system reset. The user is able to initiate both hard and soft resets as well as determine the cause of a prior system reset.
Reset Sources
Reset sources will vary from device to device (see the device specific datasheet for the reset source mappings relevant to your device). The ResetCtl for DriverLib defines a set of generic reset sources (such as RESET_SRC_0). In practice, it is a good idea to use a define statement to match these to a specific reset source. For example, MSP432's mapping could look something similar to the following:
#define RESET_SYSTEM_SRC RESET_SRC_0
#define RESET_WDTTIME_SRC RESET_SRC_1
#define RESET_WDTPW_SRC RESET_SRC_2
#define RESET_CS_SRC RESET_SRC_3
#define RESET_PCM_SRC RESET_SRC_14
#define RESET_SYS_SRC RESET_SRC_15
By defining these extra set of macros, the user code that accesses the DriverLib ResetCtl APIs are more legible. For example, when checking to see if a device was reset because of a CS violation (such as a XTAL fault), the user could write code similar to the following:
#define RESET_HARD_RESET RSTCTL_RESETREQ_HRD_REQ |
#define RESET_SOFT_RESET RSTCTL_RESETREQ_SFT_REQ |
#define RESET_SRC_0 RSTCTL_HRDRESETSTAT_SRC0 |
#define RESET_SRC_1 RSTCTL_HRDRESETSTAT_SRC1 |
#define RESET_SRC_2 RSTCTL_HRDRESETSTAT_SRC2 |
#define RESET_SRC_3 RSTCTL_HRDRESETSTAT_SRC3 |
#define RESET_SRC_4 RSTCTL_HRDRESETSTAT_SRC4 |
#define RESET_SRC_5 RSTCTL_HRDRESETSTAT_SRC5 |
#define RESET_SRC_6 RSTCTL_HRDRESETSTAT_SRC6 |
#define RESET_SRC_7 RSTCTL_HRDRESETSTAT_SRC7 |
#define RESET_SRC_8 RSTCTL_HRDRESETSTAT_SRC8 |
#define RESET_SRC_9 RSTCTL_HRDRESETSTAT_SRC9 |
#define RESET_SRC_10 RSTCTL_HRDRESETSTAT_SRC10 |
#define RESET_SRC_11 RSTCTL_HRDRESETSTAT_SRC11 |
#define RESET_SRC_12 RSTCTL_HRDRESETSTAT_SRC12 |
#define RESET_SRC_13 RSTCTL_HRDRESETSTAT_SRC13 |
#define RESET_SRC_14 RSTCTL_HRDRESETSTAT_SRC14 |
#define RESET_SRC_15 RSTCTL_HRDRESETSTAT_SRC15 |
#define RESET_VCCDET RSTCTL_PSSRSTSTAT_BGREF |
#define RESET_SVSH_TRIP RSTCTL_PSSRSTSTAT_SVSH |
#define RESET_SVSL_TRIP RSTCTL_PSSRSTSTAT_SVSL |
#define RESET_BGREF_BAD RSTCTL_PSSRSTSTAT_BGREF |
#define RESET_SD0 RSTCTL_PCMRSTSTAT_LPM35 |
#define RESET_SD1 RSTCTL_PCMRSTSTAT_LPM45 |
void ResetCtl_initiateSoftReset |
( |
void |
| ) |
|
void ResetCtl_initiateSoftResetWithSource |
( |
uint32_t |
source | ) |
|
Initiates a soft system reset with a particular source given. This source is generic and can be assigned by the user.
- Parameters
-
source | Source of the reset. Valid values are:
- RESET_SRC_0,
- RESET_SRC_1,
- RESET_SRC_2,
- RESET_SRC_3,
- RESET_SRC_4,
- RESET_SRC_5,
- RESET_SRC_6,
- RESET_SRC_7,
- RESET_SRC_8,
- RESET_SRC_9,
- RESET_SRC_10,
- RESET_SRC_11,
- RESET_SRC_12,
- RESET_SRC_13,
- RESET_SRC_14,
- RESET_SRC_15
|
- Returns
- none
uint32_t ResetCtl_getSoftResetSource |
( |
void |
| ) |
|
Retrieves previous soft reset sources
- Returns
- the bitwise or of previous reset sources. These sources must be cleared using the ResetCtl_clearSoftResetSource function to be cleared. Possible values include:
- RESET_SRC_0,
- RESET_SRC_1,
- RESET_SRC_2,
- RESET_SRC_3,
- RESET_SRC_4,
- RESET_SRC_5,
- RESET_SRC_6,
- RESET_SRC_7,
- RESET_SRC_8,
- RESET_SRC_9,
- RESET_SRC_10,
- RESET_SRC_11,
- RESET_SRC_12,
- RESET_SRC_13,
- RESET_SRC_14,
- RESET_SRC_15
void ResetCtl_clearSoftResetSource |
( |
uint32_t |
mask | ) |
|
Clears the reset sources associated with at soft reset
- Parameters
-
mask | - Bitwise OR of any of the following values:
- RESET_SRC_0,
- RESET_SRC_1,
- RESET_SRC_2,
- RESET_SRC_3,
- RESET_SRC_4,
- RESET_SRC_5,
- RESET_SRC_6,
- RESET_SRC_7,
- RESET_SRC_8,
- RESET_SRC_9,
- RESET_SRC_10,
- RESET_SRC_11,
- RESET_SRC_12,
- RESET_SRC_13,
- RESET_SRC_14,
- RESET_SRC_15
|
- Returns
- none
void ResetCtl_initiateHardReset |
( |
void |
| ) |
|
void ResetCtl_initiateHardResetWithSource |
( |
uint32_t |
source | ) |
|
Initiates a hard system reset with a particular source given. This source is generic and can be assigned by the user.
- Parameters
-
source | - Valid values are one the following values:
- RESET_SRC_0,
- RESET_SRC_1,
- RESET_SRC_2,
- RESET_SRC_3,
- RESET_SRC_4,
- RESET_SRC_5,
- RESET_SRC_6,
- RESET_SRC_7,
- RESET_SRC_8,
- RESET_SRC_9,
- RESET_SRC_10,
- RESET_SRC_11,
- RESET_SRC_12,
- RESET_SRC_13,
- RESET_SRC_14,
- RESET_SRC_15
|
- Returns
- none
uint32_t ResetCtl_getHardResetSource |
( |
void |
| ) |
|
Retrieves previous hard reset sources
- Returns
- the bitwise or of previous reset sources. These sources must be cleared using the ResetCtl_clearHardResetSource function to be cleared. Possible values include:
- RESET_SRC_0,
- RESET_SRC_1,
- RESET_SRC_2,
- RESET_SRC_3,
- RESET_SRC_4,
- RESET_SRC_5,
- RESET_SRC_6,
- RESET_SRC_7,
- RESET_SRC_8,
- RESET_SRC_9,
- RESET_SRC_10,
- RESET_SRC_11,
- RESET_SRC_12,
- RESET_SRC_13,
- RESET_SRC_14,
- RESET_SRC_15
void ResetCtl_clearHardResetSource |
( |
uint32_t |
mask | ) |
|
Clears the reset sources associated with at hard reset
- Parameters
-
mask | - Bitwise OR of any of the following values:
- RESET_SRC_0,
- RESET_SRC_1,
- RESET_SRC_2,
- RESET_SRC_3,
- RESET_SRC_4,
- RESET_SRC_5,
- RESET_SRC_6,
- RESET_SRC_7,
- RESET_SRC_8,
- RESET_SRC_9,
- RESET_SRC_10,
- RESET_SRC_11,
- RESET_SRC_12,
- RESET_SRC_13,
- RESET_SRC_14,
- RESET_SRC_15
|
- Returns
- none
uint32_t ResetCtl_getPSSSource |
( |
void |
| ) |
|
Indicates the last cause of a power-on reset (POR) due to PSS operation. Note that the bits returned from this function may be set in different combinations. When a cold power up occurs, the value of all the values ORed together could be returned as a cold power up causes these conditions.
- Returns
- Bitwise OR of any of the following values:
- RESET_VCCDET,
- RESET_SVSH_TRIP,
- RESET_SVSL_TRIP,
- RESET_BGREF_BAD
void ResetCtl_clearPSSFlags |
( |
void |
| ) |
|
Clears the PSS reset source flags
- Returns
- none
uint32_t ResetCtl_getPCMSource |
( |
void |
| ) |
|
Indicates the last cause of a power-on reset (POR) due to PCM operation.
- Returns
- Bitwise OR of any of the following values:
void ResetCtl_clearPCMFlags |
( |
void |
| ) |
|
Clears the corresponding PCM reset source flags
- Returns
- none