omap3530/shared/serialkeyb/serialkeyboard.cpp
author Lukasz Forynski <lukasz.forynski@gmail.com>
Mon, 23 Aug 2010 02:29:41 +0100
changeset 51 254b9435d75e
parent 41 e73f15023e91
child 84 09e266454dcf
child 115 0a9dcad6d856
permissions -rwxr-xr-x
Fixed build warnings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
//
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
//
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
// Contributors:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
//
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
// Description:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
// omap3530/shared/serialkeyb/serialkeyboard.mmp
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
// Simple serial keyboard implementation for Beagle baseport
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
//
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
#include <platform.h>
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include <e32keys.h>
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include <assp/omap3530_assp/omap3530_assp_priv.h>
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <assp/omap3530_assp/omap3530_uart.h>
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
//#include <drivers/resourceman.h>
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
const TInt KMagicCrashValue = 15;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#define SHIFTED(x)   (0x8000|(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#define ISSHIFTED(x) (0x8000&(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#define CTRLED(x)    (0x2000|(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#define ISCTRL(x)  (0x2000&(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#define FUNCED(x)    (0x4000|(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#define ISFUNC(x)  (0x4000&(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#define STDKEY(x)    (0x1FFF&(x))
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
41
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
    35
#if _UI_SOFTKEYS_ENABLED_
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
static const TUint16 KScanCode[] =
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
	/*00*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
	/*01*/	EStdKeyHome,				// ^A
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
	/*02*/	EStdKeyLeftArrow,			// ^B
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
	/*03*/	EStdKeyEscape,				// ^C
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
	/*04*/	SHIFTED(EStdKeyDownArrow),	// ^D - move window down
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
	/*05*/	EStdKeyEnd,					// ^E
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
	/*06*/	EStdKeyRightArrow,			// ^F
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
	/*07*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
	/*08*/	EStdKeyBackspace,			// ^H - Reserved!
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
	/*09*/	EStdKeyTab,					// ^I - Reserved!
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
	/*0a*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
	/*0b*/	EStdKeyIncContrast,			// ^K
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
	/*0c*/	EStdKeyDecContrast,			// ^L
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
	/*0d*/	EStdKeyEnter,				// ^M - Reserved!
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
	/*0e*/	EStdKeyDownArrow,			// ^N
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
	/*0f*/	EStdKeyNull,				// ^O = instant death
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
	/*10*/	EStdKeyUpArrow,				// ^P
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
	/*11*/	CTRLED(EStdKeyLeftArrow),	// ^Q - make window narrower
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
	/*12*/	CTRLED(FUNCED('5')),		// ^R - rotate windows in text window server
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
	/*13*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
	/*14*/	CTRLED(EStdKeyDownArrow),	// ^T - make window taller
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
	/*15*/	SHIFTED(EStdKeyUpArrow),	// ^U - move window up
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
	/*16*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
	/*17*/	CTRLED(EStdKeyRightArrow),	// ^W - make window wider
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
	/*18*/	SHIFTED(EStdKeyRightArrow),	// ^X - move window right
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
	/*19*/	CTRLED(EStdKeyUpArrow),		// ^Y - make window shorter
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
	/*1a*/	SHIFTED(EStdKeyLeftArrow),	// ^Z - move window left
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
	/*1b*/	EStdKeyEscape,				// ^[ - Reserved!
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
	/*1c*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
	/*1d*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
	/*1e*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
	/*1f*/	EStdKeyNull,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
	/*20*/	EStdKeySpace,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
	/*21*/	SHIFTED('1'),		// !
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
	/*22*/	SHIFTED('2'),		// "
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
	/*23*/	EStdKeyHash,		// #
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
	/*24*/	SHIFTED('4'),		// $
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
	/*25*/	SHIFTED('5'),		// %
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
	/*26*/	SHIFTED('7'),		// &
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
	/*27*/	EStdKeySingleQuote,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
	/*28*/	SHIFTED('9'),		// (
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
	/*29*/	SHIFTED('0'),		// )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
	/*2a*/	SHIFTED('8'),		// *
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
	/*2b*/	SHIFTED(EStdKeyEquals),	// +
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
	/*2c*/	EStdKeyComma,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
	/*2d*/	EStdKeyMinus,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
	/*2e*/	EStdKeyFullStop,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
	/*2f*/	EStdKeyForwardSlash,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
	/*30*/	'0',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
	/*31*/	'1',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
	/*32*/	'2',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
	/*33*/	'3',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
	/*34*/	'4',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
	/*35*/	'5',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
	/*36*/	'6',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
	/*37*/	'7',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
	/*38*/	'8',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
	/*39*/	'9',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
	/*3a*/	SHIFTED(EStdKeySemiColon),	// :
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
	/*3b*/	EStdKeySemiColon,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
	/*3c*/	SHIFTED(EStdKeyComma),		// <
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
	/*3d*/	EStdKeyEquals,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
	/*3e*/	SHIFTED(EStdKeyFullStop),	// >
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
	/*3f*/	SHIFTED(EStdKeyForwardSlash),	// ?
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
	/*40*/	SHIFTED(EStdKeySingleQuote),	// @
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   103
	/*41*/	EStdKeyUpArrow,
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   104
	/*42*/	EStdKeyDownArrow,
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   105
	/*43*/	EStdKeyRightArrow,
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   106
	/*44*/	EStdKeyLeftArrow,
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
	/*45*/	SHIFTED('E'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
	/*46*/	SHIFTED('F'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
	/*47*/	SHIFTED('G'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
	/*48*/	SHIFTED('H'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
	/*49*/	SHIFTED('I'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
	/*4a*/	SHIFTED('J'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
	/*4b*/	SHIFTED('K'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
	/*4c*/	SHIFTED('L'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
	/*4d*/	SHIFTED('M'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
	/*4e*/	SHIFTED('N'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
	/*4f*/	SHIFTED('O'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
	/*50*/	SHIFTED('P'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
	/*51*/	SHIFTED('Q'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
	/*52*/	SHIFTED('R'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
	/*53*/	SHIFTED('S'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
	/*54*/	SHIFTED('T'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
	/*55*/	SHIFTED('U'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
	/*56*/	SHIFTED('V'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
	/*57*/	SHIFTED('W'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
	/*58*/	SHIFTED('X'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
	/*59*/	SHIFTED('Y'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
	/*5a*/	SHIFTED('Z'),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
	/*5b*/	EStdKeySquareBracketLeft,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
	/*5c*/	EStdKeyBackSlash,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
	/*5d*/	EStdKeySquareBracketRight,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
	/*5e*/	SHIFTED('6'),			// ^
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
	/*5f*/	SHIFTED(EStdKeyMinus),	// _
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
	/*60*/	EStdKeyBacklightToggle,	// Actually `
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   135
	/*61*/	EStdKeyYes,
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
	/*62*/	'B',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
	/*63*/	'C',
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   138
	/*64*/	EStdKeyNo,
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   139
	/*65*/	EStdKeyDevice1,
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
	/*66*/	'F',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
	/*67*/	'G',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
	/*68*/	'H',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
	/*69*/	'I',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
	/*6a*/	'J',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
	/*6b*/	'K',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
	/*6c*/	'L',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
	/*6d*/	'M',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
	/*6e*/	'N',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
	/*6f*/	'O',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
	/*70*/	'P',
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   151
	/*71*/	EStdKeyDevice0,
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
	/*72*/	'R',
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   153
	/*73*/	EStdKeyApplication0,
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
	/*74*/	'T',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
	/*75*/	'U',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
	/*76*/	'V',
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   157
	/*77*/	EStdKeyDevice3,
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
	/*78*/	'X',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
	/*79*/	'Y',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
	/*7a*/	'Z',
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
	/*7b*/	SHIFTED(EStdKeySquareBracketLeft),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
	/*7c*/	SHIFTED(EStdKeyBackSlash),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
	/*7d*/	SHIFTED(EStdKeySquareBracketRight),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
	/*7e*/	SHIFTED(EStdKeyHash),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
	/*7f*/	EKeyDelete
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
	};
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
41
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   168
#else
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   169
static const TUint16 KScanCode[] =
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   170
	{
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   171
	/*00*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   172
	/*01*/	EStdKeyHome,				// ^A
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   173
	/*02*/	EStdKeyLeftArrow,			// ^B
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   174
	/*03*/	EStdKeyEscape,				// ^C
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   175
	/*04*/	SHIFTED(EStdKeyDownArrow),	// ^D - move window down
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   176
	/*05*/	EStdKeyEnd,					// ^E
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   177
	/*06*/	EStdKeyRightArrow,			// ^F
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   178
	/*07*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   179
	/*08*/	EStdKeyBackspace,			// ^H - Reserved!
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   180
	/*09*/	EStdKeyTab,					// ^I - Reserved!
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   181
	/*0a*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   182
	/*0b*/	EStdKeyIncContrast,			// ^K
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   183
	/*0c*/	EStdKeyDecContrast,			// ^L
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   184
	/*0d*/	EStdKeyEnter,				// ^M - Reserved!
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   185
	/*0e*/	EStdKeyDownArrow,			// ^N
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   186
	/*0f*/	EStdKeyNull,				// ^O = instant death
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   187
	/*10*/	EStdKeyUpArrow,				// ^P
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   188
	/*11*/	CTRLED(EStdKeyLeftArrow),	// ^Q - make window narrower
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   189
	/*12*/	CTRLED(FUNCED('5')),		// ^R - rotate windows in text window server
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   190
	/*13*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   191
	/*14*/	CTRLED(EStdKeyDownArrow),	// ^T - make window taller
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   192
	/*15*/	SHIFTED(EStdKeyUpArrow),	// ^U - move window up
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   193
	/*16*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   194
	/*17*/	CTRLED(EStdKeyRightArrow),	// ^W - make window wider
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   195
	/*18*/	SHIFTED(EStdKeyRightArrow),	// ^X - move window right
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   196
	/*19*/	CTRLED(EStdKeyUpArrow),		// ^Y - make window shorter
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   197
	/*1a*/	SHIFTED(EStdKeyLeftArrow),	// ^Z - move window left
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   198
	/*1b*/	EStdKeyEscape,				// ^[ - Reserved!
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   199
	/*1c*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   200
	/*1d*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   201
	/*1e*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   202
	/*1f*/	EStdKeyNull,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   203
	/*20*/	EStdKeySpace,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   204
	/*21*/	SHIFTED('1'),		// !
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   205
	/*22*/	SHIFTED('2'),		// "
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   206
	/*23*/	EStdKeyHash,		// #
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   207
	/*24*/	SHIFTED('4'),		// $
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   208
	/*25*/	SHIFTED('5'),		// %
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   209
	/*26*/	SHIFTED('7'),		// &
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   210
	/*27*/	EStdKeySingleQuote,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   211
	/*28*/	SHIFTED('9'),		// (
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   212
	/*29*/	SHIFTED('0'),		// )
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   213
	/*2a*/	SHIFTED('8'),		// *
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   214
	/*2b*/	SHIFTED(EStdKeyEquals),	// +
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   215
	/*2c*/	EStdKeyComma,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   216
	/*2d*/	EStdKeyMinus,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   217
	/*2e*/	EStdKeyFullStop,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   218
	/*2f*/	EStdKeyForwardSlash,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   219
	/*30*/	'0',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   220
	/*31*/	'1',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   221
	/*32*/	'2',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   222
	/*33*/	'3',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   223
	/*34*/	'4',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   224
	/*35*/	'5',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   225
	/*36*/	'6',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   226
	/*37*/	'7',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   227
	/*38*/	'8',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   228
	/*39*/	'9',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   229
	/*3a*/	SHIFTED(EStdKeySemiColon),	// :
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   230
	/*3b*/	EStdKeySemiColon,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   231
	/*3c*/	SHIFTED(EStdKeyComma),		// <
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   232
	/*3d*/	EStdKeyEquals,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   233
	/*3e*/	SHIFTED(EStdKeyFullStop),	// >
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   234
	/*3f*/	SHIFTED(EStdKeyForwardSlash),	// ?
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   235
	/*40*/	SHIFTED(EStdKeySingleQuote),	// @
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   236
	/*41*/	SHIFTED('A'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   237
	/*42*/	SHIFTED('B'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   238
	/*43*/	SHIFTED('C'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   239
	/*44*/	SHIFTED('D'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   240
	/*45*/	SHIFTED('E'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   241
	/*46*/	SHIFTED('F'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   242
	/*47*/	SHIFTED('G'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   243
	/*48*/	SHIFTED('H'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   244
	/*49*/	SHIFTED('I'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   245
	/*4a*/	SHIFTED('J'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   246
	/*4b*/	SHIFTED('K'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   247
	/*4c*/	SHIFTED('L'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   248
	/*4d*/	SHIFTED('M'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   249
	/*4e*/	SHIFTED('N'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   250
	/*4f*/	SHIFTED('O'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   251
	/*50*/	SHIFTED('P'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   252
	/*51*/	SHIFTED('Q'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   253
	/*52*/	SHIFTED('R'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   254
	/*53*/	SHIFTED('S'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   255
	/*54*/	SHIFTED('T'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   256
	/*55*/	SHIFTED('U'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   257
	/*56*/	SHIFTED('V'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   258
	/*57*/	SHIFTED('W'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   259
	/*58*/	SHIFTED('X'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   260
	/*59*/	SHIFTED('Y'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   261
	/*5a*/	SHIFTED('Z'),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   262
	/*5b*/	EStdKeySquareBracketLeft,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   263
	/*5c*/	EStdKeyBackSlash,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   264
	/*5d*/	EStdKeySquareBracketRight,
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   265
	/*5e*/	SHIFTED('6'),			// ^
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   266
	/*5f*/	SHIFTED(EStdKeyMinus),	// _
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   267
	/*60*/	EStdKeyBacklightToggle,	// Actually `
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   268
	/*61*/	'A',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   269
	/*62*/	'B',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   270
	/*63*/	'C',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   271
	/*64*/	'D',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   272
	/*65*/	'E',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   273
	/*66*/	'F',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   274
	/*67*/	'G',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   275
	/*68*/	'H',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   276
	/*69*/	'I',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   277
	/*6a*/	'J',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   278
	/*6b*/	'K',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   279
	/*6c*/	'L',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   280
	/*6d*/	'M',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   281
	/*6e*/	'N',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   282
	/*6f*/	'O',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   283
	/*70*/	'P',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   284
	/*71*/	'Q',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   285
	/*72*/	'R',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   286
	/*73*/	'S',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   287
	/*74*/	'T',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   288
	/*75*/	'U',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   289
	/*76*/	'V',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   290
	/*77*/	'W',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   291
	/*78*/	'X',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   292
	/*79*/	'Y',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   293
	/*7a*/	'Z',
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   294
	/*7b*/	SHIFTED(EStdKeySquareBracketLeft),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   295
	/*7c*/	SHIFTED(EStdKeyBackSlash),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   296
	/*7d*/	SHIFTED(EStdKeySquareBracketRight),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   297
	/*7e*/	SHIFTED(EStdKeyHash),
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   298
	/*7f*/	EKeyDelete
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   299
	};
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   300
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   301
#endif
e73f15023e91 Changes in the Serial Keyboard to disable sofy key mappings for texshell roms.
arunabha
parents: 21
diff changeset
   302
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
static const TUint16 KEscapedScanCode[] =
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
	EStdKeyUpArrow,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
	EStdKeyDownArrow,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
	EStdKeyRightArrow,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
	EStdKeyLeftArrow
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
	};
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
const TUint8 KEscapeChar = 0x1b;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
const TUint8 KEscapeBase = 0x41;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
const TUint8 KEscapeCount = sizeof(KEscapedScanCode) / sizeof(KEscapedScanCode[0]);
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
const TUint16 KEscapeScanCode = EStdKeyEscape;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
NONSHARABLE_CLASS(TSerialKeyboard) : public DBase
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
public:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
	inline TSerialKeyboard();
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
	TInt Create();
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
private:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
	static void UartIsr( TAny* aParam );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
	static void AddKeyDfc( TAny* aParam );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
	void AddKey( TUint aKey );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
	
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
private:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
	enum TState
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
		ENormal,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
		EEscaping1,
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
		EEscaping2
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
		};
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
	TDfc				iAddKeyDfc;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
	Omap3530Uart::TUart	iUart;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
	TUint				iPrmClientId;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
	TState				iState : 8;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
	TUint8				iKey;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
	};
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
inline TSerialKeyboard::TSerialKeyboard()
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
:	iAddKeyDfc( AddKeyDfc, this, Kern::DfcQue0(), 1 ),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
	iUart( Omap3530Assp::DebugPortNumber() ),
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
	iState( ENormal )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
	// Convert the scan rate from milliseconds to nanokernel ticks (normally 1/64 of a second)
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
	}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
TInt TSerialKeyboard::Create()
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
	TInt r = KErrNone;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
	const Omap3530Uart::TUartNumber portNumber( Omap3530Assp::DebugPortNumber() );
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   356
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
	if( portNumber >= 0 )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
		{
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   359
#ifdef USE_SYMBIAN_PRM
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
		// Register with the power resource manager
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
		_LIT( KName, "serkey" );
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   362
		r = PowerResourceManager::RegisterClient( iPrmClientId, KName );
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   363
		__KTRACE_OPT(KBOOT,Kern::Printf("+TSerialKeyboardl::Create:PRM client ID=%x, err=%d", iPrmClientId, r));
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
		if( r != KErrNone )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
			return r;
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   367
			}
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   368
#endif
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   370
		Prcm::SetClockState(iUart.PrcmInterfaceClk(), Prcm::EClkOn);
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   371
		Prcm::SetClockState(iUart.PrcmFunctionClk(), Prcm::EClkOn);
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   372
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
 		r = Interrupt::Bind( iUart.InterruptId(), UartIsr, this );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
		if ( r < 0 )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
 			{
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   376
 			Kern::Printf("TSerialKeyboard Bind r=%d", r);
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
			return r;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
 			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   380
		Kern::Printf("+TSerialKeyboard::Create bound to interrupt" );
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   381
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   382
#ifdef USE_SYMBIAN_PRM
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
		// Ask power resource manager to turn on clocks to the UART
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
		// (this could take some time but we're not in any hurry)
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   385
		r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmFunctionClk(), Prcm::EClkOn );
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   386
		if( r == KErrNone )
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
			{
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   388
			r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmInterfaceClk(), Prcm::EClkOn );
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   389
			}
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   390
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   391
		if( r != KErrNone )
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   392
			{
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   393
			__KTRACE_OPT(KBOOT, Kern::Printf("+TSerialKeyboardl:PRM ChangeResourceState(clock(s)) failed, client ID=%x, err=%d", iPrmClientId, r));
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
			return r;
51
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   395
			}
254b9435d75e Fixed build warnings
Lukasz Forynski <lukasz.forynski@gmail.com>
parents: 41
diff changeset
   396
#endif
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
		// We can assume that the debug output code has already initialized the UART, we just need to prepare it for RX
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
		iUart.EnableFifo( Omap3530Uart::TUart::EEnabled, Omap3530Uart::TUart::ETriggerUnchanged, Omap3530Uart::TUart::ETrigger8 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
		iUart.EnableInterrupt( Omap3530Uart::TUart::EIntRhr );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
		Interrupt::Enable( iUart.InterruptId() );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
	return r;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
	}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
void TSerialKeyboard::UartIsr( TAny* aParam )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
	TSerialKeyboard* self = reinterpret_cast<TSerialKeyboard*>( aParam );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
	
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
	const TUint iir = Omap3530Uart::IIR::iMem.Read( self->iUart );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
	if ( 0 == (iir bitand Omap3530Uart::IIR::IT_PENDING::KMask) )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
		const TUint pending = iir bitand Omap3530Uart::IIR::IT_TYPE::KFieldMask;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
		// Although the TI datasheet descrivwed IT_TYPE as being an enumerated priority-decoded interrupt
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
		// it appears to actually be a bitmask of active interrupt sources
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
		if ( (pending bitand Omap3530Uart::IIR::IT_TYPE::ERHR) || (pending bitand Omap3530Uart::IIR::IT_TYPE::ERxLineStatus) )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
			TUint byte = self->iUart.Read();
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
			
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
			if( KMagicCrashValue == byte )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
				{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
				Kern::Fault( "SERKEY-FORCED", 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
				}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
			else
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
				{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
				self->iKey = byte;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
				self->iAddKeyDfc.Add();
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
				Interrupt::Disable( self->iUart.InterruptId() );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
				}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
	}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
void TSerialKeyboard::AddKeyDfc( TAny* aParam )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
	TSerialKeyboard* self = reinterpret_cast<TSerialKeyboard*>( aParam );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
	switch ( self->iState )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
	case ENormal:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
		if ( self->iKey == KEscapeChar )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
			self->iState = EEscaping1;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
		else
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
			self->AddKey( KScanCode[ self->iKey ] );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
		break;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
	case EEscaping1:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
		if ( self->iKey == KEscapeChar )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
			self->iState = EEscaping2;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
		else
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
			self->AddKey( KEscapeScanCode );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
			self->AddKey( KScanCode[ self->iKey ] );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
			self->iState = ENormal;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
		break;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
	case EEscaping2:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
		TInt index = self->iKey - KEscapeBase;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
		
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
		if ( (index >= 0) && (index < KEscapeCount) )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
			self->AddKey( KEscapedScanCode[ index ] );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
		else
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
			{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
			self->AddKey( KEscapeScanCode );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
			self->AddKey( KScanCode[ self->iKey ] );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
			}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
		self->iState = ENormal;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
		break;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
	default:
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
		self->iState = ENormal;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
		break;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
		};
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
	Interrupt::Enable( self->iUart.InterruptId() );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
	}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
void TSerialKeyboard::AddKey( TUint aKey )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
	const TBool shifted = ISSHIFTED(aKey);
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
	const TBool ctrl = ISCTRL(aKey);
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
	const TBool func = ISFUNC(aKey);
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
	const TUint8 stdKey = STDKEY(aKey);
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
	TRawEvent e;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
21
524118fd998f Fixes for the Keyboard mapping , serial Mouse and the LCD drivers
arunabha
parents: 0
diff changeset
   501
	
0
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
	if ( func )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
		e.Set( TRawEvent::EKeyDown, EStdKeyRightFunc, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
		Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
	
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
	if ( ctrl )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
		e.Set( TRawEvent::EKeyDown, EStdKeyRightCtrl, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
		Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
	if ( shifted )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
		e.Set( TRawEvent::EKeyDown, EStdKeyRightShift, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
		Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
	e.Set( TRawEvent::EKeyDown, stdKey, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
	Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
	e.Set( TRawEvent::EKeyUp, stdKey, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
	Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
	if ( shifted )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
		e.Set( TRawEvent::EKeyUp, EStdKeyRightShift, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
		Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
	if ( ctrl )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
		e.Set( TRawEvent::EKeyUp, EStdKeyRightCtrl, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
		Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
	if ( func )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
		e.Set( TRawEvent::EKeyUp, EStdKeyRightFunc, 0 );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
		Kern::AddEvent( e );
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
	}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
DECLARE_STANDARD_EXTENSION()
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
	{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
	__KTRACE_OPT(KEXTENSION,Kern::Printf("Starting serial keyboard driver"));
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
	TInt r = KErrNoMemory;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
	TSerialKeyboard* keyboard = new TSerialKeyboard;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
	if ( keyboard )
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
		{
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
		r = keyboard->Create();
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
		}
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
	__KTRACE_OPT(KEXTENSION,Kern::Printf("Returns %d",r));
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
	return r;
6663340f3fc9 Add EPL'd beagleboard code
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
	}