Macros | Functions
ResetCtl

Reset controller used to initiate resets and find sources of occurred resets. More...

Macros

#define RESET_KEY   0x6900
 
#define RESET_HARD_RESET   RSTCTL_RESET_REQ_HARD_REQ
 
#define RESET_SOFT_RESET   RSTCTL_RESET_REQ_SOFT_REQ
 
#define RESET_SRC_0   RSTCTL_HARDRESET_CLR_SRC0
 
#define RESET_SRC_1   RSTCTL_HARDRESET_CLR_SRC1
 
#define RESET_SRC_2   RSTCTL_HARDRESET_CLR_SRC2
 
#define RESET_SRC_3   RSTCTL_HARDRESET_CLR_SRC3
 
#define RESET_SRC_4   RSTCTL_HARDRESET_CLR_SRC4
 
#define RESET_SRC_5   RSTCTL_HARDRESET_CLR_SRC5
 
#define RESET_SRC_6   RSTCTL_HARDRESET_CLR_SRC6
 
#define RESET_SRC_7   RSTCTL_HARDRESET_CLR_SRC7
 
#define RESET_SRC_8   RSTCTL_HARDRESET_CLR_SRC8
 
#define RESET_SRC_9   RSTCTL_HARDRESET_CLR_SRC9
 
#define RESET_SRC_10   RSTCTL_HARDRESET_CLR_SRC10
 
#define RESET_SRC_11   RSTCTL_HARDRESET_CLR_SRC11
 
#define RESET_SRC_12   RSTCTL_HARDRESET_CLR_SRC12
 
#define RESET_SRC_13   RSTCTL_HARDRESET_CLR_SRC13
 
#define RESET_SRC_14   RSTCTL_HARDRESET_CLR_SRC14
 
#define RESET_SRC_15   RSTCTL_HARDRESET_CLR_SRC15
 
#define RESET_VCCDET   RSTCTL_PSSRESET_STAT_VCCDET
 
#define RESET_SVSH_TRIP   RSTCTL_PSSRESET_STAT_SVSMH
 
#define RESET_BGREF_BAD   RSTCTL_PSSRESET_STAT_BGREF
 
#define RESET_LPM35   RSTCTL_PCMRESET_STAT_LPM35
 
#define RESET_LPM45   RSTCTL_PCMRESET_STAT_LPM45
 

Functions

void ResetCtl_initiateSoftReset (void)
 
void ResetCtl_initiateSoftResetWithSource (uint32_t source)
 
uint32_t ResetCtl_getSoftResetSource (void)
 
void ResetCtl_clearSoftResetSource (uint32_t mask)
 
void ResetCtl_initiateHardReset (void)
 
void ResetCtl_initiateHardResetWithSource (uint32_t source)
 
uint32_t ResetCtl_getHardResetSource (void)
 
void ResetCtl_clearHardResetSource (uint32_t mask)
 
uint32_t ResetCtl_getPSSSource (void)
 
void ResetCtl_clearPSSFlags (void)
 
uint32_t ResetCtl_getPCMSource (void)
 
void ResetCtl_clearPCMFlags (void)
 

Detailed Description

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:

if(ResetCtl_getSoftResetSource() == RESET_CS_SRC)
{
// Do reset handling here
}

Macro Definition Documentation

#define RESET_KEY   0x6900
#define RESET_HARD_RESET   RSTCTL_RESET_REQ_HARD_REQ
#define RESET_SOFT_RESET   RSTCTL_RESET_REQ_SOFT_REQ
#define RESET_SRC_0   RSTCTL_HARDRESET_CLR_SRC0
#define RESET_SRC_1   RSTCTL_HARDRESET_CLR_SRC1
#define RESET_SRC_2   RSTCTL_HARDRESET_CLR_SRC2
#define RESET_SRC_3   RSTCTL_HARDRESET_CLR_SRC3
#define RESET_SRC_4   RSTCTL_HARDRESET_CLR_SRC4
#define RESET_SRC_5   RSTCTL_HARDRESET_CLR_SRC5
#define RESET_SRC_6   RSTCTL_HARDRESET_CLR_SRC6
#define RESET_SRC_7   RSTCTL_HARDRESET_CLR_SRC7
#define RESET_SRC_8   RSTCTL_HARDRESET_CLR_SRC8
#define RESET_SRC_9   RSTCTL_HARDRESET_CLR_SRC9
#define RESET_SRC_10   RSTCTL_HARDRESET_CLR_SRC10
#define RESET_SRC_11   RSTCTL_HARDRESET_CLR_SRC11
#define RESET_SRC_12   RSTCTL_HARDRESET_CLR_SRC12
#define RESET_SRC_13   RSTCTL_HARDRESET_CLR_SRC13
#define RESET_SRC_14   RSTCTL_HARDRESET_CLR_SRC14
#define RESET_SRC_15   RSTCTL_HARDRESET_CLR_SRC15
#define RESET_VCCDET   RSTCTL_PSSRESET_STAT_VCCDET
#define RESET_SVSH_TRIP   RSTCTL_PSSRESET_STAT_SVSMH
#define RESET_BGREF_BAD   RSTCTL_PSSRESET_STAT_BGREF
#define RESET_LPM35   RSTCTL_PCMRESET_STAT_LPM35
#define RESET_LPM45   RSTCTL_PCMRESET_STAT_LPM45

Function Documentation

void ResetCtl_initiateSoftReset ( void  )

Initiates a soft system reset.

Returns
none

References RESET_KEY, and RESET_SOFT_RESET.

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
sourceSource 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  )

Initiates a hard system reset.

Returns
none

References RESET_HARD_RESET, and RESET_KEY.

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_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:
  • RESET_LPM35,
  • RESET_LPM45
void ResetCtl_clearPCMFlags ( void  )

Clears the corresponding PCM reset source flags

Returns
none

Copyright 2019, Texas Instruments Incorporated