Disable menu timeout.
[bertos.git] / drv / ser_p.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \brief Hardware dependent serial driver (interface)
9  *
10  * \version $Id$
11  *
12  * \author Stefano Fedrigo <aleph@develer.com>
13  * \author Giovanni Bajo <rasky@develer.com>
14  */
15
16 /*#*
17  *#* $Log$
18  *#* Revision 1.9  2006/02/17 22:23:06  bernie
19  *#* Update POSIX serial emulator.
20  *#*
21  *#* Revision 1.8  2005/11/04 16:20:02  bernie
22  *#* Fix reference to README.devlib in header.
23  *#*
24  *#* Revision 1.7  2005/01/14 00:47:56  aleph
25  *#* Rename callbacks; SerialHardwareVT.txSending: New callback.
26  *#*
27  *#* Revision 1.6  2004/12/08 08:56:58  bernie
28  *#* Reformat.
29  *#*
30  *#* Revision 1.5  2004/09/06 21:40:50  bernie
31  *#* Move buffer handling in chip-specific driver.
32  *#*
33  *#* Revision 1.4  2004/08/25 14:12:08  rasky
34  *#* Aggiornato il comment block dei log RCS
35  *#*
36  *#* Revision 1.3  2004/06/03 11:27:09  bernie
37  *#* Add dual-license information.
38  *#*
39  *#* Revision 1.2  2004/05/23 18:21:53  bernie
40  *#* Trim CVS logs and cleanup header info.
41  *#*
42  *#*/
43
44 #ifndef DRV_SER_P_H
45 #define DRV_SER_P_H
46
47 #include <cfg/compiler.h> /* size_t */
48
49 struct SerialHardware;
50 struct Serial;
51
52 struct SerialHardwareVT
53 {
54         void (*init)(struct SerialHardware *ctx, struct Serial *ser);
55         void (*cleanup)(struct SerialHardware *ctx);
56         void (*setBaudrate)(struct SerialHardware *ctx, unsigned long rate);
57         void (*setParity)(struct SerialHardware *ctx, int parity);
58         void (*txStart)(struct SerialHardware *ctx);
59         bool (*txSending)(struct SerialHardware *ctx);
60 };
61
62 struct SerialHardware
63 {
64         const struct SerialHardwareVT *table;
65         unsigned char *txbuffer;
66         unsigned char *rxbuffer;
67         size_t         txbuffer_size;
68         size_t         rxbuffer_size;
69 };
70
71 struct SerialHardware *ser_hw_getdesc(int unit);
72
73 #endif /* DRV_SER_P_H */