Driver API for RSTC (plib_rstc.h) More...
Typedefs | |
| typedef void(* | RSTC_CALLBACK) (void) |
| User Reset interrupt callback function type. | |
Functions | |
| bool | RSTC_EnableUserReset (void) |
| Enable User Reset on a low level on NRST. | |
| bool | RSTC_DisableUserReset (void) |
| Disable User Reset on a low level on NRST. | |
| bool | RSTC_EnableUserResetInterrupt (void) |
| Enable the User Reset interrupt. | |
| bool | RSTC_DisableUserResetInterrupt (void) |
| Disable the User Reset interrupt. | |
| bool | RSTC_SetExternalResetLength (uint8_t length) |
| Set the External Reset Length. | |
| bool | RSTC_AssertProcessorReset (void) |
| Command a processor reset. | |
| bool | RSTC_AssertExternalReset (void) |
| Command an external reset (RSTC_CR.EXTRST). | |
| bool | RSTC_NrstLevelIsHigh (void) |
| Report whether the NRST pin is currently sampled high (RSTC_SR.NRSTL). | |
| uint32_t | RSTC_ReadResetType (void) |
| Read the cause of the last processor reset. | |
| bool | RSTC_UserResetIsDetected (void) |
| Report whether a User Reset has been detected (RSTC_SR.URSTS). | |
| bool | RSTC_SoftwareResetIsInProgress (void) |
| Report whether a software reset command is currently in progress (RSTC_SR.SRCMP). | |
| void | RSTC_RegisterUserResetCallback (RSTC_CALLBACK callback) |
| Register a callback to be invoked from RSTC_Handler() on a User Reset interrupt event. | |
| void | RSTC_ClearUserResetInterrupt (void) |
| Clear the User Reset interrupt. | |
Driver API for RSTC (plib_rstc.h)
The following example demonstrates typical usage of the RSTC peripheral:
| typedef void(* RSTC_CALLBACK) (void) |
User Reset interrupt callback function type.
| bool RSTC_AssertExternalReset | ( | void | ) |
Command an external reset (RSTC_CR.EXTRST).
Asserts the NRST pin low for the duration configured by RSTC_MR.ERSTL. No effect if a software reset command is already in progress. Reading RSTC_SR to check this also clears RSTC_SR.URSTS.
| bool RSTC_AssertProcessorReset | ( | void | ) |
Command a processor reset.
Resets the processor and all embedded peripherals. No effect if a software reset command is already in progress. Reading RSTC_SR to check this also clears RSTC_SR.URSTS.
| void RSTC_ClearUserResetInterrupt | ( | void | ) |
Clear the User Reset interrupt.
Reading RSTC_SR clears RSTC_SR.URSTS, and with it the RSTC interrupt line.
| bool RSTC_DisableUserReset | ( | void | ) |
Disable User Reset on a low level on NRST.
| bool RSTC_DisableUserResetInterrupt | ( | void | ) |
Disable the User Reset interrupt.
Preserves the current URSTEN and ERSTL fields.
| bool RSTC_EnableUserReset | ( | void | ) |
Enable User Reset on a low level on NRST.
| bool RSTC_EnableUserResetInterrupt | ( | void | ) |
Enable the User Reset interrupt.
Only asserts the RSTC interrupt line when URSTEN = 0. Preserves the current URSTEN and ERSTL fields.
| bool RSTC_NrstLevelIsHigh | ( | void | ) |
Report whether the NRST pin is currently sampled high (RSTC_SR.NRSTL).
Reading RSTC_SR clears RSTC_SR.URSTS.
| uint32_t RSTC_ReadResetType | ( | void | ) |
Read the cause of the last processor reset.
Reading RSTC_SR clears RSTC_SR.URSTS.
| void RSTC_RegisterUserResetCallback | ( | RSTC_CALLBACK | callback | ) |
Register a callback to be invoked from RSTC_Handler() on a User Reset interrupt event.
Only relevant when RSTC_MR.URSTEN = 0 and RSTC_MR.URSTIEN = 1 (see RSTC_DisableUserReset() and RSTC_EnableUserResetInterrupt()).
| [in] | callback | Function to invoke, or NULL to unregister. |
| bool RSTC_SetExternalResetLength | ( | uint8_t | length | ) |
Set the External Reset Length.
NRST is held low for 2^(ERSTL+1) SLOW_CLK cycles. Must be non-zero for a correctly shaped Watchdog Timer reset; ERSTL defaults to 0 at power-up.
| [in] | length | External Reset Length (ERSTL, 0-15). |
| bool RSTC_SoftwareResetIsInProgress | ( | void | ) |
Report whether a software reset command is currently in progress (RSTC_SR.SRCMP).
Reading RSTC_SR clears RSTC_SR.URSTS.
| bool RSTC_UserResetIsDetected | ( | void | ) |
Report whether a User Reset has been detected (RSTC_SR.URSTS).
Reading RSTC_SR clears RSTC_SR.URSTS.