AVR SD Safety Framework 1.0.0
Loading...
Searching...
No Matches
midware_watchdog_manager.c File Reference

Implements APIs for the Watchdog Manager. More...

#include <stdbool.h>
#include <stdint.h>
#include <define_error_flags.h>
#include <driver_swdt.h>
#include <driver_wdt.h>
#include <midware_watchdog_manager.h>
#include <midware_watchdog_manager_asm.h>
#include <xc.h>

Macros

#define UINT24_MAX   0x00FFFFFFUL
 Defines max value for 24-bit registers.

Functions

errFlag_t MW_GetSwdtPreclearError (void)
 Reads the error flag indicating a non-preclear command received while expecting a preclear command in the Synchronous Watchdog Timer (SWDT).
errFlag_t MW_GetSwdtClearError (void)
 Reads the error flag indicating a non-clear command received while expecting a clear command in the Synchronous Watchdog Timer (SWDT).
errFlag_t MW_GetSwdtUnexpectedCmdError (void)
 Reads the error flag indicating a clear command received in the closed window after a preclear command in the Synchronous Watchdog Timer (SWDT).
errFlag_t MW_GetSwdtCounterExpiredError (void)
 Reads the error flag indicating that the Synchronous Watchdog Timer (SWDT) counter expired.
void MW_ClearSwdtErrors (void)
 Clears all the error interrupt flags in the Synchronous Watchdog Timer (SWDT).
void MW_PreClearSwdt (void)
 Issues a PRECLEAR command to the Synchronous Watchdog Timer (SWDT).
errFlag_t MW_ClearSwdt (void)
 Issues a CLEAR command to the Synchronous Watchdog Timer (SWDT).
errFlag_t MW_SetSwdtResetValue (uint32_t resetVal)
 Sets the Synchronous Watchdog Timer (SWDT) countdown reset value.
errFlag_t MW_SetSwdtWindowValue (uint16_t window)
 Sets the Synchronous Watchdog Timer (SWDT) open window value.
void MW_EnableSwdtInterrupts (void)
 Enables all Synchronous Watchdog Timer (SWDT) error interrupts.
errFlag_t MW_EnableSwdt (bool useCcp, bool useLock, bool useInstrMode)
 Enables the Synchronous Watchdog Timer (SWDT) with the provided configurations.
void MW_ClearWdt (void)
 Clears the Watchdog Timer (WDT) by issuing a Watchdog Reset (WDR) instruction.
errFlag_t MW_SetWdtTimeout (wdtTimeout_t window, wdtTimeout_t period, bool useLock)
 Configures and enables the Watchdog Timer (WDT) in either Normal or Window mode.

Detailed Description

Implements APIs for the Watchdog Manager.