MSPM0G1X0X_G3X0X Driver Library  1.10.01.05
Enumerations | Functions
Window Watchdog Timer (WWDT)

Enumerations

enum  DL_WWDT_CLOCK_DIVIDE {
  DL_WWDT_CLOCK_DIVIDE_1 = 0x00000000,
  DL_WWDT_CLOCK_DIVIDE_2 = 0x00000001,
  DL_WWDT_CLOCK_DIVIDE_3 = 0x00000002,
  DL_WWDT_CLOCK_DIVIDE_4 = 0x00000003,
  DL_WWDT_CLOCK_DIVIDE_5 = 0x00000004,
  DL_WWDT_CLOCK_DIVIDE_6 = 0x00000005,
  DL_WWDT_CLOCK_DIVIDE_7 = 0x00000006,
  DL_WWDT_CLOCK_DIVIDE_8 = 0x00000007
}
 
enum  DL_WWDT_WINDOW {
  DL_WWDT_WINDOW0 = WWDT_WWDTCTL1_WINSEL_WIN0,
  DL_WWDT_WINDOW1 = WWDT_WWDTCTL1_WINSEL_WIN1
}
 
enum  DL_WWDT_WINDOW_PERIOD {
  DL_WWDT_WINDOW_PERIOD_0 = WWDT_WWDTCTL0_WINDOW0_SIZE_0,
  DL_WWDT_WINDOW_PERIOD_12 = WWDT_WWDTCTL0_WINDOW0_SIZE_12,
  DL_WWDT_WINDOW_PERIOD_18 = WWDT_WWDTCTL0_WINDOW0_SIZE_18,
  DL_WWDT_WINDOW_PERIOD_25 = WWDT_WWDTCTL0_WINDOW0_SIZE_25,
  DL_WWDT_WINDOW_PERIOD_50 = WWDT_WWDTCTL0_WINDOW0_SIZE_50,
  DL_WWDT_WINDOW_PERIOD_75 = WWDT_WWDTCTL0_WINDOW0_SIZE_75,
  DL_WWDT_WINDOW_PERIOD_81 = WWDT_WWDTCTL0_WINDOW0_SIZE_81,
  DL_WWDT_WINDOW_PERIOD_87 = WWDT_WWDTCTL0_WINDOW0_SIZE_87
}
 
enum  DL_WWDT_TIMER_PERIOD {
  DL_WWDT_TIMER_PERIOD_6_BITS = WWDT_WWDTCTL0_PER_EN_6,
  DL_WWDT_TIMER_PERIOD_8_BITS = WWDT_WWDTCTL0_PER_EN_8,
  DL_WWDT_TIMER_PERIOD_10_BITS = WWDT_WWDTCTL0_PER_EN_10,
  DL_WWDT_TIMER_PERIOD_12_BITS = WWDT_WWDTCTL0_PER_EN_12,
  DL_WWDT_TIMER_PERIOD_15_BITS = WWDT_WWDTCTL0_PER_EN_15,
  DL_WWDT_TIMER_PERIOD_18_BITS = WWDT_WWDTCTL0_PER_EN_18,
  DL_WWDT_TIMER_PERIOD_21_BITS = WWDT_WWDTCTL0_PER_EN_21,
  DL_WWDT_TIMER_PERIOD_25_BITS = WWDT_WWDTCTL0_PER_EN_25
}
 
enum  DL_WWDT_SLEEP_MODE {
  DL_WWDT_STOP_IN_SLEEP = WWDT_WWDTCTL0_STISM_STOP,
  DL_WWDT_RUN_IN_SLEEP = WWDT_WWDTCTL0_STISM_CONT
}
 
enum  DL_WWDT_MODE {
  DL_WWDT_WATCHDOG_MODE = 0x0,
  DL_WWDT_INTERVAL_TIMER_MODE = WWDT_WWDTCTL0_MODE_INTERVAL
}
 
enum  DL_WWDT_IIDX {
  DL_WWDT_IIDX_NO_INT = WWDT_IIDX_STAT_NO_INTR,
  DL_WWDT_IIDX_INTERVAL_TIMER = WWDT_IIDX_STAT_INTTIM
}
 

Functions

