RTEMS 6.1-rc6
|
Data Structures | |
struct | _rtwdog_work_mode |
Defines RTWDOG work mode. More... | |
struct | _rtwdog_config |
Describes RTWDOG configuration structure. More... | |
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) |
#define WDOG_FIRST_WORD_OF_REFRESH (RTWDOG_REFRESH_KEY & 0xFFFFU) |
First word of refresh sequence
#define WDOG_FIRST_WORD_OF_UNLOCK (RTWDOG_UPDATE_KEY & 0xFFFFU) |
First word of unlock sequence
#define WDOG_SECOND_WORD_OF_REFRESH ((RTWDOG_REFRESH_KEY >> 16U) & 0xFFFFU) |
Second word of refresh sequence
#define WDOG_SECOND_WORD_OF_UNLOCK ((RTWDOG_UPDATE_KEY >> 16U) & 0xFFFFU) |
Second word of unlock sequence
enum _rtwdog_clock_source |
enum _rtwdog_test_mode |
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:
base | RTWDOG peripheral base address. |
config | The configuration of the RTWDOG. |
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:
base | RTWDOG peripheral base address. |
mask | The status flags to clear. The parameter can be any combination of the following values:
|
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
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.
base | RTWDOG 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.
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:
config | Pointer to the RTWDOG configuration structure. |
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
__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.
base | RTWDOG peripheral base address |
rtwdog_clock_source_t _rtwdog_config::clockSource |
Clock source select
bool _rtwdog_work_mode::enableDebug |
Enables or disables RTWDOG in debug mode
bool _rtwdog_config::enableInterrupt |
Enables or disables RTWDOG interrupt
bool _rtwdog_config::enableRtwdog |
Enables or disables RTWDOG
bool _rtwdog_work_mode::enableStop |
Enables or disables RTWDOG in stop mode
bool _rtwdog_config::enableUpdate |
Update write-once register enable
bool _rtwdog_work_mode::enableWait |
Enables or disables RTWDOG in wait mode
bool _rtwdog_config::enableWindowMode |
Enables or disables RTWDOG window mode
rtwdog_clock_prescaler_t _rtwdog_config::prescaler |
Clock prescaler value
rtwdog_test_mode_t _rtwdog_config::testMode |
Configures RTWDOG test mode
uint16_t _rtwdog_config::timeoutValue |
Timeout value
uint16_t _rtwdog_config::windowValue |
Window value
rtwdog_work_mode_t _rtwdog_config::workMode |
Configures RTWDOG work mode in debug stop and wait mode