1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #ifndef _SYS_SERIAL_H_
23 #define _SYS_SERIAL_H_
31 #define KNotifyBreakInt 0x01
32 #define KNotifyCD 0x02
33 #define KNotifyCTS 0x04
34 #define KNotifyDataAvailable 0x08
35 #define KNotifyDSR 0x10
36 #define KNotifyFramingError 0x20
37 #define KNotifyOutputEmpty 0x40
38 #define KNotifyOverrunError 0x80
39 #define KNotifyParityError 0x100
40 #define KNotifyRI 0x200
43 enums, #defines and struct for serial port settings
45 enum DataBits {DBits5,DBits6,DBits7,DBits8};
47 enum StopBits {Stop1,Stop2};
49 enum Parity {ParityNone,ParityEven,ParityOdd,ParityMark,ParitySpace};
53 Bps50,Bps75,Bps110,Bps134,Bps150,Bps300,Bps600,Bps1200,
54 Bps1800,Bps2000,Bps2400,Bps3600,Bps4800,Bps7200,Bps9600,
55 Bps19200,Bps38400,Bps57600,Bps115200,Bps230400,Bps460800,
56 Bps576000,Bps1152000,Bps4000000,
60 enum Fifo {FifoEnable,FifoDisable};
62 enum Sir {SIREnable,SIRDisable};
64 #define ConfigMaxTerminators 4
66 #define ConfigObeyXoff 0x01
67 #define ConfigSendXoff 0x02
68 #define ConfigObeyCTS 0x04
69 #define ConfigFailCTS 0x08
70 #define ConfigObeyDSR 0x10
71 #define ConfigFailDSR 0x20
72 #define ConfigObeyDCD 0x40
73 #define ConfigFailDCD 0x80
74 #define ConfigFreeRTS 0x100
75 #define ConfigFreeDTR 0x200
76 #define ConfigWriteBufferedComplete 0x80000000
78 #define ConfigParityErrorFail 0
79 #define ConfigParityErrorIgnore 0x01
80 #define ConfigParityErrorReplaceChar 0x02
81 #define ConfigXonXoffDebug 0x80000000
83 #define SignalCTS 0x01
84 #define SignalDSR 0x02
85 #define SignalDCD 0x04
86 #define SignalRNG 0x08
87 #define SignalRTS 0x10
88 #define SignalDTR 0x20
90 #define ConfigSIRPulseWidthMaximum 0x01
91 #define ConfigSIRPulseWidthMinimum 0x02
97 enum DataBits iDataBits;
98 enum StopBits iStopBits;
100 unsigned int iHandshake;
101 unsigned int iParityError;
104 int iTerminatorCount;
105 char iTerminator[ConfigMaxTerminators];
108 char iParityErrorChar;
110 unsigned int iSIRSettings;