__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. More...
 
__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. More...
 
__STATIC_INLINE void DL_WWDT_enablePower (WWDT_Regs *wwdt)
 Enables power on WWDT module. More...
 
__STATIC_INLINE void DL_WWDT_disablePower (WWDT_Regs *wwdt)
 Disables power on wwdt module. More...
 
__STATIC_INLINE bool DL_WWDT_isPowerEnabled (WWDT_Regs *wwdt)
 Returns if power on wwdt module. More...
 
__STATIC_INLINE void DL_WWDT_reset (WWDT_Regs *wwdt)
 Resets wwdt peripheral. More...
 
__STATIC_INLINE bool DL_WWDT_isReset (WWDT_Regs *wwdt)
 Returns if wwdt peripheral was reset. More...
 
__STATIC_INLINE void DL_WWDT_restart (WWDT_Regs *wwdt)
 Restarts the Window Watchdog. More...
 
__STATIC_INLINE bool DL_WWDT_isRunning (WWDT_Regs *wwdt)
 Checks if the Window Watchdog Timer is actively running. More...
 
__STATIC_INLINE void DL_WWDT_setActiveWindow (WWDT_Regs *wwdt, DL_WWDT_WINDOW window)
 Set the active window being used. More...
 
__STATIC_INLINE DL_WWDT_WINDOW DL_WWDT_getActiveWindow (WWDT_Regs *wwdt)
 Get the active window being used. More...
 
__STATIC_INLINE DL_WWDT_SLEEP_MODE DL_WWDT_getSleepMode (WWDT_Regs *wwdt)
 Get the sleep mode being used. More...
 
__STATIC_INLINE DL_WWDT_MODE DL_WWDT_getMode (WWDT_Regs *wwdt)
 Get the mode the watchdog is running in. More...
 
__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. More...
 
__STATIC_INLINE DL_WWDT_TIMER_PERIOD DL_WWDT_getTimerPeriod (WWDT_Regs *wwdt)
 Get the timer period for the watchdog. More...
 
__STATIC_INLINE DL_WWDT_CLOCK_DIVIDE DL_WWDT_getClockDivider (WWDT_Regs *wwdt)
 Get the clock divider for the watchdog. More...
 
__STATIC_INLINE void DL_WWDT_enableInterrupt (WWDT_Regs *wwdt)
 Enable WWDT interrupt. More...
 
__STATIC_INLINE void DL_WWDT_disableInterrupt (WWDT_Regs *wwdt)
 Disable WWDT interrupt. More...
 
__STATIC_INLINE bool DL_WWDT_isInterruptEnabled (WWDT_Regs *wwdt)
 Check if WWDT interrupt is enabled. More...
 
__STATIC_INLINE bool DL_WWDT_getEnabledInterruptStatus (WWDT_Regs *wwdt)
 Check interrupt flag of enabled WWDT interrupt. More...
 
__STATIC_INLINE uint32_t DL_WWDT_getRawInterruptStatus (WWDT_Regs *wwdt)
 Check interrupt flag of any WWDT interrupt. More...
 
__STATIC_INLINE DL_WWDT_IIDX DL_WWDT_getPendingInterrupt (WWDT_Regs *wwdt)
 Get highest priority pending WWDT interrupt. More...
 
__STATIC_INLINE void DL_WWDT_clearInterruptStatus (WWDT_Regs *wwdt)
 Clear pending WWDT interrupt. More...
 

Detailed Description

Overview

The Window Watchdog Timer Driver Library allows full configuration of the MSPM0 WWDT module. The window watchdog timer (WWDT) supervises code execution. If the application software does not successfully reset the window watchdog within the programmed open time window, the window watchdog generates a SYSRST.


Enumeration Type Documentation

§ DL_WWDT_CLOCK_DIVIDE

Enumerator
DL_WWDT_CLOCK_DIVIDE_1 

Clock source divide by 1

DL_WWDT_CLOCK_DIVIDE_2 

Clock source divide by 2

DL_WWDT_CLOCK_DIVIDE_3 

Clock source divide by 3

DL_WWDT_CLOCK_DIVIDE_4 

Clock source divide by 4

DL_WWDT_CLOCK_DIVIDE_5 

