© National Instruments Corporation D-1 TPC-2012 User Manual
D

Watchdog Timer Programming

on WinCE

Windows CE includes a watchdog timer for the TPC-2012. You can access
the timer through the WIN32 API. The TPC-2012 includes a WDT driver,
WDT1:, for enabling/disabling the watchdog timer. You must open this
driver before using the resources, and then use the DeviceIOControl
function to enable/disable the watchdog timer.
This appendix describes DeviceIOControl and it parameters. It also
includes a programming example.

DeviceIOControl

DeviceIOControl sends a control code directly to a specified device driver,
causing the corresponding device to perform the specified operation. The
function and its parameters are:
BOOL DeviceIoControl( HANDLE hDevice, DWORD
dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize,
LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD
lpBytesReturned, LPOVERLAPPED lpOverlapped );
Parameters
DeviceIOControl includes the following parameters:
hDevice
(in) Handle to the device that performs the operation. Call the
CreateFile function to obtain a device handle.
dwIoControlCode
(in) Specifies the operation control code. This value identifies the
specific operation to be performed and the type of device on which the
operation is to be performed. No specific values are defined for the
dwIoControlCode parameter. However, if you write a custom device
driver, you can define IOCTL_XXXX control codes, per the CTL_CODE
macro. You then can advertise these control codes, and an application