Appendix B Watchdog Timer on WinCE. Advantech TPC-1570H

Add to my manuals
106 Pages

advertisement

Appendix B Watchdog Timer on WinCE. Advantech TPC-1570H | Manualzz

Appendix B Watchdog Timer on WinCE

There is a built-in Watchdog timer on Windows CE 5.0 for TPC-1570H.

You can access it through WIN32 API. TPC-1570H provides a WDT driver to allow users to enable/disable the Watchdog timer. The driver name is

“WDT1:”. Programmers must open this driver before using the resources.

Then programmers can use DeviceIOControl functions to enable/disable

Watchdog timer. The introduction below includes the DeviceIOControl, the definition of the parameter and an example.

B.1 DeviceIOControl

This function sends a control code directly to a specified device driver, causing the corresponding device to perform the specified operation.

BOOL DeviceIoControl(

HANDLE hDevice,

DWORD dwIoControlCode,

LPVOID lpInBuffer,

DWORD nInBufferSize,

LPVOID lpOutBuffer,

DWORD nOutBufferSize,

LPDWORD lpBytesReturned,

LPOVERLAPPED lpOverlapped );

Parameters: hDevice

[in] Handle to the device that is to perform the operation. Call the Create-

File function to obtain a device handle.

dwIoControlCode

[in] Specifies the control code for the operation. 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 dwIo-

ControlCode parameter. However, the writer of a custom device driver can define IOCTL_XXXX control codes, per the CTL_CODE macro. These

TPC-1570H User Manual 52

control codes can then be advertised, and an application can use these control codes with DeviceIoControl to perform driverspecific functions.

lpInBuffer

[in] Long pointer to a buffer that contains the data required to perform the operation. This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not require input data.

nInBufferSize

[in] Size, in bytes, of the buffer pointed to by lpInBuffer.

lpOutBuffer

[out] Long pointer to a buffer that receives the operation.s output data.

This parameter can be NULL if the dwIoControlCode parameter specifies an operation that does not produce output data.

nOutBufferSize

[in] Size, in bytes, of the buffer pointed to by lpOutBuffer.

lpBytesReturned

[out] Long pointer to a variable that receives the size, in bytes, of the data stored into the buffer pointed to by lpOutBuffer. The lpBytesReturned parameter cannot be NULL. Even when an operation produces no output data, and lpOutBuffer can be NULL, the DeviceIoControl function makes use of the variable pointed to bylpBytesReturned. After such an operation, the value of the variable is without meaning.

lpOverlapped

[in] Ignored; set to NULL.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

53 Appendix B

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents