X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fser.h;h=a41084a75e1be9ae937eae7e81c95a7d94fe943c;hb=be670d92a85770cfa7edcbaca9a94032ddf1b114;hp=e43505566443e6adfc9b817a29c9961596fe106c;hpb=d8c41d44af59c3b699736024da1ccc11efa52384;p=bertos.git diff --git a/drv/ser.h b/drv/ser.h index e4350556..a41084a7 100755 --- a/drv/ser.h +++ b/drv/ser.h @@ -12,32 +12,49 @@ * \author Bernardo Innocenti */ -/* - * $Log$ - * Revision 1.7 2004/07/30 14:15:53 rasky - * Nuovo supporto unificato per detect della CPU - * - * Revision 1.6 2004/07/29 22:57:09 bernie - * ser_drain(): New function; Make Serial::is_open a debug-only feature; Switch to new-style CONFIG_* macros. - * - * Revision 1.5 2004/07/18 21:54:23 bernie - * Add ATmega8 support. - * - * Revision 1.4 2004/06/03 11:27:09 bernie - * Add dual-license information. - * - * Revision 1.3 2004/06/02 21:35:24 aleph - * Serial enhancements: interruptible receive handler and 8 bit serial status for AVR; remove volatile attribute to FIFOBuffer, useless for new fifobuf routens - * - * Revision 1.2 2004/05/23 18:21:53 bernie - * Trim CVS logs and cleanup header info. - * - */ +/*#* + *#* $Log$ + *#* Revision 1.13 2004/09/14 21:04:57 bernie + *#* Don't vanely call kdebug.h. + *#* + *#* Revision 1.12 2004/09/06 21:40:50 bernie + *#* Move buffer handling in chip-specific driver. + *#* + *#* Revision 1.11 2004/08/25 14:12:08 rasky + *#* Aggiornato il comment block dei log RCS + *#* + *#* Revision 1.10 2004/08/24 16:20:48 bernie + *#* ser_read(): Make buffer argument void *#* for consistency with ANSI C and ser_write() + *#* + *#* Revision 1.9 2004/08/15 05:32:22 bernie + *#* ser_resync(): New function. + *#* + *#* Revision 1.8 2004/08/02 20:20:29 aleph + *#* Merge from project_ks + *#* + *#* Revision 1.7 2004/07/30 14:15:53 rasky + *#* Nuovo supporto unificato per detect della CPU + *#* + *#* Revision 1.6 2004/07/29 22:57:09 bernie + *#* ser_drain(): New function; Make Serial::is_open a debug-only feature; Switch to new-style CONFIG_* macros. + *#* + *#* Revision 1.5 2004/07/18 21:54:23 bernie + *#* Add ATmega8 support. + *#* + *#* Revision 1.4 2004/06/03 11:27:09 bernie + *#* Add dual-license information. + *#* + *#* Revision 1.3 2004/06/02 21:35:24 aleph + *#* Serial enhancements: interruptible receive handler and 8 bit serial status for AVR; remove volatile attribute to FIFOBuffer, useless for new fifobuf routens + *#* + *#* Revision 1.2 2004/05/23 18:21:53 bernie + *#* Trim CVS logs and cleanup header info. + *#* + *#*/ #ifndef DRV_SER_H #define DRV_SER_H #include -#include #include #include @@ -108,10 +125,9 @@ enum #else #error unknown architecture #endif - - SER_CNT /**< Number of serial ports */ + SER_CNT /*!< Number of serial ports */ }; -/* @} */ +/*\}*/ struct SerialHardware; @@ -125,10 +141,12 @@ struct Serial /*! Physical port number */ unsigned int unit; - DB(bool is_open;) +#ifdef _DEBUG + bool is_open; +#endif /*! - * \name FIFO transmit and receive buffers. + * \name Transmit and receive FIFOs. * * Declared volatile because handled asinchronously by interrupts. * @@ -136,8 +154,6 @@ struct Serial */ FIFOBuffer txfifo; FIFOBuffer rxfifo; - unsigned char txbuffer[CONFIG_SER_TXBUFSIZE]; - unsigned char rxbuffer[CONFIG_SER_RXBUFSIZE]; /* \} */ #if CONFIG_SER_RXTIMEOUT != -1 @@ -161,7 +177,7 @@ extern int ser_getchar(struct Serial *port); extern int ser_getchar_nowait(struct Serial *port); extern int ser_write(struct Serial *port, const void *buf, size_t len); -extern int ser_read(struct Serial *port, char *buf, size_t size); +extern int ser_read(struct Serial *port, void *buf, size_t size); extern int ser_print(struct Serial *port, const char *s); extern int ser_printf(struct Serial *port, const char *format, ...) FORMAT(__printf__, 2, 3); @@ -172,6 +188,7 @@ extern int ser_gets_echo(struct Serial *port, char *buf, int size, bool echo); extern void ser_setbaudrate(struct Serial *port, unsigned long rate); extern void ser_setparity(struct Serial *port, int parity); extern void ser_settimeouts(struct Serial *port, time_t rxtimeout, time_t txtimeout); +extern void ser_resync(struct Serial *port, time_t delay); extern void ser_purge(struct Serial *port); extern void ser_drain(struct Serial *port);