FreeCalypso > hg > tcs211-l1-reconst
comparison gpf/INC/gdi.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* | |
2 +------------------------------------------------------------------------------ | |
3 | File: gdi.h | |
4 +------------------------------------------------------------------------------ | |
5 | Copyright Condat AG 1999-2001, Berlin | |
6 | All rights reserved. | |
7 | | |
8 | This file is confidential and a trade secret of Condat AG. | |
9 | The receipt of or possession of this file does not convey | |
10 | any rights to reproduce or disclose its contents or to | |
11 | manufacture, use, or sell anything it may describe, in | |
12 | whole, or in part, without the specific written consent of | |
13 | Condat AG. | |
14 +------------------------------------------------------------------------------ | |
15 | Purpose: General Definitions. | |
16 | $Identity:$ | |
17 +------------------------------------------------------------------------------ | |
18 */ | |
19 | |
20 #ifndef GDI_H | |
21 #define GDI_H | |
22 | |
23 /*==== INCLUDES =============================================================*/ | |
24 | |
25 #include "typedefs.h" | |
26 | |
27 /*==== DEFINITIONS ==========================================================*/ | |
28 /*-------------------------------- | |
29 Return values | |
30 --------------------------------*/ | |
31 #ifdef DRV_OK | |
32 #undef DRV_OK | |
33 #endif | |
34 #define DRV_OK 0 | |
35 #define DRV_BUFFER_FULL 1 | |
36 #define DRV_DISABLED 2 | |
37 #define DRV_ENABLED 3 | |
38 #define DRV_INITFAILURE 4 | |
39 #define DRV_INITIALIZED 5 | |
40 #define DRV_INTERNAL_ERROR 6 | |
41 #define DRV_INPROCESS 7 | |
42 #define DRV_INVALID_PARAMS 8 | |
43 #define DRV_NOTCONFIGURED 9 | |
44 #define DRV_RETVAL_USER 50 | |
45 | |
46 /*-------------------------------- | |
47 Signal types | |
48 --------------------------------*/ | |
49 #define DRV_SIGFCT_NOTAVAILABLE 0x01 | |
50 #define DRV_SIGTYPE_CLEAR 0x02 | |
51 #define DRV_SIGTYPE_FLUSH 0x04 | |
52 #define DRV_SIGTYPE_READ 0x08 | |
53 #define DRV_SIGTYPE_WRITE 0x10 | |
54 #define DRV_SIGTYPE_CONNECT 0x20 | |
55 #define DRV_SIGTYPE_DISCONNECT 0x40 | |
56 | |
57 #define DRV_SIGTYPE_USER 0x80 | |
58 | |
59 /*-------------------------------- | |
60 Flags | |
61 --------------------------------*/ | |
62 #define CALLED_FROM_ISR 0x01 | |
63 | |
64 /*-------------------------------- | |
65 Buffer Types | |
66 --------------------------------*/ | |
67 #define DRV_BUFTYPE_READ 0x01 | |
68 #define DRV_BUFTYPE_WRITE 0x02 | |
69 | |
70 /*==== TYPES ================================================================*/ | |
71 typedef void * drv_ProcHandle_Type; | |
72 | |
73 /*------------------------------------------------------------------------ | |
74 T_DRV_SIGNAL - driver signal identification | |
75 | |
76 The type defines the signal information data used to identify a signal. | |
77 This data type is used to define and to report a signal. A signal is | |
78 defined by a process calling the driver function drv_SetSignal. An | |
79 event is signalled by driver by calling the pre-defined signal call- | |
80 back function. | |
81 -------------------------------------------------------------------------*/ | |
82 typedef struct | |
83 { | |
84 USHORT SignalType; | |
85 USHORT DrvHandle; | |
86 ULONG DataLength; | |
87 T_VOID_STRUCT *UserData; | |
88 } T_DRV_SIGNAL; | |
89 | |
90 /*------------------------------------------------------------------------ | |
91 T_DRV_CB_FUNC - driver signal device control block | |
92 | |
93 This type defines a call-back function used to signal driver events, | |
94 e.g. driver is ready to accept data. The driver calls the signal | |
95 call-back function when a specific event occurs and the driver has | |
96 been instructed to signal the event to a specific process. A process | |
97 can set or reset event signalling by calling one of the driver | |
98 functions drv_SetSignal or drv_ResetSignal. Event signalling can only | |
99 be performed when a call-back function has been installed at driver | |
100 initialization. | |
101 -------------------------------------------------------------------------*/ | |
102 typedef void (*T_DRV_CB_FUNC ) (T_DRV_SIGNAL * Signal); | |
103 | |
104 struct _T_DRV_EXPORT; | |
105 | |
106 typedef struct | |
107 { | |
108 #ifdef _TOOLS_ | |
109 USHORT (*drv_Init)(USHORT,T_DRV_CB_FUNC,struct _T_DRV_EXPORT const**); | |
110 #endif | |
111 void (*drv_Exit)(void); | |
112 USHORT (*drv_Read)(void*, ULONG*); | |
113 USHORT (*drv_Write)(void*, ULONG*); | |
114 USHORT (*drv_Look)(void*, ULONG*); | |
115 USHORT (*drv_Clear)(USHORT); | |
116 USHORT (*drv_Flush)(void); | |
117 USHORT (*drv_SetSignal)(USHORT); | |
118 USHORT (*drv_ResetSignal)(USHORT); | |
119 USHORT (*drv_SetConfig)(char*); | |
120 USHORT (*drv_GetConfig)(char*); | |
121 void (*drv_Callback)(T_DRV_SIGNAL*); | |
122 } T_DRV_FUNC; | |
123 | |
124 typedef struct _T_DRV_EXPORT | |
125 { | |
126 const char *Name; | |
127 USHORT Flags; /* Bit (0): CALLED_BY_ISR */ | |
128 T_DRV_FUNC DrvFunc; | |
129 } T_DRV_EXPORT; | |
130 | |
131 | |
132 typedef struct | |
133 { | |
134 char const *Name; | |
135 USHORT (*drv_Init)(USHORT, T_DRV_CB_FUNC, T_DRV_EXPORT const **); | |
136 char const *Process; | |
137 void const *DrvConfig; | |
138 } T_DRV_LIST_ENTRY; | |
139 | |
140 typedef struct | |
141 { | |
142 T_DRV_LIST_ENTRY DrvEntry [ 5 ]; | |
143 } T_DRV_LIST; | |
144 | |
145 /*==== END OF FILE ==========================================================*/ | |
146 #endif |