5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 Desc: Definitions for the Serial HIDD system.
13 # include <exec/types.h>
16 # include <hidd/hidd.h>
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;
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)
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
76 struct pHidd_Serial_DisposeUnit
83 /**** Serial Unit definitions ******************************************************/
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
109 VOID
*DataReceivedUserData
;
111 VOID
*WriteDataUserData
;
114 struct pHidd_SerialUnit_Write
121 struct pHidd_SerialUnit_SetBaudrate
127 struct pHidd_SerialUnit_SetParameters
130 struct TagItem
*tags
;
133 struct pHidd_SerialUnit_SendBreak
139 struct pHidd_SerialUnit_GetCapabilities
142 struct TagItem
* taglist
;
145 struct pHidd_SerialUnit_Start
150 struct pHidd_SerialUnit_Stop
155 struct pHidd_SerialUnit_GetStatus
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 */