| PDL for FM0+ Version1.0 Peripheral Driverl Library for FM0+

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Typedefs | Functions | Variables
Reset Factor (RESET)

## Data Structures
struct | stc_reset_result
| Datatype for Reset Cause return structure. More...
## Typedefs
typedef struct stc_reset_result | stc_reset_result_t
| Datatype for Reset Cause return structure.
## Functions
en_result_t | Reset_GetCause (stc_reset_result_t *pstcResult)
| Get current Reset Cause Register contents.
en_result_t | Reset_GetStoredCause (stc_reset_result_t *pstcResult)
| Get stored Reset Cause.
## Variables
stc_reset_result_t | stcStoredResetCause
| Global reset cause register.

## Detailed Description

Provided functions of RESET module:

- Reset_GetCause()
- Reset_GetStoredCause()

Reset_GetCause() reads the Reset Cause, clears the HW register, and stores the result in a global variable. This is needed, if the SystemInit function uses this function for retrieving the reset cause (for RTC, etc.), but the application itself also needs the reset cause. Reset_GetStoredCause() reads out the global reset cause variable, without touching the reset cause register. Reset_GetCause() must be called before.

This driver does not need any configuration structure, but uses a result structure stc_reset_result_t, which has to be provided by the caller.

## Typedef Documentation

typedef struct stc_reset_result stc_reset_result_t

Datatype for Reset Cause return structure.

## Function Documentation

en_result_t Reset_GetCause | ( | stc_reset_result_t * | pstcResult | ) |

Get current Reset Cause Register contents.

This function reads the Reset Cause Register and stores the cause bits in the result structure pointer.

Attention:
  Calling this function clears all bits in the Reset Cause Register RST_STR! Reset_GetCause() should only be called after Start-up code!

Parameters:

  [out] | pstcResult | Reset Cause result structure

Return values:

  Ok | Function done successfully

Definition at line 108 of file reset.c.

References stc_reset_result::bAnomalousFrequency, stc_reset_result::bClockSupervisor, stc_reset_result::bHardwareWatchdog, stc_reset_result::bInitx, stc_reset_result::bPowerOn, stc_reset_result::bSoftware, stc_reset_result::bSoftwareWatchdog, FALSE, Ok, and TRUE.

en_result_t Reset_GetStoredCause | ( | stc_reset_result_t * | pstcResult | ) |

Get stored Reset Cause.

This function reads the global Reset Cause Variable

Parameters:

  [out] | pstcResult | Reset Cause result structure

Return values:

  Ok | Function done successfully

Definition at line 201 of file reset.c.

References Ok.

## Variable Documentation

stc_reset_result_t stcStoredResetCause

Global reset cause register.

Definition at line 73 of file reset.c.