X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fser.h;h=a315562ab01a02fe30c600dd0fedbcf5f6ca3828;hb=6ca5e6259460b1541d1b6e6d3f1ac9734901f573;hp=358e2386e51de640ff1a4dccceaacbf0e45b3253;hpb=76c53bfa0136be55cf17e57b1ee098e5dfeefa70;p=bertos.git diff --git a/drv/ser.h b/drv/ser.h index 358e2386..a315562a 100755 --- a/drv/ser.h +++ b/drv/ser.h @@ -14,6 +14,18 @@ /*#* *#* $Log$ + *#* Revision 1.26 2006/05/18 00:39:13 bernie + *#* Add struct Serial friendly typedef. + *#* + *#* Revision 1.25 2006/02/17 22:28:00 bernie + *#* Rename ser_emul.c to ser_posix.c. + *#* + *#* Revision 1.24 2006/02/17 22:23:06 bernie + *#* Update POSIX serial emulator. + *#* + *#* Revision 1.23 2005/11/27 23:33:40 bernie + *#* Use appconfig.h instead of cfg/config.h. + *#* *#* Revision 1.22 2005/11/04 16:20:02 bernie *#* Fix reference to README.devlib in header. *#* @@ -83,8 +95,9 @@ #include #include -#include #include /* BV() */ +#include +#include /*! \name Serial Error/status flags. */ /*\{*/ @@ -120,7 +133,7 @@ #define SERRF_FRAMEERROR BV(9) /*!< Stop bit missing */ #define SERRF_NOISEERROR BV(10) /*!< Noise error */ #define SERRF_RXSROVERRUN BV(11) /*!< Rx shift register overrun */ -#elif defined(_EMUL) +#elif OS_HOSTED typedef uint16_t serstatus_t; /* Software errors */ @@ -128,13 +141,18 @@ #define SERRF_RXTIMEOUT BV(1) /*!< Receive timeout */ #define SERRF_TXTIMEOUT BV(2) /*!< Transmit timeout */ + /* Hardware errors */ + #define SERRF_RXSROVERRUN 0 /*!< Unsupported in emulated serial port. */ + #define SERRF_FRAMEERROR 0 /*!< Unsupported in emulated serial port. */ + #define SERRF_PARITYERROR 0 /*!< Unsupported in emulated serial port. */ + #define SERRF_NOISEERROR 0 /*!< Unsupported in emulated serial port. */ + #else #error unknown architecture #endif /*\}*/ -/*! \name Masks to group TX/RX errors. */ -/*\{*/ +/** Mask to group all RX errors. */ #define SERRF_RX \ ( SERRF_RXFIFOOVERRUN \ | SERRF_RXTIMEOUT \ @@ -142,8 +160,9 @@ | SERRF_PARITYERROR \ | SERRF_FRAMEERROR \ | SERRF_NOISEERROR) + +/** Mask to group all TX errors. */ #define SERRF_TX (SERRF_TXTIMEOUT) -/*\}*/ /*! @@ -178,11 +197,9 @@ enum SER_UART0, SER_PUNTALI, SER_BARCODE, -#elif defined(_EMUL) +#elif OS_HOSTED SER_UART0, - #if CONFIG_EMUL_UART1 - SER_UART1, - #endif + SER_UART1, #else #error unknown architecture #endif @@ -197,7 +214,7 @@ struct SerialHardware; extern const char * const serial_errors[8]; /*! Serial handle structure */ -struct Serial +typedef struct Serial { /*! Physical port number */ unsigned int unit; @@ -229,7 +246,7 @@ struct Serial /*! Low-level interface to hardware. */ struct SerialHardware* hw; -}; +} Serial; /* Function prototypes */