added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / devs / parallel / parallel_intern.h
blob2df55d3f26d75fe5a0932ac4cc45286c492f7e24
1 #ifndef PARALLEL_INTERN_H
2 #define PARALLEL_INTERN_H
3 /*
4 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 $Id$
7 Desc: Private definitions for Parallel device.
8 Lang:
9 */
11 #ifndef AROS_LIBCALL_H
12 # include <aros/libcall.h>
13 #endif
14 #ifndef EXEC_EXECBASE_H
15 # include <exec/execbase.h>
16 #endif
17 #ifndef EXEC_DEVICES_H
18 # include <exec/devices.h>
19 #endif
20 #ifndef EXEC_SEMAPHORES_H
21 # include <exec/semaphores.h>
22 #endif
23 #ifndef DOS_DOS_H
24 # include <dos/dos.h>
25 #endif
26 #ifndef EXEC_SEMAPHORES_H
27 # include <exec/semaphores.h>
28 #endif
29 #ifndef EXEC_NODES_H
30 # include <exec/nodes.h>
31 #endif
32 #ifndef DEVICES_SERIAL_H
33 # include <devices/parallel.h>
34 #endif
35 #ifndef OOP_OOP_H
36 # include <oop/oop.h>
37 #endif
40 /* Predeclaration */
41 struct parallelbase;
44 struct ParallelUnit;
47 /* Prototypes */
48 struct ParallelUnit * findUnit(struct parallelbase * ParallelDevice,
49 ULONG unitnum);
52 ULONG RBF_InterruptHandler(UBYTE * data, ULONG length, ULONG unitnum, APTR userdata);
53 ULONG WBE_InterruptHandler(ULONG unitum, APTR userdata);
57 #define MINBUFSIZE 512
59 struct parallelbase
61 struct Device device;
63 struct List UnitList;
64 ULONG Status;
66 struct Library *ParallelHidd;
67 struct Library *oopBase;
69 OOP_Object *ParallelObject;
73 struct ParallelUnit
75 struct MinNode pu_Node;
76 OOP_Object * pu_Unit;
78 struct SignalSemaphore pu_Lock;
80 struct MsgPort pu_QReadCommandPort;
81 struct Message * pu_ActiveRead;
83 struct MsgPort pu_QWriteCommandPort;
84 struct Message * pu_ActiveWrite;
85 ULONG pu_NextToWrite; /* index in the buffer of next data to tx */
86 ULONG pu_WriteLength; /* Number of bytes left to tx */
88 ULONG pu_UnitNum;
89 ULONG pu_Flags; // copy of IOExtSer->io_SerFlags;
90 ULONG pu_Status;
92 ULONG pu_CtlChar;
93 struct IOPArray pu_PTermArray;
95 UBYTE pu_OpenerCount; // Count how many openers this unit has. Important in shared mode
99 /* a few flags for the status */
100 #define STATUS_CHANGING_IN_BUFFER 1 /* the user requested a change of the size
101 of the input buffer and is now changing
102 the input buffer. During this time
103 it could happen that the interrupt that
104 holds incoming bytes writes to a memory
105 location that would be invalid.
106 This tells the interrupt to simply drop
107 the data that it was about to write
108 to the input buffer.
110 #define STATUS_READS_PENDING 2
111 #define STATUS_WRITES_PENDING 4 /* When the task write the first byte into the UART
112 it has to set this flag.
113 When the HW-interrupt happens and there is
114 no more byte to write to the UART this
115 flag has to be cleared immediately
117 #define STATUS_BUFFEROVERFLOW 8 /* This flag indicates that an overflow
118 occurred with the internal receive
119 buffer. All further bytes will be
120 dropped until somebody reads the contents
121 of the buffer.
124 #ifdef OOPBase
125 #undef OOPBase
126 #endif
128 #define OOPBase (((struct parallelbase *)ParallelDevice)->oopBase)
130 #endif /* PARALLEL_INTERN_H */