sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: /**
sl@0:  @file
sl@0:  @publishedAll
sl@0:  @released
sl@0: */
sl@0: 
sl@0: #ifndef _SYS_SERIAL_H_
sl@0: #define _SYS_SERIAL_H_
sl@0: 
sl@0: #ifdef __cplusplus
sl@0: extern "C" {
sl@0: #endif
sl@0: /**
sl@0: notifications
sl@0: */
sl@0: #define	KNotifyBreakInt				0x01
sl@0: #define	KNotifyCD					0x02
sl@0: #define	KNotifyCTS					0x04
sl@0: #define	KNotifyDataAvailable		0x08
sl@0: #define	KNotifyDSR					0x10
sl@0: #define	KNotifyFramingError			0x20
sl@0: #define	KNotifyOutputEmpty			0x40
sl@0: #define	KNotifyOverrunError			0x80
sl@0: #define	KNotifyParityError			0x100
sl@0: #define	KNotifyRI					0x200
sl@0: 
sl@0: /**
sl@0: enums, #defines and struct for serial port settings
sl@0: */
sl@0: enum DataBits {DBits5,DBits6,DBits7,DBits8};
sl@0: 
sl@0: enum StopBits {Stop1,Stop2};
sl@0: 
sl@0: enum Parity {ParityNone,ParityEven,ParityOdd,ParityMark,ParitySpace};
sl@0: 
sl@0: enum Bps
sl@0: 	{
sl@0: 	Bps50,Bps75,Bps110,Bps134,Bps150,Bps300,Bps600,Bps1200,
sl@0: 	Bps1800,Bps2000,Bps2400,Bps3600,Bps4800,Bps7200,Bps9600,
sl@0: 	Bps19200,Bps38400,Bps57600,Bps115200,Bps230400,Bps460800,
sl@0: 	Bps576000,Bps1152000,Bps4000000,
sl@0: 	BpsSpecial=0x80000000
sl@0: 	};
sl@0: 
sl@0: enum Fifo {FifoEnable,FifoDisable};
sl@0: 
sl@0: enum Sir {SIREnable,SIRDisable};
sl@0: //
sl@0: #define ConfigMaxTerminators 4
sl@0: //
sl@0: #define ConfigObeyXoff 0x01
sl@0: #define ConfigSendXoff 0x02
sl@0: #define ConfigObeyCTS 0x04
sl@0: #define ConfigFailCTS 0x08
sl@0: #define ConfigObeyDSR 0x10
sl@0: #define ConfigFailDSR 0x20
sl@0: #define ConfigObeyDCD 0x40
sl@0: #define ConfigFailDCD 0x80
sl@0: #define ConfigFreeRTS 0x100
sl@0: #define ConfigFreeDTR 0x200
sl@0: #define ConfigWriteBufferedComplete 0x80000000
sl@0: //
sl@0: #define ConfigParityErrorFail 0
sl@0: #define ConfigParityErrorIgnore 0x01
sl@0: #define ConfigParityErrorReplaceChar 0x02
sl@0: #define ConfigXonXoffDebug 0x80000000
sl@0: //
sl@0: #define SignalCTS 0x01
sl@0: #define SignalDSR 0x02
sl@0: #define SignalDCD 0x04
sl@0: #define SignalRNG 0x08
sl@0: #define SignalRTS 0x10
sl@0: #define SignalDTR 0x20
sl@0: 
sl@0: #define ConfigSIRPulseWidthMaximum 0x01
sl@0: #define ConfigSIRPulseWidthMinimum 0x02
sl@0: //
sl@0: 
sl@0: typedef struct
sl@0: 	{
sl@0: 	enum Bps iRate;
sl@0: 	enum DataBits iDataBits;
sl@0: 	enum StopBits iStopBits;
sl@0: 	enum Parity iParity;
sl@0: 	unsigned int iHandshake;
sl@0: 	unsigned int iParityError;
sl@0: 	unsigned int iFifo;
sl@0: 	int iSpecialRate;
sl@0: 	int iTerminatorCount;
sl@0: 	char iTerminator[ConfigMaxTerminators];
sl@0: 	char iXonChar;
sl@0: 	char iXoffChar;
sl@0: 	char iParityErrorChar;
sl@0: 	enum Sir iSIREnable;
sl@0: 	unsigned int iSIRSettings;
sl@0: 	} SerialConfig;
sl@0: 
sl@0: #ifdef __cplusplus
sl@0: }
sl@0: #endif
sl@0: 
sl@0: #endif