os/boardsupport/emulator/emulatorbsp/test/exdriver/exdriver_pio/inc/d_expio_emul.h
Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This is a header file to define wins specific classes and info
18 #ifndef __D_EXPIO_EMUL_H__
19 #define __D_EXPIO_EMUL_H__
22 #include "d_expio_pdd.h"
25 #include <d32comm.h> // comm header file
27 // DFC related constants
29 _LIT(KExEmulUartDfcName,"ExEmulUartDfc"); // Name of the DFC thread
30 const TInt KExEmulUartDfcPriority=26; // DFC thread priority
33 const TInt KTxFifoSize=64; // 64bytes fifo
34 const TInt KRxFifoSize=64; // 64bytes fifo
37 const TInt KRxPollTimeout=1; // 1ms
38 const TInt KTimerStarted=1;
39 const TInt KTimerExpired=0;
40 const TInt KTimerCancelled=-1;
44 * Physical device class specific for Emulator UART Physical Device Driver (PDD)
46 class DExEmulPhysicalDevice: public DExDriverPhysicalDevice
49 DExEmulPhysicalDevice();
50 ~DExEmulPhysicalDevice(); // Destructor
51 TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo,
52 const TVersion& aVer);
56 Hardware peripheral class
58 Target specific class, H4 uart controller. This class
59 is accessed from physical channel class. It's object
60 is created in physical channel DoCreate()and deleted
63 class DExUartPhysicalChannelEmul:public DExDriverPhysicalChannel
66 // Public functions access to all
67 DExUartPhysicalChannelEmul(); // Constructor
68 ~DExUartPhysicalChannelEmul(); // Destructor
69 TInt DoCreate(TInt aUnit, const TDesC8* aInfo,
70 const TVersion& aVer); // 2nd Stage constructor
71 void Caps(TDes8& aCaps); // Get channel Capabilities
72 TInt Configure(const TCommConfigV01& aConfig); // Configure the uart
73 TInt TransmitData(const TDesC8& aData); // Transmit data to uart
74 TInt ReceiveData(TDes8& aData,TInt aLen); // Receive data from uart
75 TDynamicDfcQue* DfcQ(); // DFC queue creation
77 static void RxPollTimerCallback(TAny* aPtr);
79 TBool iConfigured; // Channel configuration status;
81 NTimer iRxPollTimer; // Timer to poll for Rx data
82 TInt iTimerStatus; // Rx data timer status
83 // Windows handle for com port
89 #endif // __D_EXPIO_EMUL_H__
92 // End of d_expio_emul.h