0
|
1 |
// Copyright (c) 1997-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 the License "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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32test\device\t_fir2.h
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
//#include <es_sock.h>
|
|
19 |
#include <e32test.h>
|
|
20 |
#include <e32cons.h>
|
|
21 |
#include <e32svr.h>
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <d32comm.h>
|
|
24 |
#include <d32fir.h>
|
|
25 |
|
|
26 |
#ifndef __T_FIR2__
|
|
27 |
#define __T_FIR2__
|
|
28 |
|
|
29 |
#define PDD_NAME _L("difiba")
|
|
30 |
#define LDD_NAME _L("efir")
|
|
31 |
|
|
32 |
|
|
33 |
enum TXferType
|
|
34 |
{
|
|
35 |
EWriteXfer,
|
|
36 |
EReadXfer
|
|
37 |
};
|
|
38 |
|
|
39 |
class CActiveRW;
|
|
40 |
class CActiveConsole : public CActive
|
|
41 |
//-----------------------------------
|
|
42 |
{
|
|
43 |
public:
|
|
44 |
// Construction
|
|
45 |
CActiveConsole(CConsoleBase* aConsole);
|
|
46 |
static CActiveConsole* NewLC(CConsoleBase* aConsole);
|
|
47 |
void ConstructL();
|
|
48 |
|
|
49 |
// Destruction
|
|
50 |
~CActiveConsole();
|
|
51 |
|
|
52 |
// Issue request
|
|
53 |
void RequestCharacter();
|
|
54 |
|
|
55 |
// Cancel request.
|
|
56 |
// Defined as pure virtual by CActive;
|
|
57 |
// implementation provided by this class.
|
|
58 |
void DoCancel();
|
|
59 |
|
|
60 |
// Service completed request.
|
|
61 |
// Defined as pure virtual by CActive;
|
|
62 |
// implementation provided by this class,
|
|
63 |
void RunL();
|
|
64 |
|
|
65 |
void ProcessKeyPressL(TChar aChar);
|
|
66 |
|
|
67 |
void GetFirRegs();
|
|
68 |
void GetDmaReaderRegs();
|
|
69 |
void GetDmaWriterRegs();
|
|
70 |
void GetReadBufInfo();
|
|
71 |
void GetWriteBufInfo();
|
|
72 |
void GetChunkInfo();
|
|
73 |
void GetMiscInfo();
|
|
74 |
void Options1();
|
|
75 |
void Options2();
|
|
76 |
void Options3();
|
|
77 |
|
|
78 |
public:
|
|
79 |
// Data members defined by this class
|
|
80 |
CConsoleBase* iConsole; // A console for reading from
|
|
81 |
CActiveRW* iRW;
|
|
82 |
|
|
83 |
RDevFir iPort;
|
|
84 |
TBool iInit1;
|
|
85 |
TBool iInit2;
|
|
86 |
TBool iInit3;
|
|
87 |
TBps iBaudRate;
|
|
88 |
};
|
|
89 |
|
|
90 |
|
|
91 |
class CActiveRW : public CActive
|
|
92 |
//-----------------------------------------------------------
|
|
93 |
{
|
|
94 |
public:
|
|
95 |
// Construction
|
|
96 |
CActiveRW(CConsoleBase* aConsole,RDevFir* aPort);
|
|
97 |
static CActiveRW* NewL(CConsoleBase* aConsole,RDevFir* aPort);
|
|
98 |
void ConstructL();
|
|
99 |
|
|
100 |
~CActiveRW();
|
|
101 |
|
|
102 |
void Start(TBool StartWriting);
|
|
103 |
void Stop();
|
|
104 |
private:
|
|
105 |
void RunL ();
|
|
106 |
void DoCancel ();
|
|
107 |
|
|
108 |
|
|
109 |
private:
|
|
110 |
CConsoleBase* iConsole;
|
|
111 |
RDevFir* iPort;
|
|
112 |
TInt iLength;
|
|
113 |
TInt iNextXfer;
|
|
114 |
};
|
|
115 |
|
|
116 |
#endif // __T_FIR2__
|