MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
WDT: Watchdog Timer

Overview

The MCUXpresso SDK provides a peripheral driver for the Watchdog Timer module of MCUXpresso SDK devices.

Typical use case

Example use of WDT API. Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/wdt

Macros

#define FSL_WDT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 Defines WDT driver version 2.0.0. More...
 

Functions

void WDT_StartTimer (TIMERS_Type *base, uint32_t timeoutCount)
 start wdt timer. More...
 
void WDT_StopTimer (TIMERS_Type *base)
 stop wdt timer. More...
 
static void WDT_SetInterruptThreshold (TIMERS_Type *base, uint32_t threshold)
 Sets the WDT triggerthreshold. More...
 
static void WDT_SetTimeoutStatus (TIMERS_Type *base)
 This function force sets the timeout status flag, even when WDT counter does not reach threshold. More...
 
static void WDT_ClearTimeoutStatus (TIMERS_Type *base)
 Timer clear timeout status. More...
 
static bool WDT_GetTimeoutStatus (TIMERS_Type *base)
 WDT timeout status enable/disable. More...
 
static uint32_t WDT_GetRemainCount (TIMERS_Type *base)
 WDT get wdt remain count. More...
 
static void WDT_Feed (TIMERS_Type *base)
 Feed WDT timer. More...
 

Macro Definition Documentation

#define FSL_WDT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Function Documentation

void WDT_StartTimer ( TIMERS_Type *  base,
uint32_t  timeoutCount 
)
Parameters
basewdt base pointer.
timeoutCountthe initial timeout count of the timer. The total timeout time is determined by (1 / timerCountingFreq_Hz) * timeoutCount.The maximum timeoutCount is 0x000FFFFF.
void WDT_StopTimer ( TIMERS_Type *  base)
Parameters
basetimer base pointer.
static void WDT_SetInterruptThreshold ( TIMERS_Type *  base,
uint32_t  threshold 
)
inlinestatic

The Watchdog timer includes a "timeout pre-emption" feature whereby the non-maskable interrupt output intreq_wdg_o is asserted high when the counter reaches the value specified in field WDOG_INT_THRESHOLD defined in register TIMERS_WDOG_TRIGGER_INT_REG.

Parameters
baseWDT peripheral base address
thresholdWDT triggerthreshold value.
static void WDT_SetTimeoutStatus ( TIMERS_Type *  base)
inlinestatic
Parameters
basetimer base pointer.
static void WDT_ClearTimeoutStatus ( TIMERS_Type *  base)
inlinestatic
Parameters
basetimer base pointer.
timerthe specific timer to be stop.
static bool WDT_GetTimeoutStatus ( TIMERS_Type *  base)
inlinestatic
Parameters
basetimer base pointer.
Return values
trueis the timer timeout, false is the timeout still not timeout.
static uint32_t WDT_GetRemainCount ( TIMERS_Type *  base)
inlinestatic
Parameters
basetimer base pointer.
static void WDT_Feed ( TIMERS_Type *  base)
inlinestatic

This is a mandatory step, if this function isn't called after enabling the WDT, WDT will ignore timeout errors and will not generate a WDT interrupt or reset the chip.

Parameters
baseWDT peripheral base address