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