sl@0: // Copyright (c) 2007-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 "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: // This is a header file to define wins specific classes and info sl@0: // sl@0: // sl@0: sl@0: #ifndef __D_EXPIO_EMUL_H__ sl@0: #define __D_EXPIO_EMUL_H__ sl@0: sl@0: // pdd include file sl@0: #include "d_expio_pdd.h" sl@0: sl@0: // include files sl@0: #include // comm header file sl@0: sl@0: // DFC related constants sl@0: // sl@0: _LIT(KExEmulUartDfcName,"ExEmulUartDfc"); // Name of the DFC thread sl@0: const TInt KExEmulUartDfcPriority=26; // DFC thread priority sl@0: sl@0: // UART FIFO sizes sl@0: const TInt KTxFifoSize=64; // 64bytes fifo sl@0: const TInt KRxFifoSize=64; // 64bytes fifo sl@0: sl@0: // Timer constants sl@0: const TInt KRxPollTimeout=1; // 1ms sl@0: const TInt KTimerStarted=1; sl@0: const TInt KTimerExpired=0; sl@0: const TInt KTimerCancelled=-1; sl@0: sl@0: sl@0: /** sl@0: * Physical device class specific for Emulator UART Physical Device Driver (PDD) sl@0: */ sl@0: class DExEmulPhysicalDevice: public DExDriverPhysicalDevice sl@0: { sl@0: public: sl@0: DExEmulPhysicalDevice(); sl@0: ~DExEmulPhysicalDevice(); // Destructor sl@0: TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, sl@0: const TVersion& aVer); sl@0: }; sl@0: sl@0: /** sl@0: Hardware peripheral class sl@0: sl@0: Target specific class, H4 uart controller. This class sl@0: is accessed from physical channel class. It's object sl@0: is created in physical channel DoCreate()and deleted sl@0: in it's destructor sl@0: */ sl@0: class DExUartPhysicalChannelEmul:public DExDriverPhysicalChannel sl@0: { sl@0: public: sl@0: // Public functions access to all sl@0: DExUartPhysicalChannelEmul(); // Constructor sl@0: ~DExUartPhysicalChannelEmul(); // Destructor sl@0: TInt DoCreate(TInt aUnit, const TDesC8* aInfo, sl@0: const TVersion& aVer); // 2nd Stage constructor sl@0: void Caps(TDes8& aCaps); // Get channel Capabilities sl@0: TInt Configure(const TCommConfigV01& aConfig); // Configure the uart sl@0: TInt TransmitData(const TDesC8& aData); // Transmit data to uart sl@0: TInt ReceiveData(TDes8& aData,TInt aLen); // Receive data from uart sl@0: TDynamicDfcQue* DfcQ(); // DFC queue creation sl@0: private: sl@0: static void RxPollTimerCallback(TAny* aPtr); sl@0: private: sl@0: TBool iConfigured; // Channel configuration status; sl@0: TBps iBaudRate; sl@0: NTimer iRxPollTimer; // Timer to poll for Rx data sl@0: TInt iTimerStatus; // Rx data timer status sl@0: // Windows handle for com port sl@0: HANDLE hCommPort; sl@0: DWORD iBytesRead; sl@0: DWORD iBytesWritten; sl@0: }; sl@0: sl@0: #endif // __D_EXPIO_EMUL_H__ sl@0: sl@0: // sl@0: // End of d_expio_emul.h