DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
[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 devlib/README 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.6  2004/12/08 08:56:58  bernie
19  *#* Reformat.
20  *#*
21  *#* Revision 1.5  2004/09/06 21:40:50  bernie
22  *#* Move buffer handling in chip-specific driver.
23  *#*
24  *#* Revision 1.4  2004/08/25 14:12:08  rasky
25  *#* Aggiornato il comment block dei log RCS
26  *#*
27  *#* Revision 1.3  2004/06/03 11:27:09  bernie
28  *#* Add dual-license information.
29  *#*
30  *#* Revision 1.2  2004/05/23 18:21:53  bernie
31  *#* Trim CVS logs and cleanup header info.
32  *#*
33  *#*/
34
35 #ifndef DRV_SER_P_H
36 #define DRV_SER_P_H
37
38 struct SerialHardware;
39 struct Serial;
40
41 struct SerialHardwareVT
42 {
43         void (*init)(struct SerialHardware *ctx, struct Serial *ser);
44         void (*cleanup)(struct SerialHardware *ctx);
45         void (*setbaudrate)(struct SerialHardware *ctx, unsigned long rate);
46         void (*setparity)(struct SerialHardware *ctx, int parity);
47         void (*enabletxirq)(struct SerialHardware *ctx);
48 };
49
50 struct SerialHardware
51 {
52         const struct SerialHardwareVT *table;
53         unsigned char *txbuffer;
54         unsigned char *rxbuffer;
55         size_t         txbuffer_size;
56         size_t         rxbuffer_size;
57 };
58
59 struct SerialHardware *ser_hw_getdesc(int unit);
60
61 #endif /* DRV_SER_P_H */