sl@0: // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\include\d32fir.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: #ifndef __FIRCOMM_H__ sl@0: #define __FIRCOMM_H__ sl@0: sl@0: enum chan{KReadChannel,KWriteChannel}; sl@0: sl@0: sl@0: class TCapsDevFir sl@0: { sl@0: public: sl@0: TVersion version; sl@0: }; sl@0: sl@0: class TFirConfigV01 sl@0: { sl@0: public: sl@0: TBps iRate; sl@0: }; sl@0: typedef TPckgBuf TFirConfig; sl@0: sl@0: const TUint KCapsFirBps576000 =0x00080000; sl@0: const TUint KCapsFirBps1152000=0x00100000; sl@0: const TUint KCapsFirBps4000000=0x00200000; sl@0: sl@0: class TFirCapsV01 sl@0: { sl@0: public: sl@0: TUint iRate; sl@0: }; sl@0: typedef TPckgBuf TFirCaps; sl@0: sl@0: _LIT(KRDevFir,"Fastir"); sl@0: sl@0: class RDevFir : public RBusLogicalChannel sl@0: { sl@0: public: sl@0: enum TVer sl@0: { sl@0: EMajorVersion=1, sl@0: EMinorVersion=0, sl@0: EBuildVersion=1 sl@0: }; sl@0: sl@0: enum TRequest sl@0: { sl@0: // 0 to 3 (ie KMaxRequests) sl@0: EWriteReq=0x0,EWriteReqCancel=0x1, sl@0: EReadReq =0x1,EReadReqCancel =0x2, sl@0: }; sl@0: sl@0: enum TControl sl@0: { sl@0: KDebugWrite, sl@0: KControlConfig, sl@0: KControlSetConfig, sl@0: KControlCaps, sl@0: KFlushBuffers, sl@0: KSetBufferSize, sl@0: KSetRange, sl@0: sl@0: KGetDmaChunkInfo, sl@0: KGetRxBufInfo, sl@0: KGetTxBufInfo, sl@0: KGetDmaRxRegs, sl@0: KGetDmaTxRegs, sl@0: KGetFirRegs, sl@0: KGetInterruptsInfo, sl@0: KIsChunkFree, sl@0: }; sl@0: sl@0: public: sl@0: #ifndef __KERNEL_MODE__ sl@0: inline TInt Open(TInt aUnit=KNullUnit) sl@0: {return DoCreate(KRDevFir,VersionRequired(),aUnit,NULL,NULL);} sl@0: sl@0: inline void Write(TRequestStatus& aStatus, TDesC8& aDes, TInt aSize) sl@0: {DoRequest(EWriteReq,aStatus,(TAny *)&aDes,(TAny *)&aSize);} sl@0: sl@0: inline void Read(TRequestStatus& aStatus, TDes8& aDes, TInt aSize) sl@0: {DoRequest(EReadReq,aStatus,(TAny *)&aDes,(TAny *)&aSize);} sl@0: sl@0: inline void WriteCancel() sl@0: {DoCancel(EWriteReqCancel);} sl@0: sl@0: inline void ReadCancel() sl@0: {DoCancel(EReadReqCancel);} sl@0: sl@0: sl@0: inline TInt Config(TDes8& aConfig) sl@0: {return DoControl(KControlConfig,(TAny *)&aConfig);} sl@0: sl@0: inline TInt SetConfig(const TDes8& aConfig) sl@0: {return DoControl(KControlSetConfig,(TAny *)&aConfig);} sl@0: sl@0: inline TInt Caps(TDes8& aCaps) sl@0: {return DoControl(KControlCaps,(TAny *)&aCaps);} sl@0: sl@0: inline TInt FlushBuffers() sl@0: {return DoControl(KFlushBuffers);} sl@0: sl@0: inline TInt SetRange(TUint aPercentage) sl@0: {return DoControl(KSetRange,(TAny *)&aPercentage);} sl@0: sl@0: inline TVersion VersionRequired() const sl@0: {return TVersion(EMajorVersion,EMinorVersion,EBuildVersion);} sl@0: sl@0: //debugging stuff sl@0: inline void DebugWrite(TDes8& aDes) sl@0: {TInt len=aDes.Length();DoControl(KDebugWrite,(TAny *)&aDes,(TAny *)&(len));} sl@0: #endif sl@0: }; sl@0: sl@0: #endif // __FIRCOMM_H__