EE445M RTOS
Taken at the University of Texas Spring 2015
Watchdog_api

Functions

bool WatchdogRunning (uint32_t ui32Base)
 
void WatchdogEnable (uint32_t ui32Base)
 
void WatchdogResetEnable (uint32_t ui32Base)
 
void WatchdogResetDisable (uint32_t ui32Base)
 
void WatchdogLock (uint32_t ui32Base)
 
void WatchdogUnlock (uint32_t ui32Base)
 
bool WatchdogLockState (uint32_t ui32Base)
 
void WatchdogReloadSet (uint32_t ui32Base, uint32_t ui32LoadVal)
 
uint32_t WatchdogReloadGet (uint32_t ui32Base)
 
uint32_t WatchdogValueGet (uint32_t ui32Base)
 
void WatchdogIntRegister (uint32_t ui32Base, void(*pfnHandler)(void))
 
void WatchdogIntUnregister (uint32_t ui32Base)
 
void WatchdogIntEnable (uint32_t ui32Base)
 
uint32_t WatchdogIntStatus (uint32_t ui32Base, bool bMasked)
 
void WatchdogIntClear (uint32_t ui32Base)
 
void WatchdogIntTypeSet (uint32_t ui32Base, uint32_t ui32Type)
 
void WatchdogStallEnable (uint32_t ui32Base)
 
void WatchdogStallDisable (uint32_t ui32Base)
 

Detailed Description

Function Documentation

void WatchdogEnable ( uint32_t  ui32Base)

Enables the watchdog timer.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function enables the watchdog timer counter and interrupt.

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 97 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_CTL_INTEN, and WDT_O_CTL.

98 {
99  //
100  // Check the arguments.
101  //
102  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
103 
104  //
105  // Enable the watchdog timer module.
106  //
107  HWREG(ui32Base + WDT_O_CTL) |= WDT_CTL_INTEN;
108 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_CTL_INTEN
Definition: hw_watchdog.h:81
#define WDT_O_CTL
Definition: hw_watchdog.h:50
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogIntClear ( uint32_t  ui32Base)

Clears the watchdog timer interrupt.

Parameters
ui32Baseis the base address of the watchdog timer module.

The watchdog timer interrupt source is cleared, so that it no longer asserts.

Note
Because there is a write buffer in the Cortex-M processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted). This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 501 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_O_ICR, and WDT_RIS_WDTRIS.

