00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _SYS_SERIAL_H_
00034 #define _SYS_SERIAL_H_
00035
00036 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00037 #define SYMBIAN
00038 #endif
00039
00040 #ifndef __SYMBIAN32__
00041
00042
00043
00044
00045
00046
00047
00048 #define SER_DTR 0x0001
00049 #define SER_RTS 0x0002
00050 #define SER_STX 0x0004
00051 #define SER_SRX 0x0008
00052 #define SER_CTS 0x0010
00053 #define SER_DCD 0x0020
00054 #define SER_RI 0x0040
00055 #define SER_DSR 0x0080
00056
00057
00058 #define SER_DELTA(x) ((x) << 8)
00059
00060 #define SER_DDTR SER_DELTA(SER_DTR)
00061 #define SER_DRTS SER_DELTA(SER_RTS)
00062 #define SER_DSTX SER_DELTA(SER_STX)
00063 #define SER_DSRX SER_DELTA(SER_SRX)
00064 #define SER_DCTS SER_DELTA(SER_CTS)
00065 #define SER_DDCD SER_DELTA(SER_DCD)
00066 #define SER_DRI SER_DELTA(SER_RI)
00067 #define SER_DDSR SER_DELTA(SER_DSR)
00068
00069 #else
00070
00073 #define KNotifyBreakInt 0x01
00074 #define KNotifyCD 0x02
00075 #define KNotifyCTS 0x04
00076 #define KNotifyDataAvailable 0x08
00077 #define KNotifyDSR 0x10
00078 #define KNotifyFramingError 0x20
00079 #define KNotifyOutputEmpty 0x40
00080 #define KNotifyOverrunError 0x80
00081 #define KNotifyParityError 0x100
00082 #define KNotifyRI 0x200
00083
00087 enum DataBits {DBits5,DBits6,DBits7,DBits8};
00088
00089 enum StopBits {Stop1,Stop2};
00090
00091 enum Parity {ParityNone,ParityEven,ParityOdd,ParityMark,ParitySpace};
00092
00093 enum Bps
00094 {
00095 Bps50,Bps75,Bps110,Bps134,Bps150,Bps300,Bps600,Bps1200,
00096 Bps1800,Bps2000,Bps2400,Bps3600,Bps4800,Bps7200,Bps9600,
00097 Bps19200,Bps38400,Bps57600,Bps115200,Bps230400,Bps460800,
00098 Bps576000,Bps1152000,Bps4000000,
00099 BpsSpecial=0x80000000
00100 };
00101
00102 enum Fifo {FifoEnable,FifoDisable};
00103
00104 enum Sir {SIREnable,SIRDisable};
00105
00106 #define ConfigMaxTerminators 4
00107
00108 #define ConfigObeyXoff 0x01
00109 #define ConfigSendXoff 0x02
00110 #define ConfigObeyCTS 0x04
00111 #define ConfigFailCTS 0x08
00112 #define ConfigObeyDSR 0x10
00113 #define ConfigFailDSR 0x20
00114 #define ConfigObeyDCD 0x40
00115 #define ConfigFailDCD 0x80
00116 #define ConfigFreeRTS 0x100
00117 #define ConfigFreeDTR 0x200
00118 #define ConfigWriteBufferedComplete 0x80000000
00119
00120 #define ConfigParityErrorFail 0
00121 #define ConfigParityErrorIgnore 0x01
00122 #define ConfigParityErrorReplaceChar 0x02
00123 #define ConfigXonXoffDebug 0x80000000
00124
00125 #define SignalCTS 0x01
00126 #define SignalDSR 0x02
00127 #define SignalDCD 0x04
00128 #define SignalRNG 0x08
00129 #define SignalRTS 0x10
00130 #define SignalDTR 0x20
00131
00132 #define ConfigSIRPulseWidthMaximum 0x01
00133 #define ConfigSIRPulseWidthMinimum 0x02
00134
00135
00136 typedef struct
00137 {
00138 enum Bps iRate;
00139 enum DataBits iDataBits;
00140 enum StopBits iStopBits;
00141 enum Parity iParity;
00142 unsigned int iHandshake;
00143 unsigned int iParityError;
00144 unsigned int iFifo;
00145 int iSpecialRate;
00146 int iTerminatorCount;
00147 char iTerminator[ConfigMaxTerminators];
00148 char iXonChar;
00149 char iXoffChar;
00150 char iParityErrorChar;
00151 enum Sir iSIREnable;
00152 unsigned int iSIRSettings;
00153 } SerialConfig;
00154
00155
00156 #endif
00157
00158 #endif