BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Hardware presentation/abstraction for SYS peripheral (SYS). More...
#include <bsp430/periph.h>
Go to the source code of this file.
Macros | |
#define | BSP430_MODULE_SYS defined(__MSP430_HAS_SYS__) |
#define | BSP430_SYS_FLAG_SYSRST_BOR 0x0001 |
#define | BSP430_SYS_FLAG_SYSRST_LPM5WU 0x0002 |
#define | BSP430_SYS_FLAG_SYSRST_POR 0x0004 |
#define | BSP430_SYS_FLAG_SYSRST_PUC 0x0008 |
Functions | |
const char * | xBSP430sysSYSRSTIVDescription (unsigned int sysrstiv) |
unsigned int | uiBSP430sysSYSRSTGenerator_ni (unsigned int *puiResetFlags) |
Hardware presentation/abstraction for SYS peripheral (SYS).
The System Control Module (SYS) is present on 5xx/6xx/FR5xx devices.
None supported.
As there can be only one instance of SYS on any MCU, there is no structure supporting a SYS HPL. Manipulate the peripheral through its registers directly.
As there can be only one instance of SYS on any MCU, there is no structure supporting a SYS HAL.
The functions provided by this module simplify the extraction of reset causes, notification of type of reset, and translation from MCU-specific reset codes to text cause descriptions.
#define BSP430_MODULE_SYS defined(__MSP430_HAS_SYS__) |
Defined on inclusion of <bsp430/periph/sys.h>. The value evaluates to true if the target MCU supports the System Control Module, and false if it does not.
#define BSP430_SYS_FLAG_SYSRST_BOR 0x0001 |
Flag indicating a BOR occurred during the last reset.
Set in the output reset flags parameter by uiBSP430sysSYSRSTGenerator_ni when a reset cause with a priority at least as high as security violation has been recorded.
#define BSP430_SYS_FLAG_SYSRST_LPM5WU 0x0002 |
Flag indicating an LPMx.5 wakeup occurred during the last reset.
Set in the output reset flags parameter by uiBSP430sysSYSRSTGenerator_ni when SYSRSTIV_LPM5WU has been recorded.
#define BSP430_SYS_FLAG_SYSRST_POR 0x0004 |
Flag indicating a POR occurred during the last reset.
Set in the output reset flags parameter by uiBSP430sysSYSRSTGenerator_ni when a reset cause with a priority at least as high as PMM_DOPOR has been recorded.
#define BSP430_SYS_FLAG_SYSRST_PUC 0x0008 |
Flag indicating a PUC occurred during the last reset.
Set in the output reset flags parameter by uiBSP430sysSYSRSTGenerator_ni when any reset cause was recorded.
unsigned int uiBSP430sysSYSRSTGenerator_ni | ( | unsigned int * | puiResetFlags | ) |
Generate the events recorded within the system reset vector.
This routine can be used to determine the cause of a reset. It can also detect whether the reset involves a brownout reset (BOR), which restores everything to its power-on condition, or is a result of an LPMx.5 wakeup, or several other classes of reset.
Recall that an MSP430 power on reset (POR) does not in fact return all values to power on defaults, nor does a power up clear (PUC). See vBSP430pmmInduceBOR().
puiResetFlags | Optional pointer to a variable that indicates the class of reset causes encountered. On initial call, the value of the pointed-to variable should be zero; it is updated with BSP430_SYS_FLAG_SYSRST_BOR and related flags as each reset cause is returned. |
const char* xBSP430sysSYSRSTIVDescription | ( | unsigned int | sysrstiv | ) |
Get the text describing the reset cause
The integer value returned by uiBSP430sysSYSRSTGenerator_ni() identifies an MCU-specific constant such as SYSRSTIV_WDTTO, but the value of that constant is different on different MCUs. This routine will map the integer value to the text description of the reset cause.
sysrstiv | an integer reset cause value returned from uiBSP430sysSYSRSTGenerator_ni() |
sysrstiv
is not recognized.