os/kernelhwsrv/kernel/eka/include/d32fir.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) 1994-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
// e32\include\d32fir.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @publishedPartner
sl@0
    21
 @released
sl@0
    22
*/
sl@0
    23
sl@0
    24
#include <e32cmn.h>
sl@0
    25
#include <e32ver.h>
sl@0
    26
sl@0
    27
sl@0
    28
#ifndef __FIRCOMM_H__
sl@0
    29
#define __FIRCOMM_H__
sl@0
    30
sl@0
    31
enum chan{KReadChannel,KWriteChannel};
sl@0
    32
sl@0
    33
sl@0
    34
class TCapsDevFir
sl@0
    35
      {
sl@0
    36
public:
sl@0
    37
      TVersion version;
sl@0
    38
      };
sl@0
    39
sl@0
    40
class TFirConfigV01
sl@0
    41
    {
sl@0
    42
public:
sl@0
    43
	TBps iRate;
sl@0
    44
	};
sl@0
    45
typedef TPckgBuf<TFirConfigV01> TFirConfig;
sl@0
    46
sl@0
    47
const TUint KCapsFirBps576000 =0x00080000;
sl@0
    48
const TUint KCapsFirBps1152000=0x00100000;
sl@0
    49
const TUint KCapsFirBps4000000=0x00200000;
sl@0
    50
sl@0
    51
class TFirCapsV01
sl@0
    52
	{
sl@0
    53
public:
sl@0
    54
	TUint iRate;
sl@0
    55
	};
sl@0
    56
typedef TPckgBuf<TFirCapsV01> TFirCaps;
sl@0
    57
sl@0
    58
_LIT(KRDevFir,"Fastir");
sl@0
    59
sl@0
    60
class RDevFir : public RBusLogicalChannel
sl@0
    61
	{
sl@0
    62
public:
sl@0
    63
	enum TVer
sl@0
    64
		{
sl@0
    65
		EMajorVersion=1,
sl@0
    66
		EMinorVersion=0,
sl@0
    67
		EBuildVersion=1
sl@0
    68
		};
sl@0
    69
sl@0
    70
	enum TRequest
sl@0
    71
		{
sl@0
    72
		// 0 to 3 (ie KMaxRequests)
sl@0
    73
		EWriteReq=0x0,EWriteReqCancel=0x1,
sl@0
    74
		EReadReq =0x1,EReadReqCancel =0x2,
sl@0
    75
		};
sl@0
    76
sl@0
    77
	enum TControl
sl@0
    78
		{
sl@0
    79
		KDebugWrite,
sl@0
    80
		KControlConfig,
sl@0
    81
		KControlSetConfig,
sl@0
    82
		KControlCaps,
sl@0
    83
		KFlushBuffers,
sl@0
    84
		KSetBufferSize,
sl@0
    85
		KSetRange,
sl@0
    86
sl@0
    87
		KGetDmaChunkInfo,
sl@0
    88
		KGetRxBufInfo,
sl@0
    89
		KGetTxBufInfo,
sl@0
    90
		KGetDmaRxRegs,
sl@0
    91
		KGetDmaTxRegs,
sl@0
    92
		KGetFirRegs,
sl@0
    93
		KGetInterruptsInfo,
sl@0
    94
		KIsChunkFree,
sl@0
    95
		};
sl@0
    96
sl@0
    97
public:	
sl@0
    98
#ifndef __KERNEL_MODE__
sl@0
    99
	inline TInt Open(TInt aUnit=KNullUnit)
sl@0
   100
		{return DoCreate(KRDevFir,VersionRequired(),aUnit,NULL,NULL);}
sl@0
   101
sl@0
   102
	inline void Write(TRequestStatus& aStatus, TDesC8& aDes, TInt aSize)
sl@0
   103
		{DoRequest(EWriteReq,aStatus,(TAny *)&aDes,(TAny *)&aSize);}
sl@0
   104
sl@0
   105
	inline void Read(TRequestStatus& aStatus, TDes8& aDes, TInt aSize)
sl@0
   106
		{DoRequest(EReadReq,aStatus,(TAny *)&aDes,(TAny *)&aSize);}
sl@0
   107
sl@0
   108
	inline void WriteCancel()
sl@0
   109
		{DoCancel(EWriteReqCancel);}
sl@0
   110
sl@0
   111
	inline void ReadCancel()
sl@0
   112
		{DoCancel(EReadReqCancel);}
sl@0
   113
sl@0
   114
sl@0
   115
	inline TInt Config(TDes8& aConfig)
sl@0
   116
		{return DoControl(KControlConfig,(TAny *)&aConfig);}
sl@0
   117
sl@0
   118
	inline TInt SetConfig(const TDes8& aConfig)
sl@0
   119
		{return DoControl(KControlSetConfig,(TAny *)&aConfig);}
sl@0
   120
sl@0
   121
	inline TInt Caps(TDes8& aCaps)
sl@0
   122
		{return DoControl(KControlCaps,(TAny *)&aCaps);}
sl@0
   123
sl@0
   124
	inline TInt FlushBuffers()
sl@0
   125
		{return DoControl(KFlushBuffers);}
sl@0
   126
sl@0
   127
	inline TInt SetRange(TUint aPercentage)
sl@0
   128
		{return DoControl(KSetRange,(TAny *)&aPercentage);}
sl@0
   129
sl@0
   130
	inline TVersion VersionRequired() const
sl@0
   131
		{return TVersion(EMajorVersion,EMinorVersion,EBuildVersion);}
sl@0
   132
sl@0
   133
	//debugging stuff
sl@0
   134
	inline void DebugWrite(TDes8& aDes)
sl@0
   135
		{TInt len=aDes.Length();DoControl(KDebugWrite,(TAny *)&aDes,(TAny *)&(len));}
sl@0
   136
#endif
sl@0
   137
	};
sl@0
   138
sl@0
   139
#endif  // __FIRCOMM_H__