Clock source divide by 5

DL_WWDT_CLOCK_DIVIDE_6 

Clock source divide by 6

DL_WWDT_CLOCK_DIVIDE_7 

Clock source divide by 7

DL_WWDT_CLOCK_DIVIDE_8 

Clock source divide by 8

§ DL_WWDT_WINDOW

Enumerator
DL_WWDT_WINDOW0 

Window 0 active

DL_WWDT_WINDOW1 

Window 1 active

§ DL_WWDT_WINDOW_PERIOD

Enumerator
DL_WWDT_WINDOW_PERIOD_0 

0% closed window period

DL_WWDT_WINDOW_PERIOD_12 

12% closed window period

DL_WWDT_WINDOW_PERIOD_18 

18% closed window period

DL_WWDT_WINDOW_PERIOD_25 

25% closed window period

DL_WWDT_WINDOW_PERIOD_50 

50% closed window period

DL_WWDT_WINDOW_PERIOD_75 

75% closed window period

DL_WWDT_WINDOW_PERIOD_81 

81% closed window period

DL_WWDT_WINDOW_PERIOD_87 

87% closed window period

§ DL_WWDT_TIMER_PERIOD

Enumerator
DL_WWDT_TIMER_PERIOD_6_BITS 

2^6 timer period count

DL_WWDT_TIMER_PERIOD_8_BITS 

2^8 timer period count

DL_WWDT_TIMER_PERIOD_10_BITS 

2^10 timer period count

DL_WWDT_TIMER_PERIOD_12_BITS 

2^12 timer period count

DL_WWDT_TIMER_PERIOD_15_BITS 

2^15 timer period count

DL_WWDT_TIMER_PERIOD_18_BITS 

2^18 timer period count

DL_WWDT_TIMER_PERIOD_21_BITS 

2^21 timer period count

DL_WWDT_TIMER_PERIOD_25_BITS 

2^25 timer period count

§ DL_WWDT_SLEEP_MODE

Enumerator
DL_WWDT_STOP_IN_SLEEP 

Stop the watchdog while in sleep

DL_WWDT_RUN_IN_SLEEP 

Keep the watchdog running in sleep

§ DL_WWDT_MODE

Enumerator
DL_WWDT_WATCHDOG_MODE 

The watchdog is in watchdog mode

DL_WWDT_INTERVAL_TIMER_MODE 

The watchdog is in interval timer mode

§ DL_WWDT_IIDX

Enumerator
DL_WWDT_IIDX_NO_INT 

Interrupt index for WWDT if no interrupt is pending

DL_WWDT_IIDX_INTERVAL_TIMER 

WWDT interrupt index for interval timer

Function Documentation

§ DL_WWDT_initWatchdogMode()

__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.

While in watchdog mode, the Window Watchdog Timer must be serviced periodically or the device will be reset. After calling this initialization API the watchdog will automatically start running with whatever window is currently selected. See DL_WWDT_setActiveWindow for setting the active window, this is typically window 0 upon startup.

Once running, the watchdog will need to be restarted periodically with DL_WWDT_restart.

The watchdog can only be initialized once, so this API can only be called once, and you may not later call DL_WWDT_initIntervalTimerMode.

Parameters
[in]wwdtPointer to the register overlay for peripheral
[in]dividerClock divider for the timer. One of DL_WWDT_CLOCK_DIVIDE.
[in]periodPeriod for the timer. One of DL_WWDT_TIMER_PERIOD.
[in]sleepModeEnable/disable the timer running in sleep mode. One of DL_WWDT_SLEEP_MODE.
[in]window0ClosedPeriodThe percentage of the total period that reset window 0 should be closed. One of DL_WWDT_WINDOW_PERIOD.
[in]window1ClosedPeriodThe percentage of the total period that reset window 1 should be closed. One of DL_WWDT_WINDOW_PERIOD.
See also
DL_WWDT_initIntervalTimerMode
DL_WWDT_setActiveWindow
DL_WWDT_restart

§ DL_WWDT_initIntervalTimerMode()

__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.

The Window Watchdog Timer can be used as a simple interval timer if you do not need watchdog/reset functionality. After calling this initialization API the timer will automatically start running and start interrupting periodically.

