DAS
3.1.6 - 18/09/2017
Sources
Header
wdt.h
Go to the documentation of this file.
1
// Date : 8/8/2000
2
// Company : ICP Electronics Inc.
3
// Description : Define the IO control code of watch dog timer.
4
5
#ifndef __WDT_H__
6
#define __WDT_H__
7
8
// Begin conditional compilation of platform dependency
9
#if defined(WIN32) // for NT, Win2000, 98 platform
10
11
#ifdef WDM
12
#include <devioctl.h>
13
#else
14
#include <winioctl.h>
// contains the definition of CTL_CODE for Window application
15
#endif
16
17
#define WDT_DEVICE "\\\\.\\WDT_DEVICE"
18
#define WDT_DEVICE_NAME L"\\Device\\WDT_DEVICE"
19
#define WDT_DOS_DEVICE_NAME L"\\DosDevices\\WDT_DEVICE"
20
21
// Device type
22
#define WDT_TYPE 35001
23
24
#if defined(WINSYS)
25
// define device extension structure
26
typedef
struct
tagWDTDEVICEINFO {
27
PDEVICE_OBJECT pDeviceObject;
28
} WDTDEVICEINFO, *PWDTDEVICEINFO;
29
#endif
30
31
//***************************************************************
32
//#define POS_370 // just for POS 370 outport = 0x440
33
//***************************************************************
34
35
typedef
struct
tagWDTPARAM {
36
unsigned
char
timeout;
37
unsigned
char
data_b;
38
} WDTPARAM, *PWDTPARAM;
39
40
// The IOCTL function codes from 0x800 to 0xFFF are for customer use.
41
#define IOCTL_SYS_WDT_SET_TIMEOUT CTL_CODE(WDT_TYPE, 0x800, METHOD_BUFFERED, FILE_WRITE_ACCESS)
42
#define IOCTL_SYS_WDT_START CTL_CODE(WDT_TYPE, 0x801, METHOD_BUFFERED, FILE_WRITE_ACCESS)
43
#define IOCTL_SYS_WDT_STOP CTL_CODE(WDT_TYPE, 0x802, METHOD_BUFFERED, FILE_WRITE_ACCESS)
44
#define IOCTL_SYS_WDT_RESTART CTL_CODE(WDT_TYPE, 0x803, METHOD_BUFFERED, FILE_WRITE_ACCESS)
45
#define IOCTL_SYS_DIO_READ CTL_CODE(WDT_TYPE, 0x804, METHOD_BUFFERED, FILE_WRITE_ACCESS)
46
#define IOCTL_SYS_DIO_WRITE CTL_CODE(WDT_TYPE, 0x805, METHOD_BUFFERED, FILE_WRITE_ACCESS)
47
48
#elif defined(LINUX) // Linux platform
49
50
// IO control code
51
#define IOCTL_WDT_MAGIC 'W'
52
#define IOCTL_WDT_SET_TIMEOUT _IOR(IOCTL_WDT_MAGIC, 0, sizeof(unsigned char))
53
#define IOCTL_WDT_START _IO(IOCTL_WDT_MAGIC, 1)
54
#define IOCTL_WDT_STOP _IO(IOCTL_WDT_MAGIC, 2)
55
#define IOCTL_WDT_RESTART _IO(IOCTL_WDT_MAGIC, 3)
56
57
#ifdef __KERNEL__
58
#define DEFAULT_TIME_TO_RESET 30
59
#endif // __KERNEL__
60
61
#endif
62
63
#endif // __WDT_H__
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:09 for DAS - Rel. 3.1.6 - 18/09/2017.