Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / KernelLand / Kernel / include / meta_serial.h
1 /*
2  * Acess2 Kernel
3  * - By John Hodge (thePowersGang)
4  *
5  * meta_serial.h
6  * - Wrapper for 'Serial' ports (UARTs and the like)
7  */
8 #ifndef _META_SERIAL_H_
9 #define _META_SERIAL_H_
10
11 typedef struct sSerialPort      tSerialPort;
12 typedef struct sSerialHandler   tSerialHandlers;
13
14 typedef int     (*tSerial_SetFmt)(void *Handle, Uint32 Format);
15 typedef int     (*tSerial_CanSend)(void *Handle);
16 typedef size_t  (*tSerial_Send)(void *Handle, size_t Bytes, const void *Data);
17
18 struct sSerialHandler
19 {
20         const char      *Class;
21         tSerial_SetFmt  SetFmt;
22         tSerial_CanSend CanSend;
23         tSerial_Send    Send;
24 };
25
26 extern tSerialPort      *Serial_AddPort(tSerialHandlers *Handlers, void *Handle, const char *Ident);
27 extern void     Serial_RemovePort(tSerialPort *Port);
28 extern void     Serial_RecieveData(tSerialPort *Port, size_t Bytes, const void *Data);
29
30 #endif

UCC git Repository :: git.ucc.asn.au