The WWDT can only be initialized once, so this API can only be called once, and you may not later call DL_WWDT_initWatchdogMode.

Parameters
[in]wwdtPointer to the register overlay for peripheral
[in]dividerClock divider for the timer. One of DL_WWDT_CLOCK_DIVIDE.
[in]periodPeriod for the timer. One of DL_WWDT_TIMER_PERIOD.
[in]sleepModeEnable/disable the timer running in sleep mode. One of DL_WWDT_SLEEP_MODE.
See also
DL_WWDT_initWatchdogMode

§ DL_WWDT_enablePower()

__STATIC_INLINE void DL_WWDT_enablePower ( WWDT_Regs *  wwdt)

Enables power on WWDT module.

Parameters
wwdtPointer to the register overlay for the peripheral

§ DL_WWDT_disablePower()

__STATIC_INLINE void DL_WWDT_disablePower ( WWDT_Regs *  wwdt)

Disables power on wwdt module.

Parameters
wwdtPointer to the register overlay for the peripheral

§ DL_WWDT_isPowerEnabled()

__STATIC_INLINE bool DL_WWDT_isPowerEnabled ( WWDT_Regs *  wwdt)

Returns if power on wwdt module.

Parameters
wwdtPointer to the register overlay for the peripheral
Returns
true if power is enabled
false if power is disabled

§ DL_WWDT_reset()

__STATIC_INLINE void DL_WWDT_reset ( WWDT_Regs *  wwdt)

Resets wwdt peripheral.

Parameters
wwdtPointer to the register overlay for the peripheral

§ DL_WWDT_isReset()

__STATIC_INLINE bool DL_WWDT_isReset ( WWDT_Regs *  wwdt)

Returns if wwdt peripheral was reset.

Parameters
wwdtPointer to the register overlay for the peripheral
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_WWDT_restart()

__STATIC_INLINE void DL_WWDT_restart ( WWDT_Regs *  wwdt)

Restarts the Window Watchdog.

When the Window Watchdog Timer is in watchdog mode it must be periodically serviced to avoid a hardware reset. This API must be called after the closed window of the watchdog has passed but before the watchdog resets the device.

Parameters
[in]wwdtPointer to the register overlay for peripheral

§ DL_WWDT_isRunning()

__STATIC_INLINE bool DL_WWDT_isRunning ( WWDT_Regs *  wwdt)

Checks if the Window Watchdog Timer is actively running.

Parameters
[in]wwdtPointer to the register overlay for peripheral
Returns
Returns the running status of the Window Watchdog Timer
Return values
trueThe Window Watchdog Timer is running
falseThe Window Watchdog Timer is not running

§ DL_WWDT_setActiveWindow()

__STATIC_INLINE void DL_WWDT_setActiveWindow ( WWDT_Regs *  wwdt,
DL_WWDT_WINDOW  window 
)

Set the active window being used.

The Window Watchdog Timer module allows you to switch between two different configured windows. This allows you to configure the watchdog with two different window sizes and switch between them during your application.

Parameters
[in]wwdtPointer to the register overlay for peripheral
[in]windowThe window to set as active. One of DL_WWDT_WINDOW.

§ DL_WWDT_getActiveWindow()

__STATIC_INLINE DL_WWDT_WINDOW DL_WWDT_getActiveWindow ( WWDT_Regs *  wwdt)

Get the active window being used.

Parameters
[in]wwdtPointer to the register overlay for peripheral
Returns
The active window being used
Return values
Oneof DL_WWDT_WINDOW

§ DL_WWDT_getSleepMode()

__STATIC_INLINE DL_WWDT_SLEEP_MODE DL_WWDT_getSleepMode ( WWDT_Regs *  wwdt)

Get the sleep mode being used.

Parameters
[in]wwdtPointer to the register overlay for peripheral
Returns
The current sleep mode
Return values
Oneof DL_WWDT_SLEEP_MODE

§ DL_WWDT_getMode()

__STATIC_INLINE DL_WWDT_MODE DL_WWDT_getMode ( WWDT_Regs *  wwdt)

Get the mode the watchdog is running in.

