os/boardsupport/emulator/emulatorbsp/test/exdriver/exdriver_pio/inc/d_expio_emul.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/boardsupport/emulator/emulatorbsp/test/exdriver/exdriver_pio/inc/d_expio_emul.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,92 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// This is a header file to define wins specific classes and info
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __D_EXPIO_EMUL_H__
1.22 +#define __D_EXPIO_EMUL_H__
1.23 +
1.24 +// pdd include file
1.25 +#include "d_expio_pdd.h"
1.26 +
1.27 +// include files
1.28 +#include <d32comm.h> // comm header file
1.29 +
1.30 +// DFC related constants
1.31 +//
1.32 +_LIT(KExEmulUartDfcName,"ExEmulUartDfc"); // Name of the DFC thread
1.33 +const TInt KExEmulUartDfcPriority=26; // DFC thread priority
1.34 +
1.35 +// UART FIFO sizes
1.36 +const TInt KTxFifoSize=64; // 64bytes fifo
1.37 +const TInt KRxFifoSize=64; // 64bytes fifo
1.38 +
1.39 +// Timer constants
1.40 +const TInt KRxPollTimeout=1; // 1ms
1.41 +const TInt KTimerStarted=1;
1.42 +const TInt KTimerExpired=0;
1.43 +const TInt KTimerCancelled=-1;
1.44 +
1.45 +
1.46 +/**
1.47 + * Physical device class specific for Emulator UART Physical Device Driver (PDD)
1.48 + */
1.49 +class DExEmulPhysicalDevice: public DExDriverPhysicalDevice
1.50 +{
1.51 +public:
1.52 + DExEmulPhysicalDevice();
1.53 + ~DExEmulPhysicalDevice(); // Destructor
1.54 + TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo,
1.55 + const TVersion& aVer);
1.56 +};
1.57 +
1.58 +/**
1.59 + Hardware peripheral class
1.60 +
1.61 + Target specific class, H4 uart controller. This class
1.62 + is accessed from physical channel class. It's object
1.63 + is created in physical channel DoCreate()and deleted
1.64 + in it's destructor
1.65 + */
1.66 +class DExUartPhysicalChannelEmul:public DExDriverPhysicalChannel
1.67 + {
1.68 +public:
1.69 + // Public functions access to all
1.70 + DExUartPhysicalChannelEmul(); // Constructor
1.71 + ~DExUartPhysicalChannelEmul(); // Destructor
1.72 + TInt DoCreate(TInt aUnit, const TDesC8* aInfo,
1.73 + const TVersion& aVer); // 2nd Stage constructor
1.74 + void Caps(TDes8& aCaps); // Get channel Capabilities
1.75 + TInt Configure(const TCommConfigV01& aConfig); // Configure the uart
1.76 + TInt TransmitData(const TDesC8& aData); // Transmit data to uart
1.77 + TInt ReceiveData(TDes8& aData,TInt aLen); // Receive data from uart
1.78 + TDynamicDfcQue* DfcQ(); // DFC queue creation
1.79 +private:
1.80 + static void RxPollTimerCallback(TAny* aPtr);
1.81 +private:
1.82 + TBool iConfigured; // Channel configuration status;
1.83 + TBps iBaudRate;
1.84 + NTimer iRxPollTimer; // Timer to poll for Rx data
1.85 + TInt iTimerStatus; // Rx data timer status
1.86 + // Windows handle for com port
1.87 + HANDLE hCommPort;
1.88 + DWORD iBytesRead;
1.89 + DWORD iBytesWritten;
1.90 + };
1.91 +
1.92 +#endif // __D_EXPIO_EMUL_H__
1.93 +
1.94 +//
1.95 +// End of d_expio_emul.h
1.96 \ No newline at end of file