Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / hidds / serial / include / serial.h
blobe648d0be03eb60e8bb3f35242f3ab33ed37f8c95
1 #ifndef HIDD_SERIAL_H
2 #define HIDD_SERIAL_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Definitions for the Serial HIDD system.
9 Lang: english
12 #ifndef EXEC_TYPES_H
13 # include <exec/types.h>
14 #endif
15 #ifndef HIDD_HIDD_H
16 # include <hidd/hidd.h>
17 #endif
18 #ifndef OOP_OOP_H
19 # include <oop/oop.h>
20 #endif
22 #include <utility/utility.h>
25 #define CLID_Hidd_Serial "hidd.serial.serial"
26 #define CLID_Hidd_SerialUnit "hidd.serial.serialunit"
28 #define IID_Hidd_Serial "hidd.serial.serial"
29 #define IID_Hidd_SerialUnit "hidd.serial.serialunit"
32 /**** Some tags for taglists ***********************************************/
34 #define HIDDA_SerialUnit_BPSRate 0x0001
35 #define HIDDA_SerialUnit_DataLength 0x0002
37 /**** serial definitions ****************************************************/
39 //extern OOP_AttrBase HiddSerialUnitAB;
41 enum {
42 aoHidd_SerialUnit_Unit,
43 aoHidd_SerialUnit_BPSRate,
44 aoHidd_SerialUnit_DataLength,
46 num_Hidd_SerialUnit_Attrs
50 #define aHidd_SerialUnit_Unit (__IHidd_SerialUnitAB + aoHidd_SerialUnit_Unit)
51 #define aHidd_SerialUnit_BPSRate (__IHidd_SerialUnitAB + aoHidd_SerialUnit_BPSRate)
52 #define aHidd_SerialUnit_DataLength (__IHidd_SerialUnitAB + aoHidd_SerialUnit_DataLength)
54 #define IS_HIDDSERIALUNIT_ATTR(attr, idx) IS_IF_ATTR(attr, idx, __IHidd_SerialUnitAB, num_Hidd_SerialUnit_Attrs)
56 enum
58 /* Methods for a serial hidd */
60 moHidd_Serial_NewUnit = 0,
61 moHidd_Serial_DisposeUnit,
62 moHidd_Serial_NumMethods // always keep this the last one!
68 /* messages for a serial hidd */
70 struct pHidd_Serial_NewUnit
72 OOP_MethodID mID;
73 ULONG unitnum;
76 struct pHidd_Serial_DisposeUnit
78 OOP_MethodID mID;
79 OOP_Object *unit;
83 /**** Serial Unit definitions ******************************************************/
86 enum
88 /* Methods for a serial unit */
90 moHidd_SerialUnit_Init,
91 moHidd_SerialUnit_Write,
92 moHidd_SerialUnit_SetBaudrate,
93 moHidd_SerialUnit_SetParameters,
94 moHidd_SerialUnit_SendBreak,
95 moHidd_SerialUnit_Start,
96 moHidd_SerialUnit_Stop,
97 moHidd_SerialUnit_GetCapabilities,
98 moHidd_SerialUnit_GetStatus,
99 moHidd_SerialUnit_NumMethods // always keep this the last one!
103 /* messages for a serial unit */
105 struct pHidd_SerialUnit_Init
107 OOP_MethodID mID;
108 VOID *DataReceived;
109 VOID *DataReceivedUserData;
110 VOID *WriteData;
111 VOID *WriteDataUserData;
114 struct pHidd_SerialUnit_Write
116 OOP_MethodID mID;
117 ULONG Length;
118 UBYTE *Outbuffer;
121 struct pHidd_SerialUnit_SetBaudrate
123 OOP_MethodID mID;
124 ULONG baudrate;
127 struct pHidd_SerialUnit_SetParameters
129 OOP_MethodID mID;
130 struct TagItem *tags;
133 struct pHidd_SerialUnit_SendBreak
135 OOP_MethodID mID;
136 int duration;
139 struct pHidd_SerialUnit_GetCapabilities
141 OOP_MethodID mID;
142 struct TagItem * taglist;
145 struct pHidd_SerialUnit_Start
147 OOP_MethodID mID;
150 struct pHidd_SerialUnit_Stop
152 OOP_MethodID mID;
155 struct pHidd_SerialUnit_GetStatus
157 OOP_MethodID mID;
161 /* some tags for HIDD_SerialUnit_SetParameters() */
163 #define TAG_PARITY 0x1001
164 #define TAG_PARITY_OFF 0x1002
165 #define TAG_STOP_BITS 0x1003
166 #define TAG_DATALENGTH 0x1004
167 #define TAG_SET_MCR 0x1005
169 /* some values for parities */
171 #define PARITY_1 0x01
172 #define PARITY_0 0x02
173 #define PARITY_EVEN 0x03
174 #define PARITY_ODD 0x04
177 /* for range values - for example on baudrates */
178 #define LIMIT_LOWER_BOUND 0x40000000
179 #define LIMIT_UPPER_BOUND 0x80000000
183 /* Predeclarations of stubs in libhiddserialstubs */
185 OOP_Object * HIDD_Serial_NewUnit(OOP_Object *obj, ULONG unitnum);
186 VOID HIDD_Serial_DisposeUnit(OOP_Object *obj, OOP_Object *unit);
188 BOOL HIDD_SerialUnit_Init (OOP_Object *obj, VOID * DataReceived, VOID * DataReceivedUserData, VOID * WriteData, VOID * WriteDataUserData);
189 ULONG HIDD_SerialUnit_Write (OOP_Object *obj, UBYTE * data, ULONG length);
190 BOOL HIDD_SerialUnit_SetBaudrate(OOP_Object *obj, ULONG baudrate);
191 BOOL HIDD_SerialUnit_SetParameters(OOP_Object *obj, struct TagItem *tags);
192 BYTE HIDD_SerialUnit_SendBreak(OOP_Object *obj, int duration);
193 VOID HIDD_SerialUnit_Stop(OOP_Object * obj);
194 VOID HIDD_SerialUnit_Start(OOP_Object * obj);
195 VOID HIDD_SerialUnit_GetCapabilities(OOP_Object *obj, struct TagItem *tags);
196 UWORD HIDD_SerialUnit_GetStatus(OOP_Object *obj);
198 #endif /* HIDD_SERIAL_H */