53 #ifndef ti_dl_dl_wwdt__include 54 #define ti_dl_dl_wwdt__include 59 #include <ti/devices/msp/msp.h> 61 #ifdef __MSPM0_HAS_WWDT__ 208 DL_WWDT_SLEEP_MODE sleepMode, DL_WWDT_WINDOW_PERIOD window0ClosedPeriod,
209 DL_WWDT_WINDOW_PERIOD window1ClosedPeriod)
214 (WWDT_WWDTCTL0_KEY_UNLOCK_W | (uint32_t) divider | (uint32_t) period |
215 (uint32_t) sleepMode | (uint32_t) window0ClosedPeriod |
216 ((uint32_t) window1ClosedPeriod << 4));
242 DL_WWDT_SLEEP_MODE sleepMode)
245 (WWDT_WWDTCTL0_KEY_UNLOCK_W | (uint32_t) divider | (uint32_t) period |
246 (uint32_t) sleepMode | WWDT_WWDTCTL0_MODE_INTERVAL);
260 wwdt->GPRCM.PWREN = (WWDT_PWREN_KEY_UNLOCK_W | WWDT_PWREN_ENABLE_ENABLE);
275 wwdt->GPRCM.PWREN = (WWDT_PWREN_KEY_UNLOCK_W | WWDT_PWREN_ENABLE_DISABLE);
296 return ((wwdt->GPRCM.PWREN & WWDT_PWREN_ENABLE_MASK) ==
297 WWDT_PWREN_ENABLE_ENABLE);
308 (WWDT_RSTCTL_KEY_UNLOCK_W | WWDT_RSTCTL_RESETSTKYCLR_CLR |
309 WWDT_RSTCTL_RESETASSERT_ASSERT);
323 return ((wwdt->GPRCM.STAT & WWDT_STAT_RESETSTKY_MASK) ==
324 WWDT_STAT_RESETSTKY_RESET);
339 wwdt->WWDTCNTRST = 0x00A7;
354 return (wwdt->WWDTSTAT == WWDT_WWDTSTAT_RUN_ON);
370 WWDT_Regs *wwdt, DL_WWDT_WINDOW window)
372 wwdt->WWDTCTL1 = (WWDT_WWDTCTL1_KEY_UNLOCK_W | (uint32_t) window);
386 uint32_t window = (wwdt->WWDTCTL1 & WWDT_WWDTCTL1_WINSEL_MASK);
388 return (DL_WWDT_WINDOW)(window);
402 uint32_t mode = (wwdt->WWDTCTL0 & WWDT_WWDTCTL0_STISM_MASK);
404 return (DL_WWDT_SLEEP_MODE)(mode);
418 uint32_t mode = (wwdt->WWDTCTL0 & WWDT_WWDTCTL0_MODE_MASK);
420 return (DL_WWDT_MODE)(mode);
435 WWDT_Regs *wwdt, DL_WWDT_WINDOW window)
440 period = (wwdt->WWDTCTL0 & WWDT_WWDTCTL0_WINDOW0_MASK);
442 period = ((wwdt->WWDTCTL0 & WWDT_WWDTCTL0_WINDOW1_MASK) >> 4);
445 return (DL_WWDT_WINDOW_PERIOD)(period);
459 uint32_t period = (wwdt->WWDTCTL0 & WWDT_WWDTCTL0_PER_MASK);
461 return (DL_WWDT_TIMER_PERIOD)(period);
475 uint32_t clockDivider = (wwdt->WWDTCTL0 & WWDT_WWDTCTL0_CLKDIV_MASK);
487 wwdt->CPU_INT.IMASK = WWDT_IMASK_INTTIM_SET;
497 wwdt->CPU_INT.IMASK = WWDT_IMASK_INTTIM_CLR;
512 return ((wwdt->CPU_INT.IMASK & WWDT_IMASK_INTTIM_SET) ==
513 WWDT_IMASK_INTTIM_SET);
532 return ((wwdt->CPU_INT.MIS & WWDT_MIS_INTTIM_SET) == WWDT_MIS_INTTIM_SET);
550 return (wwdt->CPU_INT.RIS & WWDT_RIS_INTTIM_SET);
567 return (DL_WWDT_IIDX)(wwdt->CPU_INT.IIDX);
577 wwdt->CPU_INT.ICLR = WWDT_ICLR_INTTIM_CLR;
589 WWDT_Regs *wwdt, DL_WWDT_CORE_HALT haltMode)
591 wwdt->PDBGCTL = (uint32_t) haltMode;
605 uint32_t haltMode = (wwdt->PDBGCTL & WWDT_PDBGCTL_FREE_MASK);
606 return (DL_WWDT_CORE_HALT) haltMode;
Definition: dl_wwdt.h:126
__STATIC_INLINE void DL_WWDT_disablePower(WWDT_Regs *wwdt)
Disables the Peripheral Write Enable (PWREN) register for the WWDT.
Definition: dl_wwdt.h:273
__STATIC_INLINE bool DL_WWDT_getEnabledInterruptStatus(WWDT_Regs *wwdt)
Check interrupt flag of enabled WWDT interrupt.
Definition: dl_wwdt.h:530
__STATIC_INLINE bool DL_WWDT_isInterruptEnabled(WWDT_Regs *wwdt)
Check if WWDT interrupt is enabled.
Definition: dl_wwdt.h:510
Definition: dl_wwdt.h:108
DL_WWDT_WINDOW_PERIOD
Definition: dl_wwdt.h:98
DL_WWDT_MODE
Definition: dl_wwdt.h:146
Definition: dl_wwdt.h:150
Definition: dl_wwdt.h:130
__STATIC_INLINE void DL_WWDT_initWatchdogMode(WWDT_Regs *wwdt, DL_WWDT_CLOCK_DIVIDE divider, DL_WWDT_TIMER_PERIOD period, DL_WWDT_SLEEP_MODE sleepMode, DL_WWDT_WINDOW_PERIOD window0ClosedPeriod, DL_WWDT_WINDOW_PERIOD window1ClosedPeriod)
Initializes the Window Watchdog Timer in watchdog mode.
Definition: dl_wwdt.h:206
__STATIC_INLINE void DL_WWDT_setActiveWindow(WWDT_Regs *wwdt, DL_WWDT_WINDOW window)
Set the active window being used.
Definition: dl_wwdt.h:369
__STATIC_INLINE DL_WWDT_TIMER_PERIOD DL_WWDT_getTimerPeriod(WWDT_Regs *wwdt)
Get the timer period for the watchdog.
Definition: dl_wwdt.h:457
DL_WWDT_IIDX
Definition: dl_wwdt.h:154
__STATIC_INLINE void DL_WWDT_initIntervalTimerMode(WWDT_Regs *wwdt, DL_WWDT_CLOCK_DIVIDE divider, DL_WWDT_TIMER_PERIOD period, DL_WWDT_SLEEP_MODE sleepMode)
Initializes the Window Watchdog Timer in interval timer mode.
Definition: dl_wwdt.h:240
__STATIC_INLINE void DL_WWDT_enableInterrupt(WWDT_Regs *wwdt)
Enable WWDT interrupt.
Definition: dl_wwdt.h:485
Definition: dl_wwdt.h:132
Definition: dl_wwdt.h:114
__STATIC_INLINE void DL_WWDT_enablePower(WWDT_Regs *wwdt)
Enables the Peripheral Write Enable (PWREN) register for the WWDT.
Definition: dl_wwdt.h:258
Definition: dl_wwdt.h:158
__STATIC_INLINE DL_WWDT_WINDOW_PERIOD DL_WWDT_getWindowPeriod(WWDT_Regs *wwdt, DL_WWDT_WINDOW window)
Get the window closed percentage for a watchdog window.
Definition: dl_wwdt.h:434
__STATIC_INLINE bool DL_WWDT_isPowerEnabled(WWDT_Regs *wwdt)
Returns if the Peripheral Write Enable (PWREN) register for the WWDT is enabled.
Definition: dl_wwdt.h:294
Definition: dl_wwdt.h:122
DL_WWDT_SLEEP_MODE
Definition: dl_wwdt.h:138
__STATIC_INLINE uint32_t DL_WWDT_getRawInterruptStatus(WWDT_Regs *wwdt)
Check interrupt flag of any WWDT interrupt.
Definition: dl_wwdt.h:548
__STATIC_INLINE bool DL_WWDT_isRunning(WWDT_Regs *wwdt)
Checks if the Window Watchdog Timer is actively running.
Definition: dl_wwdt.h:352
__STATIC_INLINE DL_WWDT_IIDX DL_WWDT_getPendingInterrupt(WWDT_Regs *wwdt)
Get highest priority pending WWDT interrupt.
Definition: dl_wwdt.h:565
__STATIC_INLINE bool DL_WWDT_isReset(WWDT_Regs *wwdt)
Returns if wwdt peripheral was reset.
Definition: dl_wwdt.h:321
Definition: dl_wwdt.h:140
__STATIC_INLINE void DL_WWDT_reset(WWDT_Regs *wwdt)
Resets wwdt peripheral.
Definition: dl_wwdt.h:305
__STATIC_INLINE void DL_WWDT_setCoreHaltBehavior(WWDT_Regs *wwdt, DL_WWDT_CORE_HALT haltMode)
Configures WWDT behavior when the core is halted.
Definition: dl_wwdt.h:588
Definition: dl_wwdt.h:124
Definition: dl_wwdt.h:134
__STATIC_INLINE DL_WWDT_SLEEP_MODE DL_WWDT_getSleepMode(WWDT_Regs *wwdt)
Get the sleep mode being used.
Definition: dl_wwdt.h:400
DL_WWDT_WINDOW
Definition: dl_wwdt.h:90
__STATIC_INLINE DL_WWDT_CLOCK_DIVIDE DL_WWDT_getClockDivider(WWDT_Regs *wwdt)
Get the clock divider for the watchdog.
Definition: dl_wwdt.h:473
Definition: dl_wwdt.h:104
Definition: dl_wwdt.h:166
__STATIC_INLINE DL_WWDT_WINDOW DL_WWDT_getActiveWindow(WWDT_Regs *wwdt)
Get the active window being used.
Definition: dl_wwdt.h:384
Definition: dl_wwdt.h:106
Definition: dl_wwdt.h:120
Definition: dl_wwdt.h:112
__STATIC_INLINE void DL_WWDT_restart(WWDT_Regs *wwdt)
Restarts the Window Watchdog.
Definition: dl_wwdt.h:337
Definition: dl_wwdt.h:164
__STATIC_INLINE void DL_WWDT_clearInterruptStatus(WWDT_Regs *wwdt)
Clear pending WWDT interrupt.
Definition: dl_wwdt.h:575
Definition: dl_wwdt.h:128
Definition: dl_wwdt.h:100
DL_WWDT_CORE_HALT
Definition: dl_wwdt.h:162
Definition: dl_wwdt.h:156
__STATIC_INLINE DL_WWDT_MODE DL_WWDT_getMode(WWDT_Regs *wwdt)
Get the mode the watchdog is running in.
Definition: dl_wwdt.h:416
__STATIC_INLINE void DL_WWDT_disableInterrupt(WWDT_Regs *wwdt)
Disable WWDT interrupt.
Definition: dl_wwdt.h:495
DL_WWDT_TIMER_PERIOD
Definition: dl_wwdt.h:118
DL_WWDT_CLOCK_DIVIDE
Definition: dl_wwdt.h:70
Definition: dl_wwdt.h:142
Definition: dl_wwdt.h:110
__STATIC_INLINE DL_WWDT_CORE_HALT DL_WWDT_getCoreHaltBehavior(WWDT_Regs *wwdt)
Get WWDT behavior when the core is halted.
Definition: dl_wwdt.h:603
Definition: dl_wwdt.h:102
Definition: dl_wwdt.h:148