RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures | Enumerator | Variables
Rtwdog

Data Structures

struct  _rtwdog_work_mode
 Defines RTWDOG work mode. More...
 
struct  _rtwdog_config
 Describes RTWDOG configuration structure. More...
 

Variables

bool _rtwdog_work_mode::enableWait
 
bool _rtwdog_work_mode::enableStop
 
bool _rtwdog_work_mode::enableDebug
 
bool _rtwdog_config::enableRtwdog
 
rtwdog_clock_source_t _rtwdog_config::clockSource
 
rtwdog_clock_prescaler_t _rtwdog_config::prescaler
 
rtwdog_work_mode_t _rtwdog_config::workMode
 
rtwdog_test_mode_t _rtwdog_config::testMode
 
bool _rtwdog_config::enableUpdate
 
bool _rtwdog_config::enableInterrupt
 
bool _rtwdog_config::enableWindowMode
 
uint16_t _rtwdog_config::windowValue
 
uint16_t _rtwdog_config::timeoutValue
 

Driver version

enum  _rtwdog_clock_source { kRTWDOG_ClockSource0 = 0U , kRTWDOG_ClockSource1 = 1U , kRTWDOG_ClockSource2 = 2U , kRTWDOG_ClockSource3 = 3U }
 Describes RTWDOG clock source. More...
 
enum  _rtwdog_clock_prescaler { kRTWDOG_ClockPrescalerDivide1 = 0x0U , kRTWDOG_ClockPrescalerDivide256 = 0x1U }
 Describes the selection of the clock prescaler. More...
 
enum  _rtwdog_test_mode { kRTWDOG_TestModeDisabled = 0U , kRTWDOG_UserModeEnabled = 1U , kRTWDOG_LowByteTest = 2U , kRTWDOG_HighByteTest = 3U }
 Describes RTWDOG test mode. More...
 
enum  _rtwdog_interrupt_enable_t { kRTWDOG_InterruptEnable = RTWDOG_CS_INT_MASK }
 RTWDOG interrupt configuration structure. More...
 
enum  _rtwdog_status_flags_t { kRTWDOG_RunningFlag = RTWDOG_CS_EN_MASK , kRTWDOG_InterruptFlag = RTWDOG_CS_FLG_MASK }
 RTWDOG status flags. More...
 
typedef enum _rtwdog_clock_source rtwdog_clock_source_t
 Describes RTWDOG clock source.
 
typedef enum _rtwdog_clock_prescaler rtwdog_clock_prescaler_t
 Describes the selection of the clock prescaler.
 
typedef struct _rtwdog_work_mode rtwdog_work_mode_t
 Defines RTWDOG work mode.
 
typedef enum _rtwdog_test_mode rtwdog_test_mode_t
 Describes RTWDOG test mode.
 
typedef struct _rtwdog_config rtwdog_config_t
 Describes RTWDOG configuration structure.
 
#define FSL_RTWDOG_DRIVER_VERSION   (MAKE_VERSION(2, 1, 2))
 RTWDOG driver version 2.1.2.
 

RTWDOG Initialization and De-initialization

void RTWDOG_GetDefaultConfig (rtwdog_config_t *config)
 Initializes the RTWDOG configuration structure.
 
 AT_QUICKACCESS_SECTION_CODE (void RTWDOG_Init(RTWDOG_Type *base, const rtwdog_config_t *config))
 Initializes the RTWDOG module.
 
void RTWDOG_Deinit (RTWDOG_Type *base)
 De-initializes the RTWDOG module.
 

RTWDOG functional Operation

void RTWDOG_ClearStatusFlags (RTWDOG_Type *base, uint32_t mask)
 Clears the RTWDOG flag.
 
__STATIC_FORCEINLINE void RTWDOG_Unlock (RTWDOG_Type *base)
 Unlocks the RTWDOG register written.
 

Unlock sequence

#define WDOG_FIRST_WORD_OF_UNLOCK   (RTWDOG_UPDATE_KEY & 0xFFFFU)
 
#define WDOG_SECOND_WORD_OF_UNLOCK   ((RTWDOG_UPDATE_KEY >> 16U) & 0xFFFFU)
 

Refresh sequence

#define WDOG_FIRST_WORD_OF_REFRESH   (RTWDOG_REFRESH_KEY & 0xFFFFU)
 
#define WDOG_SECOND_WORD_OF_REFRESH   ((RTWDOG_REFRESH_KEY >> 16U) & 0xFFFFU)
 

Detailed Description

Macro Definition Documentation

◆ WDOG_FIRST_WORD_OF_REFRESH