Parameters
[in]wwdtPointer to the register overlay for peripheral
Returns
The current mode the watchdog is running in
Return values
Oneof DL_WWDT_MODE

§ DL_WWDT_getWindowPeriod()

__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.

Parameters
[in]wwdtPointer to the register overlay for peripheral
[in]windowThe window to get the closed window percentage of. One of DL_WWDT_WINDOW.
Returns
The desired window's closed percentage
Return values
Oneof DL_WWDT_WINDOW_PERIOD

References DL_WWDT_WINDOW0.

§ DL_WWDT_getTimerPeriod()

__STATIC_INLINE DL_WWDT_TIMER_PERIOD DL_WWDT_getTimerPeriod ( WWDT_Regs *  wwdt)

Get the timer period for the watchdog.

Parameters
[in]wwdtPointer to the register overlay for peripheral
Returns
The current timer period for the watchdog
Return values
Oneof DL_WWDT_TIMER_PERIOD

§ DL_WWDT_getClockDivider()

__STATIC_INLINE DL_WWDT_CLOCK_DIVIDE DL_WWDT_getClockDivider ( WWDT_Regs *  wwdt)

Get the clock divider for the watchdog.

Parameters
[in]wwdtPointer to the register overlay for peripheral
Returns
The current clock divider used
Return values
Oneof DL_WWDT_CLOCK_DIVIDE

§ DL_WWDT_enableInterrupt()

__STATIC_INLINE void DL_WWDT_enableInterrupt ( WWDT_Regs *  wwdt)

Enable WWDT interrupt.

Parameters
[in]wwdtPointer to the register overlay for the peripheral

§ DL_WWDT_disableInterrupt()

__STATIC_INLINE void DL_WWDT_disableInterrupt ( WWDT_Regs *  wwdt)

Disable WWDT interrupt.

Parameters
[in]wwdtPointer to the register overlay for the peripheral

§ DL_WWDT_isInterruptEnabled()

__STATIC_INLINE bool DL_WWDT_isInterruptEnabled ( WWDT_Regs *  wwdt)

Check if WWDT interrupt is enabled.

Parameters
[in]wwdtPointer to the register overlay for the peripheral
Returns
If the WWDT interrupt is enabled
Return values
trueThe WWDT interrupt is enabled
falseThe WWDT interrupt is disabled

§ DL_WWDT_getEnabledInterruptStatus()

__STATIC_INLINE bool DL_WWDT_getEnabledInterruptStatus ( WWDT_Regs *  wwdt)

Check interrupt flag of enabled WWDT interrupt.

Checks if the WWDT interrupt that was previously enabled is pending.

Parameters
[in]wwdtPointer to the register overlay for the peripheral
Returns
If the enabled WWDT interrupt is pending
Return values
trueThe WWDT interrupt is pending
falseThe WWDT interrupt is not pending
See also
DL_WWDT_enableInterrupt

§ DL_WWDT_getRawInterruptStatus()

__STATIC_INLINE uint32_t DL_WWDT_getRawInterruptStatus ( WWDT_Regs *  wwdt)

Check interrupt flag of any WWDT interrupt.

Checks if the WWDT interrupt is pending. Interrupt does not have to be previously enabled.

Parameters
[in]wwdtPointer to the register overlay for the peripheral
Returns
If the WWDT interrupt is pending
Return values
trueThe WWDT interrupt is pending
falseThe WWDT interrupt is not pending

§ DL_WWDT_getPendingInterrupt()

__STATIC_INLINE DL_WWDT_IIDX DL_WWDT_getPendingInterrupt ( WWDT_Regs *  wwdt)

Get highest priority pending WWDT interrupt.

Checks if any of the WWDT interrupts are pending. Interrupts do not have to be previously enabled.

Parameters
[in]wwdtPointer to the register overlay for the peripheral
Returns
The highest priority pending WWDT interrupt
Return values
Oneof DL_WWDT_IIDX

§ DL_WWDT_clearInterruptStatus()

__STATIC_INLINE void DL_WWDT_clearInterruptStatus ( WWDT_Regs *  wwdt)

Clear pending WWDT interrupt.

Parameters
[in]wwdtPointer to the register overlay for the peripheral
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale