A WATCHDOG TIMER DRIVER AND APPLICATION

In the code for this chapter is a complete Compact 7 WDT test application and drivers for the eBox 3300-Vortex86DX (and MX) watchdog timer. This section will discuss the structure and function of this code. The next section will cover using the code. It can be configured to reset the device or generate IRQs 3 to 7, 9, 10, 12, and 14. There are four Compact 7 projects in this bundle:

  • WDT_ISR — WDT IRQ handler
  • WDT_DRV — WDT driver
  • WatchdogWrapperDLL — Native code wrapper for the driver
  • WatchdogWrapperDLL — Native code application to test the WDT via the wrapper

As the code for WDT1 is simpler, you track its coding in the next section.

WDT_ISR

WDT_ISR implements an installable interrupt for the Vortex86.

The configuration information and values for WDT1 follows:

  • DWORD SysIntr
    • The system interrupt for WDT1 if enabled.
      • Upon an interrupt this gets passed to the kernel, which fires an event that unblocks the IST.
    • SYSINTR_CHAIN if not enabled
      • The interrupt gets passed on to any other ISR in the chain to see if it can handle it. For this interrupt there will be no other interrupts in the chain.
  • UCHAR IIRaddr
    • Port Ox6d if enabled; zero otherwise.
    • The configuration port for what to do upon an interrupt.
  • UCHAR Mask
    • 0×80 if enabled.
    • Zero otherwise.
  • BOOL M6117
    • False for WDT1.

The key functions in this driver follow:

  • CreateInstance()
    • This does nothing other than store configuration information such that the ISR does not pass the WDT1 ...

Get Professional Windows® Embedded Compact 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.