3.26.3 DMT Driver
Overview
The Deadman Timer (DMT) module is designed to enable users to monitor the health of their application software by requiring periodic timer interrupts within a user-specified timing window. DMT is a synchronous counter and when enabled, counts instruction fetches, and is able to cause a soft trap if the DMT counter is not cleared within a set number of instructions.
Features
3.26.3.1 Module Documentation
3.26.3.1.1 DMT Driver
Deadman Timer (DMT) driver using dsPIC MCUs. The functionality is to interrupt the processor in the event of a software malfunction.
Module description
Deadman Timer (DMT) driver using dsPIC MCUs. The functionality is to interrupt the processor in the event of a software malfunction.
Functions
void DMT_Initialize (void)
Initializes the DMT module.
void DMT_PreClear (void)
Writes the PreClear Pattern for DMTPRECLR register.
void DMT_Enable (void)
Enables the DMT module.
void DMT_Clear (void)
Checks the PreClear Status and clears the DMT Fetch Counter.
bool DMT_IsWindowOpen (void)
Returns the Window Open status.
bool DMT_IsPreCleared (void)
Checks for the PreClear sequence was initiated and done before the Clear sequence is done.
void DMT_PostEventClear (void)
Performs clear sequence for the DMT Event and all other DMT flags, post occurance of DMT Event.
uint32_t DMT_TimeoutCounterGet (void)
Reads the DMT counter register.
uint32_t DMT_WindowTimeoutCounterGet (void)
Reads the DMT Window Interval Counter.
uint32_t DMT_StatusGet (void)
Gets the DMT status.
uint32_t DMT_CounterGet (void)
Returns the current counter value.
uint32_t DMT_CalibratedCounterGet (void)
Returns the current counter value.
Function Documentation
DMT_CalibratedCounterGet()
uint32_t DMT_CalibratedCounterGet (void )
Returns the current counter value.
Value will be compensated for the instructions involved in call-stack-push, reading SFR and call-stack-pop operations. |
none |
Returns the 32 bit counter value |
DMT_Clear()
void DMT_Clear (void )
Checks the PreClear Status and clears the DMT Fetch Counter.
DMT_PreClear() should be called for the associated function to work |
none |
none |
DMT_CounterGet()
uint32_t DMT_CounterGet (void )
Returns the current counter value.
Value will not be compensated for the instructions involved in call-stack-push, reading SFR and call-stack-pop operations. |
none |
Returns the 32 bit counter value |
DMT_Enable()
void DMT_Enable (void )
Enables the DMT module.
none |
none |
DMT_Initialize()
void DMT_Initialize (void )
Initializes the DMT module.
none |
none |
DMT_IsPreCleared()
bool DMT_IsPreCleared (void )
Checks for the PreClear sequence was initiated and done before the Clear sequence is done.
none |
true - PreClear sequence performed successfully false - PreClear sequence failed |
DMT_IsWindowOpen()
bool DMT_IsWindowOpen (void )
Returns the Window Open status.
none |
true - Window Open status bit is set false - Window Open status bit is not set |
DMT_PostEventClear()
void DMT_PostEventClear (void )
Performs clear sequence for the DMT Event and all other DMT flags, post occurance of DMT Event.
none |
none |
DMT_PreClear()
void DMT_PreClear (void )
Writes the PreClear Pattern for DMTPRECLR register.
This function should be called before calling DMT_Clear |
none |
none |
DMT_StatusGet()
uint32_t DMT_StatusGet (void )
Gets the DMT status.
none |
status value of DMT |
DMT_TimeoutCounterGet()
uint32_t DMT_TimeoutCounterGet (void )
Reads the DMT counter register.
none |
32 bit timeout counter value |
DMT_WindowTimeoutCounterGet()
uint32_t DMT_WindowTimeoutCounterGet (void )
Reads the DMT Window Interval Counter.
none |
32-bit window interval counter value |
3.26.3.2 File Documentation
3.26.3.2.1 source/dmt.h File Reference
#include <stdbool.h> #include <stdint.h>
Functions
void DMT_Initialize (void)
Initializes the DMT module.
void DMT_PreClear (void)
Writes the PreClear Pattern for DMTPRECLR register.
void DMT_Enable (void)
Enables the DMT module.
void DMT_Clear (void)
Checks the PreClear Status and clears the DMT Fetch Counter.
bool DMT_IsWindowOpen (void)
Returns the Window Open status.
bool DMT_IsPreCleared (void)
Checks for the PreClear sequence was initiated and done before the Clear sequence is done.
void DMT_PostEventClear (void)
Performs clear sequence for the DMT Event and all other DMT flags, post occurance of DMT Event.
uint32_t DMT_TimeoutCounterGet (void)
Reads the DMT counter register.
uint32_t DMT_WindowTimeoutCounterGet (void)
Reads the DMT Window Interval Counter.
uint32_t DMT_StatusGet (void)
Gets the DMT status.
uint32_t DMT_CounterGet (void)
Returns the current counter value.
uint32_t DMT_CalibratedCounterGet (void)
Returns the current counter value.
Detailed Description
DMT Generated Driver Header File