os/kernelhwsrv/kerneltest/e32test/device/t_fir.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
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_fir.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 <d32comm.h>
sl@0
    22
#include <d32fir.h>
sl@0
    23
sl@0
    24
#ifndef __T_FIR__
sl@0
    25
#define __T_FIR__ 
sl@0
    26
sl@0
    27
#define PDD_NAME _L("difiba")
sl@0
    28
#define LDD_NAME _L("efir")
sl@0
    29
sl@0
    30
sl@0
    31
class CActiveWriter;
sl@0
    32
class CActiveReader;
sl@0
    33
class CActiveConsole : public CActive
sl@0
    34
//-----------------------------------
sl@0
    35
	{
sl@0
    36
public:
sl@0
    37
	  // Construction
sl@0
    38
	CActiveConsole(CConsoleBase* aConsole);
sl@0
    39
	static CActiveConsole* NewLC(CConsoleBase* aConsole);
sl@0
    40
	void ConstructL();
sl@0
    41
sl@0
    42
	  // Destruction
sl@0
    43
	~CActiveConsole();
sl@0
    44
sl@0
    45
	  // Issue request
sl@0
    46
	void RequestCharacter();
sl@0
    47
	
sl@0
    48
	  // Cancel request.
sl@0
    49
	  // Defined as pure virtual by CActive;
sl@0
    50
	  // implementation provided by this class.
sl@0
    51
	void DoCancel();
sl@0
    52
sl@0
    53
	  // Service completed request.
sl@0
    54
	  // Defined as pure virtual by CActive;
sl@0
    55
	  // implementation provided by this class,
sl@0
    56
	void RunL();
sl@0
    57
sl@0
    58
	void ProcessKeyPressL(TChar aChar);
sl@0
    59
sl@0
    60
	void GetFirRegs();
sl@0
    61
	void GetDmaReaderRegs();
sl@0
    62
	void GetDmaWriterRegs();
sl@0
    63
	void GetReadBufInfo();
sl@0
    64
	void GetWriteBufInfo();
sl@0
    65
	void GetChunkInfo();
sl@0
    66
	void GetMiscInfo();
sl@0
    67
	void SetUpBuffers();
sl@0
    68
	void Options1();
sl@0
    69
	void Options2();
sl@0
    70
	void Options3();
sl@0
    71
public:
sl@0
    72
	  // Data members defined by this class
sl@0
    73
	CConsoleBase*   iConsole;	// A console for reading from
sl@0
    74
	CActiveWriter*  iWriter;	// Client wrapper for CObexClient
sl@0
    75
	CActiveReader*  iReader;	// Client wrapper for CObexServer
sl@0
    76
	RDevFir iPort;
sl@0
    77
	TBool iInit1;
sl@0
    78
	TBool iInit2;
sl@0
    79
	TBool iInit3;
sl@0
    80
	TBps iBaudRate;
sl@0
    81
	};
sl@0
    82
sl@0
    83
sl@0
    84
class CActiveWriter : public CActive
sl@0
    85
//-----------------------------------------------------------
sl@0
    86
	{
sl@0
    87
public:
sl@0
    88
	// Construction
sl@0
    89
	CActiveWriter(CConsoleBase* aConsole,RDevFir* aPort);
sl@0
    90
	static CActiveWriter* NewL(CConsoleBase* aConsole,RDevFir* aPort);
sl@0
    91
	void ConstructL();
sl@0
    92
sl@0
    93
	~CActiveWriter();
sl@0
    94
sl@0
    95
	void Start();
sl@0
    96
	void Stop();
sl@0
    97
private:
sl@0
    98
	void RunL ();
sl@0
    99
	void DoCancel ();
sl@0
   100
sl@0
   101
sl@0
   102
private:
sl@0
   103
	CConsoleBase* iConsole;
sl@0
   104
	RDevFir* iPort;
sl@0
   105
	TInt iLength;
sl@0
   106
	};
sl@0
   107
sl@0
   108
sl@0
   109
class CActiveReader : public CActive
sl@0
   110
//-----------------------------------------------------------
sl@0
   111
	{
sl@0
   112
public:
sl@0
   113
	// Construction
sl@0
   114
	CActiveReader(CConsoleBase* aConsole,RDevFir* aPort);
sl@0
   115
	static CActiveReader* NewL(CConsoleBase* aConsole,RDevFir* aPort);
sl@0
   116
	void ConstructL();
sl@0
   117
sl@0
   118
	virtual ~CActiveReader();
sl@0
   119
sl@0
   120
	void Start();
sl@0
   121
	void Stop();
sl@0
   122
private:
sl@0
   123
	void RunL ();
sl@0
   124
	void DoCancel ();
sl@0
   125
sl@0
   126
	void ResetReadBuffer();
sl@0
   127
	TBool CompareBuffers(TInt aLen);
sl@0
   128
sl@0
   129
private:
sl@0
   130
	CConsoleBase* iConsole;
sl@0
   131
	RDevFir* iPort;
sl@0
   132
sl@0
   133
	};
sl@0
   134
sl@0
   135
#endif  // __T_FIR__