os/ossrv/genericopenlibs/cstdlib/LINCSYS/serial.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @publishedAll
sl@0
    19
 @released
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef _SYS_SERIAL_H_
sl@0
    23
#define _SYS_SERIAL_H_
sl@0
    24
sl@0
    25
#ifdef __cplusplus
sl@0
    26
extern "C" {
sl@0
    27
#endif
sl@0
    28
/**
sl@0
    29
notifications
sl@0
    30
*/
sl@0
    31
#define	KNotifyBreakInt				0x01
sl@0
    32
#define	KNotifyCD					0x02
sl@0
    33
#define	KNotifyCTS					0x04
sl@0
    34
#define	KNotifyDataAvailable		0x08
sl@0
    35
#define	KNotifyDSR					0x10
sl@0
    36
#define	KNotifyFramingError			0x20
sl@0
    37
#define	KNotifyOutputEmpty			0x40
sl@0
    38
#define	KNotifyOverrunError			0x80
sl@0
    39
#define	KNotifyParityError			0x100
sl@0
    40
#define	KNotifyRI					0x200
sl@0
    41
sl@0
    42
/**
sl@0
    43
enums, #defines and struct for serial port settings
sl@0
    44
*/
sl@0
    45
enum DataBits {DBits5,DBits6,DBits7,DBits8};
sl@0
    46
sl@0
    47
enum StopBits {Stop1,Stop2};
sl@0
    48
sl@0
    49
enum Parity {ParityNone,ParityEven,ParityOdd,ParityMark,ParitySpace};
sl@0
    50
sl@0
    51
enum Bps
sl@0
    52
	{
sl@0
    53
	Bps50,Bps75,Bps110,Bps134,Bps150,Bps300,Bps600,Bps1200,
sl@0
    54
	Bps1800,Bps2000,Bps2400,Bps3600,Bps4800,Bps7200,Bps9600,
sl@0
    55
	Bps19200,Bps38400,Bps57600,Bps115200,Bps230400,Bps460800,
sl@0
    56
	Bps576000,Bps1152000,Bps4000000,
sl@0
    57
	BpsSpecial=0x80000000
sl@0
    58
	};
sl@0
    59
sl@0
    60
enum Fifo {FifoEnable,FifoDisable};
sl@0
    61
sl@0
    62
enum Sir {SIREnable,SIRDisable};
sl@0
    63
//
sl@0
    64
#define ConfigMaxTerminators 4
sl@0
    65
//
sl@0
    66
#define ConfigObeyXoff 0x01
sl@0
    67
#define ConfigSendXoff 0x02
sl@0
    68
#define ConfigObeyCTS 0x04
sl@0
    69
#define ConfigFailCTS 0x08
sl@0
    70
#define ConfigObeyDSR 0x10
sl@0
    71
#define ConfigFailDSR 0x20
sl@0
    72
#define ConfigObeyDCD 0x40
sl@0
    73
#define ConfigFailDCD 0x80
sl@0
    74
#define ConfigFreeRTS 0x100
sl@0
    75
#define ConfigFreeDTR 0x200
sl@0
    76
#define ConfigWriteBufferedComplete 0x80000000
sl@0
    77
//
sl@0
    78
#define ConfigParityErrorFail 0
sl@0
    79
#define ConfigParityErrorIgnore 0x01
sl@0
    80
#define ConfigParityErrorReplaceChar 0x02
sl@0
    81
#define ConfigXonXoffDebug 0x80000000
sl@0
    82
//
sl@0
    83
#define SignalCTS 0x01
sl@0
    84
#define SignalDSR 0x02
sl@0
    85
#define SignalDCD 0x04
sl@0
    86
#define SignalRNG 0x08
sl@0
    87
#define SignalRTS 0x10
sl@0
    88
#define SignalDTR 0x20
sl@0
    89
sl@0
    90
#define ConfigSIRPulseWidthMaximum 0x01
sl@0
    91
#define ConfigSIRPulseWidthMinimum 0x02
sl@0
    92
//
sl@0
    93
sl@0
    94
typedef struct
sl@0
    95
	{
sl@0
    96
	enum Bps iRate;
sl@0
    97
	enum DataBits iDataBits;
sl@0
    98
	enum StopBits iStopBits;
sl@0
    99
	enum Parity iParity;
sl@0
   100
	unsigned int iHandshake;
sl@0
   101
	unsigned int iParityError;
sl@0
   102
	unsigned int iFifo;
sl@0
   103
	int iSpecialRate;
sl@0
   104
	int iTerminatorCount;
sl@0
   105
	char iTerminator[ConfigMaxTerminators];
sl@0
   106
	char iXonChar;
sl@0
   107
	char iXoffChar;
sl@0
   108
	char iParityErrorChar;
sl@0
   109
	enum Sir iSIREnable;
sl@0
   110
	unsigned int iSIRSettings;
sl@0
   111
	} SerialConfig;
sl@0
   112
sl@0
   113
#ifdef __cplusplus
sl@0
   114
}
sl@0
   115
#endif
sl@0
   116
sl@0
   117
#endif