Driverlib WWDT API
Module: Driverlib (AM13E230X) APIs
Types
Name |
|
|---|---|
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 = WWDT_WWDTCTL0_MODE_WINDOW, 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
Name |
|
|---|---|
__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) |
__STATIC_INLINE void |
DL_WWDT_initIntervalTimerMode(WWDT_Regs * wwdt, DL_WWDT_CLOCK_DIVIDE divider, DL_WWDT_TIMER_PERIOD period, DL_WWDT_SLEEP_MODE sleepMode) |
__STATIC_INLINE void |
DL_WWDT_enablePower(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_disablePower(WWDT_Regs * wwdt) |
__STATIC_INLINE bool |
DL_WWDT_isPowerEnabled(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_reset(WWDT_Regs * wwdt) |
__STATIC_INLINE bool |
DL_WWDT_isReset(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_restart(WWDT_Regs * wwdt) |
__STATIC_INLINE bool |
DL_WWDT_isRunning(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_setActiveWindow(WWDT_Regs * wwdt, DL_WWDT_WINDOW window) |
__STATIC_INLINE DL_WWDT_WINDOW |
DL_WWDT_getActiveWindow(WWDT_Regs * wwdt) |
__STATIC_INLINE DL_WWDT_SLEEP_MODE |
DL_WWDT_getSleepMode(WWDT_Regs * wwdt) |
__STATIC_INLINE DL_WWDT_MODE |
DL_WWDT_getMode(WWDT_Regs * wwdt) |
__STATIC_INLINE DL_WWDT_WINDOW_PERIOD |
DL_WWDT_getWindowPeriod(WWDT_Regs * wwdt, DL_WWDT_WINDOW window) |
__STATIC_INLINE DL_WWDT_TIMER_PERIOD |
DL_WWDT_getTimerPeriod(WWDT_Regs * wwdt) |
__STATIC_INLINE DL_WWDT_CLOCK_DIVIDE |
DL_WWDT_getClockDivider(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_enableInterrupt(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_disableInterrupt(WWDT_Regs * wwdt) |
__STATIC_INLINE bool |
DL_WWDT_isInterruptEnabled(WWDT_Regs * wwdt) |
__STATIC_INLINE bool |
DL_WWDT_getEnabledInterruptStatus(WWDT_Regs * wwdt) |
__STATIC_INLINE uint32_t |
DL_WWDT_getRawInterruptStatus(WWDT_Regs * wwdt) |
__STATIC_INLINE DL_WWDT_IIDX |
DL_WWDT_getPendingInterrupt(WWDT_Regs * wwdt) |
__STATIC_INLINE void |
DL_WWDT_clearInterruptStatus(WWDT_Regs * wwdt) |
Defines
Name |
|
|---|---|
DL_WWDT_CNTRST_VAL |
Detailed Description
The Window Watchdog Timer Driver Library allows full configuration of the 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.
Types Documentation
enum DL_WWDT_CLOCK_DIVIDE
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_CLOCK_DIVIDE_1 |
0x00000000 |
Clock source divide by 1 |
DL_WWDT_CLOCK_DIVIDE_2 |
0x00000001 |
Clock source divide by 2 |
DL_WWDT_CLOCK_DIVIDE_3 |
0x00000002 |
Clock source divide by 3 |
DL_WWDT_CLOCK_DIVIDE_4 |
0x00000003 |
Clock source divide by 4 |
DL_WWDT_CLOCK_DIVIDE_5 |
0x00000004 |
Clock source divide by 5 |
DL_WWDT_CLOCK_DIVIDE_6 |
0x00000005 |
Clock source divide by 6 |
DL_WWDT_CLOCK_DIVIDE_7 |
0x00000006 |
Clock source divide by 7 |
DL_WWDT_CLOCK_DIVIDE_8 |
0x00000007 |
Clock source divide by 8 |
enum DL_WWDT_WINDOW
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_WINDOW0 |
WWDT_WWDTCTL1_WINSEL_WIN0 |
Window 0 active |
DL_WWDT_WINDOW1 |
WWDT_WWDTCTL1_WINSEL_WIN1 |
Window 1 active |
enum DL_WWDT_WINDOW_PERIOD
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_WINDOW_PERIOD_0 |
WWDT_WWDTCTL0_WINDOW0_SIZE_0 |
0% closed window period |
DL_WWDT_WINDOW_PERIOD_12 |
WWDT_WWDTCTL0_WINDOW0_SIZE_12 |
12.5% closed window period |
DL_WWDT_WINDOW_PERIOD_18 |
WWDT_WWDTCTL0_WINDOW0_SIZE_18 |
18.75% closed window period |
DL_WWDT_WINDOW_PERIOD_25 |
WWDT_WWDTCTL0_WINDOW0_SIZE_25 |
25% closed window period |
DL_WWDT_WINDOW_PERIOD_50 |
WWDT_WWDTCTL0_WINDOW0_SIZE_50 |
50% closed window period |
DL_WWDT_WINDOW_PERIOD_75 |
WWDT_WWDTCTL0_WINDOW0_SIZE_75 |
75% closed window period |
DL_WWDT_WINDOW_PERIOD_81 |
WWDT_WWDTCTL0_WINDOW0_SIZE_81 |
81.25% closed window period |
DL_WWDT_WINDOW_PERIOD_87 |
WWDT_WWDTCTL0_WINDOW0_SIZE_87 |
87.50% closed window period |
enum DL_WWDT_TIMER_PERIOD
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_TIMER_PERIOD_6_BITS |
WWDT_WWDTCTL0_PER_EN_6 |
2^6 timer period count |
DL_WWDT_TIMER_PERIOD_8_BITS |
WWDT_WWDTCTL0_PER_EN_8 |
2^8 timer period count |
DL_WWDT_TIMER_PERIOD_10_BITS |
WWDT_WWDTCTL0_PER_EN_10 |
2^10 timer period count |
DL_WWDT_TIMER_PERIOD_12_BITS |
WWDT_WWDTCTL0_PER_EN_12 |
2^12 timer period count |
DL_WWDT_TIMER_PERIOD_15_BITS |
WWDT_WWDTCTL0_PER_EN_15 |
2^15 timer period count |
DL_WWDT_TIMER_PERIOD_18_BITS |
WWDT_WWDTCTL0_PER_EN_18 |
2^18 timer period count |
DL_WWDT_TIMER_PERIOD_21_BITS |
WWDT_WWDTCTL0_PER_EN_21 |
2^21 timer period count |
DL_WWDT_TIMER_PERIOD_25_BITS |
WWDT_WWDTCTL0_PER_EN_25 |
2^25 timer period count |
enum DL_WWDT_SLEEP_MODE
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_STOP_IN_SLEEP |
WWDT_WWDTCTL0_STISM_STOP |
Stop the watchdog while in sleep |
DL_WWDT_RUN_IN_SLEEP |
WWDT_WWDTCTL0_STISM_CONT |
Keep the watchdog running in sleep |
enum DL_WWDT_MODE
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_WATCHDOG_MODE |
WWDT_WWDTCTL0_MODE_WINDOW |
The watchdog is in window mode |
DL_WWDT_INTERVAL_TIMER_MODE |
WWDT_WWDTCTL0_MODE_INTERVAL |
The watchdog is in interval timer mode |
enum DL_WWDT_IIDX
Enumerator |
Value |
Description |
|---|---|---|
DL_WWDT_IIDX_NO_INT |
WWDT_IIDX_STAT_NO_INTR |
Interrupt index for WWDT if no interrupt is pending |
DL_WWDT_IIDX_INTERVAL_TIMER |
WWDT_IIDX_STAT_INTTIM |
WWDT interrupt index for interval timer |
Functions Documentation
function 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.
Parameters:
wwdt Pointer to the register overlay for peripheral
divider Clock divider for the timer. One of DL_WWDT_CLOCK_DIVIDE.
period Period for the timer. One of DL_WWDT_TIMER_PERIOD.
sleepMode Enable/disable the timer running in sleep mode. One of DL_WWDT_SLEEP_MODE.
window0ClosedPeriod The percentage of the total period that reset window 0 should be closed. One of DL_WWDT_WINDOW_PERIOD.
window1ClosedPeriod The percentage of the total period that reset window 1 should be closed. One of DL_WWDT_WINDOW_PERIOD.
See:
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.
function 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.
Parameters:
wwdt Pointer to the register overlay for peripheral
divider Clock divider for the timer. One of DL_WWDT_CLOCK_DIVIDE.
period Period for the timer. One of DL_WWDT_TIMER_PERIOD.
sleepMode Enable/disable the timer running in sleep mode. One of DL_WWDT_SLEEP_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.
function DL_WWDT_enablePower
__STATIC_INLINE void DL_WWDT_enablePower(
WWDT_Regs * wwdt
)
Enables power on WWDT module.
Parameters:
wwdt Pointer to the register overlay for the peripheral
function DL_WWDT_disablePower
__STATIC_INLINE void DL_WWDT_disablePower(
WWDT_Regs * wwdt
)
Disables power on wwdt module.
Parameters:
wwdt Pointer to the register overlay for the peripheral
function DL_WWDT_isPowerEnabled
__STATIC_INLINE bool DL_WWDT_isPowerEnabled(
WWDT_Regs * wwdt
)
Returns if power is enabled on wwdt module.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Return:
true if power is enabled
false if power is disabled
function DL_WWDT_reset
__STATIC_INLINE void DL_WWDT_reset(
WWDT_Regs * wwdt
)
Resets wwdt peripheral.
Parameters:
wwdt Pointer to the register overlay for the peripheral
function DL_WWDT_isReset
__STATIC_INLINE bool DL_WWDT_isReset(
WWDT_Regs * wwdt
)
Returns if wwdt peripheral was reset.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Return:
true if peripheral was reset
false if peripheral wasn’t reset
function DL_WWDT_restart
__STATIC_INLINE void DL_WWDT_restart(
WWDT_Regs * wwdt
)
Restarts the Window Watchdog.
Parameters:
wwdt Pointer to the register overlay for peripheral
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.
function DL_WWDT_isRunning
__STATIC_INLINE bool DL_WWDT_isRunning(
WWDT_Regs * wwdt
)
Checks if the Window Watchdog Timer is actively running.
Parameters:
wwdt Pointer to the register overlay for peripheral
Returns:
true The Window Watchdog Timer is running
false The Window Watchdog Timer is not running
Return: Returns the running status of the Window Watchdog Timer
function DL_WWDT_setActiveWindow
__STATIC_INLINE void DL_WWDT_setActiveWindow(
WWDT_Regs * wwdt,
DL_WWDT_WINDOW window
)
Set the active window being used.
Parameters:
wwdt Pointer to the register overlay for peripheral
window The window to set as active. One of DL_WWDT_WINDOW.
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.
function DL_WWDT_getActiveWindow
__STATIC_INLINE DL_WWDT_WINDOW DL_WWDT_getActiveWindow(
WWDT_Regs * wwdt
)
Get the active window being used.
Parameters:
wwdt Pointer to the register overlay for peripheral
Returns:
One of DL_WWDT_WINDOW
Return: The active window being used
function DL_WWDT_getSleepMode
__STATIC_INLINE DL_WWDT_SLEEP_MODE DL_WWDT_getSleepMode(
WWDT_Regs * wwdt
)
Get the sleep mode being used.
Parameters:
wwdt Pointer to the register overlay for peripheral
Returns:
One of DL_WWDT_SLEEP_MODE
Return: The current sleep mode
function DL_WWDT_getMode
__STATIC_INLINE DL_WWDT_MODE DL_WWDT_getMode(
WWDT_Regs * wwdt
)
Get the mode the watchdog is running in.
Parameters:
wwdt Pointer to the register overlay for peripheral
Returns:
One of DL_WWDT_MODE
Return: The current mode the watchdog is running in
function 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:
wwdt Pointer to the register overlay for peripheral
window The window to get the closed window percentage of. One of DL_WWDT_WINDOW.
Returns:
One of DL_WWDT_WINDOW_PERIOD
Return: The desired window’s closed percentage
function DL_WWDT_getTimerPeriod
__STATIC_INLINE DL_WWDT_TIMER_PERIOD DL_WWDT_getTimerPeriod(
WWDT_Regs * wwdt
)
Get the timer period for the watchdog.
Parameters:
wwdt Pointer to the register overlay for peripheral
Returns:
One of DL_WWDT_TIMER_PERIOD
Return: The current timer period for the watchdog
function DL_WWDT_getClockDivider
__STATIC_INLINE DL_WWDT_CLOCK_DIVIDE DL_WWDT_getClockDivider(
WWDT_Regs * wwdt
)
Get the clock divider for the watchdog.
Parameters:
wwdt Pointer to the register overlay for peripheral
Returns:
One of DL_WWDT_CLOCK_DIVIDE
Return: The current clock divider used
function DL_WWDT_enableInterrupt
__STATIC_INLINE void DL_WWDT_enableInterrupt(
WWDT_Regs * wwdt
)
Enable WWDT interrupt.
Parameters:
wwdt Pointer to the register overlay for the peripheral
function DL_WWDT_disableInterrupt
__STATIC_INLINE void DL_WWDT_disableInterrupt(
WWDT_Regs * wwdt
)
Disable WWDT interrupt.
Parameters:
wwdt Pointer to the register overlay for the peripheral
function DL_WWDT_isInterruptEnabled
__STATIC_INLINE bool DL_WWDT_isInterruptEnabled(
WWDT_Regs * wwdt
)
Check if WWDT interrupt is enabled.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Returns:
true The WWDT interrupt is enabled
false The WWDT interrupt is disabled
Return: If the WWDT interrupt is enabled
function DL_WWDT_getEnabledInterruptStatus
__STATIC_INLINE bool DL_WWDT_getEnabledInterruptStatus(
WWDT_Regs * wwdt
)
Check interrupt flag of enabled WWDT interrupt.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Returns:
true The WWDT interrupt is pending
false The WWDT interrupt is not pending
Return: If the enabled WWDT interrupt is pending
Checks if the WWDT interrupt that was previously enabled is pending.
function DL_WWDT_getRawInterruptStatus
__STATIC_INLINE uint32_t DL_WWDT_getRawInterruptStatus(
WWDT_Regs * wwdt
)
Check interrupt flag of any WWDT interrupt.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Returns:
true The WWDT interrupt is pending
false The WWDT interrupt is not pending
Return: If the WWDT interrupt is pending
Checks if the WWDT interrupt is pending. Interrupt does not have to be previously enabled.
function DL_WWDT_getPendingInterrupt
__STATIC_INLINE DL_WWDT_IIDX DL_WWDT_getPendingInterrupt(
WWDT_Regs * wwdt
)
Get highest priority pending WWDT interrupt.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Returns:
One of DL_WWDT_IIDX
Return: The highest priority pending WWDT interrupt
Checks if any of the WWDT interrupts are pending. Interrupts do not have to be previously enabled.
function DL_WWDT_clearInterruptStatus
__STATIC_INLINE void DL_WWDT_clearInterruptStatus(
WWDT_Regs * wwdt
)
Clear pending WWDT interrupt.
Parameters:
wwdt Pointer to the register overlay for the peripheral
Macros Documentation
define DL_WWDT_CNTRST_VAL
#define DL_WWDT_CNTRST_VAL (0x00A7)
Value written to counter reset register for restarting the counter.