#define WDOG_FIRST_WORD_OF_REFRESH   (RTWDOG_REFRESH_KEY & 0xFFFFU)

First word of refresh sequence

◆ WDOG_FIRST_WORD_OF_UNLOCK

#define WDOG_FIRST_WORD_OF_UNLOCK   (RTWDOG_UPDATE_KEY & 0xFFFFU)

First word of unlock sequence

◆ WDOG_SECOND_WORD_OF_REFRESH

#define WDOG_SECOND_WORD_OF_REFRESH   ((RTWDOG_REFRESH_KEY >> 16U) & 0xFFFFU)

Second word of refresh sequence

◆ WDOG_SECOND_WORD_OF_UNLOCK

#define WDOG_SECOND_WORD_OF_UNLOCK   ((RTWDOG_UPDATE_KEY >> 16U) & 0xFFFFU)

Second word of unlock sequence

Enumeration Type Documentation

◆ _rtwdog_clock_prescaler

Describes the selection of the clock prescaler.

Enumerator
kRTWDOG_ClockPrescalerDivide1 

Divided by 1

kRTWDOG_ClockPrescalerDivide256 

Divided by 256

◆ _rtwdog_clock_source

Describes RTWDOG clock source.

Enumerator
kRTWDOG_ClockSource0 

Clock source 0

kRTWDOG_ClockSource1 

Clock source 1

kRTWDOG_ClockSource2 

Clock source 2

kRTWDOG_ClockSource3 

Clock source 3

◆ _rtwdog_interrupt_enable_t

RTWDOG interrupt configuration structure.

This structure contains the settings for all of the RTWDOG interrupt configurations.

Enumerator
kRTWDOG_InterruptEnable 

Interrupt is generated before forcing a reset

◆ _rtwdog_status_flags_t

RTWDOG status flags.

This structure contains the RTWDOG status flags for use in the RTWDOG functions.

Enumerator
kRTWDOG_RunningFlag 

Running flag, set when RTWDOG is enabled

kRTWDOG_InterruptFlag 

Interrupt flag, set when interrupt occurs

◆ _rtwdog_test_mode

Describes RTWDOG test mode.

Enumerator
kRTWDOG_TestModeDisabled 

Test Mode disabled

kRTWDOG_UserModeEnabled 

User Mode enabled

kRTWDOG_LowByteTest 

Test Mode enabled, only low byte is used

kRTWDOG_HighByteTest 

Test Mode enabled, only high byte is used

Function Documentation

◆ AT_QUICKACCESS_SECTION_CODE()

AT_QUICKACCESS_SECTION_CODE ( void   RTWDOG_InitRTWDOG_Type *base, const rtwdog_config_t *config)

Initializes the RTWDOG module.

This function initializes the RTWDOG. To reconfigure the RTWDOG without forcing a reset first, enableUpdate must be set to true in the configuration.

Example:

config.timeoutValue = 0x7ffU;
config.enableUpdate = true;
RTWDOG_Init(wdog_base,&config);
void RTWDOG_GetDefaultConfig(rtwdog_config_t *config)
Initializes the RTWDOG configuration structure.
Definition: fsl_rtwdog.c:65
Describes RTWDOG configuration structure.
Definition: fsl_rtwdog.h:73
Definition: deflate.c:114
Parameters
baseRTWDOG peripheral base address.
configThe configuration of the RTWDOG.

◆ RTWDOG_ClearStatusFlags()

void RTWDOG_ClearStatusFlags ( RTWDOG_Type base,
uint32_t  mask 
)

Clears the RTWDOG flag.

This function clears the RTWDOG status flag.

Example to clear an interrupt flag:

void RTWDOG_ClearStatusFlags(RTWDOG_Type *base, uint32_t mask)
Clears the RTWDOG flag.
Definition: fsl_rtwdog.c:34
@ kRTWDOG_InterruptFlag
Definition: fsl_rtwdog.h:104
Parameters
baseRTWDOG peripheral base address.
maskThe status flags to clear. The parameter can be any combination of the following values:
  • kRTWDOG_InterruptFlag
brief Clears the RTWDOG flag.

This function clears the RTWDOG status flag.

Example to clear an interrupt flag: code RTWDOG_ClearStatusFlags(wdog_base,kRTWDOG_InterruptFlag); endcode param base RTWDOG peripheral base address. param mask The status flags to clear. The parameter can be any combination of the following values: arg kRTWDOG_InterruptFlag

◆ RTWDOG_Deinit()

void RTWDOG_Deinit ( RTWDOG_Type base)

De-initializes the RTWDOG module.

This function shuts down the RTWDOG. Ensure that the WDOG_CS.UPDATE is 1, which means that the register update is enabled.

Parameters
baseRTWDOG peripheral base address.

brief De-initializes the RTWDOG module.

This function shuts down the RTWDOG. Ensure that the WDOG_CS.UPDATE is 1, which means that the register update is enabled.

param base RTWDOG peripheral base address.

◆ RTWDOG_GetDefaultConfig()

void RTWDOG_GetDefaultConfig ( rtwdog_config_t config)

Initializes the RTWDOG configuration structure.

This function initializes the RTWDOG configuration structure to default values. The default values are:

rtwdogConfig->enableRtwdog = true;
rtwdogConfig->clockSource = kRTWDOG_ClockSource1;
rtwdogConfig->prescaler = kRTWDOG_ClockPrescalerDivide1;
rtwdogConfig->workMode.enableWait = true;
rtwdogConfig->workMode.enableStop = false;
rtwdogConfig->workMode.enableDebug = false;
rtwdogConfig->testMode = kRTWDOG_TestModeDisabled;
rtwdogConfig->enableUpdate = true;
rtwdogConfig->enableInterrupt = false;
rtwdogConfig->enableWindowMode = false;
rtwdogConfig->windowValue = 0U;
rtwdogConfig->timeoutValue = 0xFFFFU;
@ kRTWDOG_TestModeDisabled
Definition: fsl_rtwdog.h:65
@ kRTWDOG_ClockPrescalerDivide1
Definition: fsl_rtwdog.h:50
@ kRTWDOG_ClockSource1
Definition: fsl_rtwdog.h:42
Parameters
configPointer to the RTWDOG configuration structure.
See also
rtwdog_config_t

brief Initializes the RTWDOG configuration structure.

This function initializes the RTWDOG configuration structure to default values. The default values are: code rtwdogConfig->enableRtwdog = true; rtwdogConfig->clockSource = kRTWDOG_ClockSource1; rtwdogConfig->prescaler = kRTWDOG_ClockPrescalerDivide1; rtwdogConfig->workMode.enableWait = true; rtwdogConfig->workMode.enableStop = false; rtwdogConfig->workMode.enableDebug = false; rtwdogConfig->testMode = kRTWDOG_TestModeDisabled; rtwdogConfig->enableUpdate = true; rtwdogConfig->enableInterrupt = false; rtwdogConfig->enableWindowMode = false; rtwdogConfig->windowValue = 0U; rtwdogConfig->timeoutValue = 0xFFFFU; endcode

param config Pointer to the RTWDOG configuration structure. see rtwdog_config_t

◆ RTWDOG_Unlock()

__STATIC_FORCEINLINE void RTWDOG_Unlock ( RTWDOG_Type base)

Unlocks the RTWDOG register written.

This function unlocks the RTWDOG register written.

Before starting the unlock sequence and following the configuration, disable the global interrupts. Otherwise, an interrupt could effectively invalidate the unlock sequence and the WCT may expire. After the configuration finishes, re-enable the global interrupts.

Parameters
baseRTWDOG peripheral base address

Variable Documentation

◆ clockSource

rtwdog_clock_source_t _rtwdog_config::clockSource

Clock source select

◆ enableDebug

bool _rtwdog_work_mode::enableDebug

Enables or disables RTWDOG in debug mode

◆ enableInterrupt

bool _rtwdog_config::enableInterrupt

Enables or disables RTWDOG interrupt

◆ enableRtwdog

bool _rtwdog_config::enableRtwdog

Enables or disables RTWDOG

◆ enableStop

bool _rtwdog_work_mode::enableStop

Enables or disables RTWDOG in stop mode

◆ enableUpdate

bool _rtwdog_config::enableUpdate

Update write-once register enable

◆ enableWait

bool _rtwdog_work_mode::enableWait

Enables or disables RTWDOG in wait mode

◆ enableWindowMode

bool _rtwdog_config::enableWindowMode

Enables or disables RTWDOG window mode

◆ prescaler

rtwdog_clock_prescaler_t _rtwdog_config::prescaler

Clock prescaler value

◆ testMode

rtwdog_test_mode_t _rtwdog_config::testMode

Configures RTWDOG test mode

◆ timeoutValue

uint16_t _rtwdog_config::timeoutValue

Timeout value

◆ windowValue

uint16_t _rtwdog_config::windowValue

Window value

◆ workMode

rtwdog_work_mode_t _rtwdog_config::workMode

Configures RTWDOG work mode in debug stop and wait mode