ser_p.h

Go to the documentation of this file.
00001 
00042 #ifndef DRV_SER_P_H
00043 #define DRV_SER_P_H
00044 
00045 #include <cfg/compiler.h> /* size_t */
00046 
00047 
00048 
00049 struct SerialHardware;
00050 struct Serial;
00051 
00052 struct SerialHardwareVT
00053 {
00054     void (*init)(struct SerialHardware *ctx, struct Serial *ser);
00055     void (*cleanup)(struct SerialHardware *ctx);
00056     void (*setBaudrate)(struct SerialHardware *ctx, unsigned long rate);
00057     void (*setParity)(struct SerialHardware *ctx, int parity);
00058     void (*txStart)(struct SerialHardware *ctx);
00059     bool (*txSending)(struct SerialHardware *ctx);
00060 };
00061 
00062 struct SerialHardware
00063 {
00064     const struct SerialHardwareVT *table;
00065     unsigned char *txbuffer;
00066     unsigned char *rxbuffer;
00067     size_t         txbuffer_size;
00068     size_t         rxbuffer_size;
00069 };
00070 
00071 struct SerialHardware *ser_hw_getdesc(int unit);
00072 
00073 
00074 
00075 #endif /* DRV_SER_P_H */