502 {
503  //
504  // Check the arguments.
505  //
506  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
507 
508  //
509  // Clear the interrupt source.
510  //
511  HWREG(ui32Base + WDT_O_ICR) = WDT_RIS_WDTRIS;
512 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_O_ICR
Definition: hw_watchdog.h:51
#define WDT_RIS_WDTRIS
Definition: hw_watchdog.h:96
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogIntEnable ( uint32_t  ui32Base)

Enables the watchdog timer interrupt.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function enables the watchdog timer interrupt.

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 427 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_CTL_INTEN, and WDT_O_CTL.

428 {
429  //
430  // Check the arguments.
431  //
432  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
433 
434  //
435  // Enable the watchdog interrupt.
436  //
437  HWREG(ui32Base + WDT_O_CTL) |= WDT_CTL_INTEN;
438 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_CTL_INTEN
Definition: hw_watchdog.h:81
#define WDT_O_CTL
Definition: hw_watchdog.h:50
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogIntRegister ( uint32_t  ui32Base,
void(*)(void)  pfnHandler 
)

Registers an interrupt handler for the watchdog timer interrupt.

Parameters
ui32Baseis the base address of the watchdog timer module.
pfnHandleris a pointer to the function to be called when the watchdog timer interrupt occurs.

This function does the actual registering of the interrupt handler. This function also enables the global interrupt in the interrupt controller; the watchdog timer interrupt must be enabled via WatchdogEnable(). It is the interrupt handler's responsibility to clear the interrupt source via WatchdogIntClear().

See also
IntRegister() for important information about registering interrupt handlers.
Note
For parts with a watchdog timer module that has the ability to generate an NMI instead of a standard interrupt, this function registers the standard watchdog interrupt handler. To register the NMI watchdog handler, use IntRegister() to register the handler for the FAULT_NMI interrupt.
Returns
None.

Definition at line 353 of file watchdog.c.

References ASSERT, INT_WATCHDOG_TM4C123, IntEnable(), IntRegister(), WATCHDOG0_BASE, and WATCHDOG1_BASE.

354 {
355  //
356  // Check the arguments.
357  //
358  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
359 
360  //
361  // Register the interrupt handler.
362  //
363  IntRegister(INT_WATCHDOG_TM4C123, pfnHandler);
364 
365  //
366  // Enable the watchdog timer interrupt.
367  //
369 }
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define INT_WATCHDOG_TM4C123
Definition: hw_ints.h:82
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Definition: interrupt.c:309
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void IntEnable(uint32_t ui32Interrupt)
Definition: interrupt.c:610

Here is the call graph for this function:

uint32_t WatchdogIntStatus ( uint32_t  ui32Base,
bool  bMasked 
)

Gets the current watchdog timer interrupt status.

Parameters
ui32Baseis the base address of the watchdog timer module.
bMaskedis false if the raw interrupt status is required and true if the masked interrupt status is required.

This function returns the interrupt status for the watchdog timer module. Either the raw interrupt status or the status of interrupt that is allowed to reflect to the processor can be returned.

Returns
Returns the current interrupt status, where a 1 indicates that the watchdog interrupt is active, and a 0 indicates that it is not active.

Definition at line 457 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_O_MIS, and WDT_O_RIS.

458 {
459  //
460  // Check the arguments.
461  //
462  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
463 
464  //
465  // Return either the interrupt status or the raw interrupt status as
466  // requested.
467  //
468  if(bMasked)
469  {
470  return(HWREG(ui32Base + WDT_O_MIS));
471  }
472  else
473  {
474  return(HWREG(ui32Base + WDT_O_RIS));
475  }
476 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define WDT_O_RIS
Definition: hw_watchdog.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_O_MIS
Definition: hw_watchdog.h:53
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogIntTypeSet ( uint32_t  ui32Base,
uint32_t  ui32Type 
)

Sets the type of interrupt generated by the watchdog.

Parameters
ui32Baseis the base address of the watchdog timer module.
ui32Typeis the type of interrupt to generate.

This function sets the type of interrupt that is generated if the watchdog timer expires. ui32Type can be either WATCHDOG_INT_TYPE_INT to generate a standard interrupt (the default) or WATCHDOG_INT_TYPE_NMI to generate a non-maskable interrupt (NMI).

When configured to generate an NMI, the watchdog interrupt must still be enabled with WatchdogIntEnable(), and it must still be cleared inside the NMI handler with WatchdogIntClear().

Note
The ability to select an NMI interrupt varies with the Tiva part in use. Please consult the datasheet for the part you are using to determine whether this support is available. This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 539 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WATCHDOG_INT_TYPE_INT, WATCHDOG_INT_TYPE_NMI, WDT_CTL_INTTYPE, and WDT_O_CTL.

540 {
541  //
542  // Check the arguments.
543  //
544  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
545  ASSERT((ui32Type == WATCHDOG_INT_TYPE_INT) ||
546  (ui32Type == WATCHDOG_INT_TYPE_NMI));
547 
548  //
549  // Set the interrupt type.
550  //
551  HWREG(ui32Base + WDT_O_CTL) = (HWREG(ui32Base + WDT_O_CTL) &
552  ~WDT_CTL_INTTYPE) | ui32Type;
553 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WATCHDOG_INT_TYPE_INT
Definition: watchdog.h:59
#define WDT_CTL_INTTYPE
Definition: hw_watchdog.h:79
#define WDT_O_CTL
Definition: hw_watchdog.h:50
#define WATCHDOG_INT_TYPE_NMI
Definition: watchdog.h:60
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogIntUnregister ( uint32_t  ui32Base)

Unregisters an interrupt handler for the watchdog timer interrupt.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function does the actual unregistering of the interrupt handler. This function clears the handler to be called when a watchdog timer interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

See also
IntRegister() for important information about registering interrupt handlers.
Note
For parts with a watchdog timer module that has the ability to generate an NMI instead of a standard interrupt, this function unregisters the standard watchdog interrupt handler. To unregister the NMI watchdog handler, use IntUnregister() to unregister the handler for the FAULT_NMI interrupt.
Returns
None.

Definition at line 395 of file watchdog.c.

References ASSERT, INT_WATCHDOG_TM4C123, IntDisable(), IntUnregister(), WATCHDOG0_BASE, and WATCHDOG1_BASE.

396 {
397  //
398  // Check the arguments.
399  //
400  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
401 
402  //
403  // Disable the interrupt.
404  //
406 
407  //
408  // Unregister the interrupt handler.
409  //
411 }
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define INT_WATCHDOG_TM4C123
Definition: hw_ints.h:82
void IntUnregister(uint32_t ui32Interrupt)
Definition: interrupt.c:381
void IntDisable(uint32_t ui32Interrupt)
Definition: interrupt.c:684
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51

Here is the call graph for this function:

void WatchdogLock ( uint32_t  ui32Base)

Enables the watchdog timer lock mechanism.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function locks out write access to the watchdog timer registers.

Returns
None.

Definition at line 178 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_LOCK_LOCKED, and WDT_O_LOCK.

179 {
180  //
181  // Check the arguments.
182  //
183  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
184 
185  //
186  // Lock out watchdog register writes. Writing anything to the WDT_O_LOCK
187  // register causes the lock to go into effect.
188  //
189  HWREG(ui32Base + WDT_O_LOCK) = WDT_LOCK_LOCKED;
190 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_LOCK_LOCKED
Definition: hw_watchdog.h:119
#define WDT_O_LOCK
Definition: hw_watchdog.h:55
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
bool WatchdogLockState ( uint32_t  ui32Base)

Gets the state of the watchdog timer lock mechanism.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function returns the lock state of the watchdog timer registers.

Returns
Returns true if the watchdog timer registers are locked, and false if they are not locked.

Definition at line 230 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_LOCK_LOCKED, and WDT_O_LOCK.

231 {
232  //
233  // Check the arguments.
234  //
235  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
236 
237  //
238  // Get the lock state.
239  //
240  return((HWREG(ui32Base + WDT_O_LOCK) == WDT_LOCK_LOCKED) ? true : false);
241 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_LOCK_LOCKED
Definition: hw_watchdog.h:119
#define WDT_O_LOCK
Definition: hw_watchdog.h:55
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
uint32_t WatchdogReloadGet ( uint32_t  ui32Base)

Gets the watchdog timer reload value.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function gets the value that is loaded into the watchdog timer when the count reaches zero for the first time.

Returns
None.

Definition at line 288 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, and WDT_O_LOAD.

289 {
290  //
291  // Check the arguments.
292  //
293  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
294 
295  //
296  // Get the load register.
297  //
298  return(HWREG(ui32Base + WDT_O_LOAD));
299 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
#define WDT_O_LOAD
Definition: hw_watchdog.h:48
void WatchdogReloadSet ( uint32_t  ui32Base,
uint32_t  ui32LoadVal 
)

Sets the watchdog timer reload value.

Parameters
ui32Baseis the base address of the watchdog timer module.
ui32LoadValis the load value for the watchdog timer.

This function configures the value to load into the watchdog timer when the count reaches zero for the first time; if the watchdog timer is running when this function is called, then the value is immediately loaded into the watchdog timer counter. If the ui32LoadVal parameter is 0, then an interrupt is immediately generated.

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 262 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, and WDT_O_LOAD.

263 {
264  //
265  // Check the arguments.
266  //
267  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
268 
269  //
270  // Set the load register.
271  //
272  HWREG(ui32Base + WDT_O_LOAD) = ui32LoadVal;
273 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
#define WDT_O_LOAD
Definition: hw_watchdog.h:48
void WatchdogResetDisable ( uint32_t  ui32Base)

Disables the watchdog timer reset.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function disables the capability of the watchdog timer to issue a reset to the processor after a second timeout condition.

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 153 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_CTL_RESEN, and WDT_O_CTL.

154 {
155  //
156  // Check the arguments.
157  //
158  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
159 
160  //
161  // Disable the watchdog reset.
162  //
163  HWREG(ui32Base + WDT_O_CTL) &= ~(WDT_CTL_RESEN);
164 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_CTL_RESEN
Definition: hw_watchdog.h:80
#define WDT_O_CTL
Definition: hw_watchdog.h:50
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogResetEnable ( uint32_t  ui32Base)

Enables the watchdog timer reset.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function enables the capability of the watchdog timer to issue a reset to the processor after a second timeout condition.

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 125 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_CTL_RESEN, and WDT_O_CTL.

126 {
127  //
128  // Check the arguments.
129  //
130  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
131 
132  //
133  // Enable the watchdog reset.
134  //
135  HWREG(ui32Base + WDT_O_CTL) |= WDT_CTL_RESEN;
136 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_CTL_RESEN
Definition: hw_watchdog.h:80
#define WDT_O_CTL
Definition: hw_watchdog.h:50
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
bool WatchdogRunning ( uint32_t  ui32Base)

Determines if the watchdog timer is enabled.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function checks to see if the watchdog timer is enabled.

Returns
Returns true if the watchdog timer is enabled and false if it is not.

Definition at line 70 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_CTL_INTEN, and WDT_O_CTL.

71 {
72  //
73  // Check the arguments.
74  //
75  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
76 
77  //
78  // See if the watchdog timer module is enabled, and return.
79  //
80  return(HWREG(ui32Base + WDT_O_CTL) & WDT_CTL_INTEN);
81 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_CTL_INTEN
Definition: hw_watchdog.h:81
#define WDT_O_CTL
Definition: hw_watchdog.h:50
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogStallDisable ( uint32_t  ui32Base)

Disables stalling of the watchdog timer during debug events.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function disables the debug mode stall of the watchdog timer. By doing so, the watchdog timer continues to count regardless of the processor debug state.

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 604 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_O_TEST, and WDT_TEST_STALL.

605 {
606  //
607  // Check the arguments.
608  //
609  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
610 
611  //
612  // Disable timer stalling.
613  //
614  HWREG(ui32Base + WDT_O_TEST) &= ~(WDT_TEST_STALL);
615 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_O_TEST
Definition: hw_watchdog.h:54
#define WDT_TEST_STALL
Definition: hw_watchdog.h:110
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogStallEnable ( uint32_t  ui32Base)

Enables stalling of the watchdog timer during debug events.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function allows the watchdog timer to stop counting when the processor is stopped by the debugger. By doing so, the watchdog is prevented from expiring (typically almost immediately from a human time perspective) and resetting the system (if reset is enabled). The watchdog instead expires after the appropriate number of processor cycles have been executed while debugging (or at the appropriate time after the processor has been restarted).

Note
This function has no effect if the watchdog timer has been locked.
Returns
None.

Definition at line 575 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_O_TEST, and WDT_TEST_STALL.

576 {
577  //
578  // Check the arguments.
579  //
580  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
581 
582  //
583  // Enable timer stalling.
584  //
585  HWREG(ui32Base + WDT_O_TEST) |= WDT_TEST_STALL;
586 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_O_TEST
Definition: hw_watchdog.h:54
#define WDT_TEST_STALL
Definition: hw_watchdog.h:110
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
void WatchdogUnlock ( uint32_t  ui32Base)

Disables the watchdog timer lock mechanism.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function enables write access to the watchdog timer registers.

Returns
None.

Definition at line 204 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, WDT_LOCK_UNLOCK, and WDT_O_LOCK.

205 {
206  //
207  // Check the arguments.
208  //
209  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
210 
211  //
212  // Unlock watchdog register writes.
213  //
214  HWREG(ui32Base + WDT_O_LOCK) = WDT_LOCK_UNLOCK;
215 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define WDT_LOCK_UNLOCK
Definition: hw_watchdog.h:120
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_O_LOCK
Definition: hw_watchdog.h:55
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51
uint32_t WatchdogValueGet ( uint32_t  ui32Base)

Gets the current watchdog timer value.

Parameters
ui32Baseis the base address of the watchdog timer module.

This function reads the current value of the watchdog timer.

Returns
Returns the current value of the watchdog timer.

Definition at line 313 of file watchdog.c.

References ASSERT, HWREG, WATCHDOG0_BASE, WATCHDOG1_BASE, and WDT_O_VALUE.

314 {
315  //
316  // Check the arguments.
317  //
318  ASSERT((ui32Base == WATCHDOG0_BASE) || (ui32Base == WATCHDOG1_BASE));
319 
320  //
321  // Get the current watchdog timer register value.
322  //
323  return(HWREG(ui32Base + WDT_O_VALUE));
324 }
#define HWREG(x)
Definition: hw_types.h:48
#define WATCHDOG1_BASE
Definition: hw_memmap.h:52
#define ASSERT(expr)
Definition: debug.h:67
#define WDT_O_VALUE
Definition: hw_watchdog.h:49
#define WATCHDOG0_BASE
Definition: hw_memmap.h:51