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