PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
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. More...
 

Functions

en_result_t Reset_GetCause (stc_reset_result_t *pstcResult)
 Get current Reset Cause Register contents. More...
 
en_result_t Reset_GetStoredCause (stc_reset_result_t *pstcResult)
 Get stored Reset Cause. More...
 

Variables

stc_reset_result_t stcStoredResetCause
 Global reset cause register. More...
 

Detailed Description

Provided functions of RESET module:

Reset_GetCause() reads the Reset Casue, 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

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]pstcResultReset Cause result structure
Return values
OkFunction done sucessfully

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::bLowVoltageDetection, 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 gloabal Reset Cause Variable

Precondition
Reset_GetCause() must be called before.
Parameters
[out]pstcResultReset Cause result structure
Return values
OkFunction done sucessfully

Definition at line 213 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.