navienginebsp/naviengine_assp/uart/vserialkeyb.h
changeset 0 5de814552237
equal deleted inserted replaced
-1:000000000000 0:5de814552237
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 * naviengine_assp\uart\vserialkeyb.h
       
    16 * Header for serial keyboard driver
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __VSERIALKEYB_H__
       
    23 #define __VSERIALKEYB_H__
       
    24 
       
    25 const TUint maxSeq = 5;
       
    26 
       
    27 
       
    28 class TSerialKeyboard
       
    29 {
       
    30 public:
       
    31 	TSerialKeyboard();
       
    32 	TInt Create();
       
    33 	static void Isr(TAny* aPtr);
       
    34 
       
    35 private:
       
    36 	static void KeyDfcFn(TAny* aPtr);
       
    37 	inline void KeyDfc();
       
    38 	void AddConvertedEvent(TUint aKey);
       
    39 	void AddUnconvertedEvent(TUint aKey);
       
    40 	TInt GetSerialPort(TUint& aBaud);
       
    41 
       
    42 	enum TState
       
    43 		{
       
    44 		ENormal,
       
    45 		EEscapingStart = 0x1b,
       
    46 		EEscapingType1 = 0x4f,
       
    47 		EEscapingType2 = 0x5b,
       
    48 		};
       
    49 private:
       
    50 	TDfc    iKeyDfc;
       
    51 	TInt    iKeyboardPort;
       
    52 
       
    53 	TUint   iSeqNum;
       
    54 	TUint   iCode[maxSeq];
       
    55 
       
    56 	TInt    iInterrupt;
       
    57 	T16550Uart* iUart;
       
    58 };
       
    59 
       
    60 
       
    61 #endif /* __VSERIALKEYB_H__ */