omap3530/shared/serialkeyb/serialkeyboard.cpp
changeset 21 524118fd998f
parent 0 6663340f3fc9
child 41 e73f15023e91
equal deleted inserted replaced
20:3999188eafd0 21:524118fd998f
    97 	/*3c*/	SHIFTED(EStdKeyComma),		// <
    97 	/*3c*/	SHIFTED(EStdKeyComma),		// <
    98 	/*3d*/	EStdKeyEquals,
    98 	/*3d*/	EStdKeyEquals,
    99 	/*3e*/	SHIFTED(EStdKeyFullStop),	// >
    99 	/*3e*/	SHIFTED(EStdKeyFullStop),	// >
   100 	/*3f*/	SHIFTED(EStdKeyForwardSlash),	// ?
   100 	/*3f*/	SHIFTED(EStdKeyForwardSlash),	// ?
   101 	/*40*/	SHIFTED(EStdKeySingleQuote),	// @
   101 	/*40*/	SHIFTED(EStdKeySingleQuote),	// @
   102 	/*41*/	SHIFTED('A'),
   102 	/*41*/	EStdKeyUpArrow,
   103 	/*42*/	SHIFTED('B'),
   103 	/*42*/	EStdKeyDownArrow,
   104 	/*43*/	SHIFTED('C'),
   104 	/*43*/	EStdKeyRightArrow,
   105 	/*44*/	SHIFTED('D'),
   105 	/*44*/	EStdKeyLeftArrow,
   106 	/*45*/	SHIFTED('E'),
   106 	/*45*/	SHIFTED('E'),
   107 	/*46*/	SHIFTED('F'),
   107 	/*46*/	SHIFTED('F'),
   108 	/*47*/	SHIFTED('G'),
   108 	/*47*/	SHIFTED('G'),
   109 	/*48*/	SHIFTED('H'),
   109 	/*48*/	SHIFTED('H'),
   110 	/*49*/	SHIFTED('I'),
   110 	/*49*/	SHIFTED('I'),
   129 	/*5c*/	EStdKeyBackSlash,
   129 	/*5c*/	EStdKeyBackSlash,
   130 	/*5d*/	EStdKeySquareBracketRight,
   130 	/*5d*/	EStdKeySquareBracketRight,
   131 	/*5e*/	SHIFTED('6'),			// ^
   131 	/*5e*/	SHIFTED('6'),			// ^
   132 	/*5f*/	SHIFTED(EStdKeyMinus),	// _
   132 	/*5f*/	SHIFTED(EStdKeyMinus),	// _
   133 	/*60*/	EStdKeyBacklightToggle,	// Actually `
   133 	/*60*/	EStdKeyBacklightToggle,	// Actually `
   134 	/*61*/	'A',
   134 	/*61*/	EStdKeyYes,
   135 	/*62*/	'B',
   135 	/*62*/	'B',
   136 	/*63*/	'C',
   136 	/*63*/	'C',
   137 	/*64*/	'D',
   137 	/*64*/	EStdKeyNo,
   138 	/*65*/	'E',
   138 	/*65*/	EStdKeyDevice1,
   139 	/*66*/	'F',
   139 	/*66*/	'F',
   140 	/*67*/	'G',
   140 	/*67*/	'G',
   141 	/*68*/	'H',
   141 	/*68*/	'H',
   142 	/*69*/	'I',
   142 	/*69*/	'I',
   143 	/*6a*/	'J',
   143 	/*6a*/	'J',
   145 	/*6c*/	'L',
   145 	/*6c*/	'L',
   146 	/*6d*/	'M',
   146 	/*6d*/	'M',
   147 	/*6e*/	'N',
   147 	/*6e*/	'N',
   148 	/*6f*/	'O',
   148 	/*6f*/	'O',
   149 	/*70*/	'P',
   149 	/*70*/	'P',
   150 	/*71*/	'Q',
   150 	/*71*/	EStdKeyDevice0,
   151 	/*72*/	'R',
   151 	/*72*/	'R',
   152 	/*73*/	'S',
   152 	/*73*/	EStdKeyApplication0,
   153 	/*74*/	'T',
   153 	/*74*/	'T',
   154 	/*75*/	'U',
   154 	/*75*/	'U',
   155 	/*76*/	'V',
   155 	/*76*/	'V',
   156 	/*77*/	'W',
   156 	/*77*/	EStdKeyDevice3,
   157 	/*78*/	'X',
   157 	/*78*/	'X',
   158 	/*79*/	'Y',
   158 	/*79*/	'Y',
   159 	/*7a*/	'Z',
   159 	/*7a*/	'Z',
   160 	/*7b*/	SHIFTED(EStdKeySquareBracketLeft),
   160 	/*7b*/	SHIFTED(EStdKeySquareBracketLeft),
   161 	/*7c*/	SHIFTED(EStdKeyBackSlash),
   161 	/*7c*/	SHIFTED(EStdKeyBackSlash),
   229 			}*/
   229 			}*/
   230 
   230 
   231 		__KTRACE_OPT(KBOOT,Kern::Printf("+TSerialKeyboardl::Create:PRM client ID=%x", iPrmClientId )) ;
   231 		__KTRACE_OPT(KBOOT,Kern::Printf("+TSerialKeyboardl::Create:PRM client ID=%x", iPrmClientId )) ;
   232 		Kern::Printf("+TSerialKeyboardl::Create:PRM client ID=%x", iPrmClientId );
   232 		Kern::Printf("+TSerialKeyboardl::Create:PRM client ID=%x", iPrmClientId );
   233 
   233 
       
   234 		Prcm::SetClockState(iUart.PrcmInterfaceClk(), Prcm::EClkOn);
       
   235 		Prcm::SetClockState(iUart.PrcmFunctionClk(), Prcm::EClkOn);
       
   236 		
   234  		r = Interrupt::Bind( iUart.InterruptId(), UartIsr, this );
   237  		r = Interrupt::Bind( iUart.InterruptId(), UartIsr, this );
   235 		if ( r < 0 )
   238 		if ( r < 0 )
   236  			{
   239  			{
       
   240  			Kern::Printf("TSerialKeyboard Bind r=%d", r);
   237 			return r;
   241 			return r;
   238  			}
   242  			}
   239 
   243 
       
   244 		Kern::Printf("+TSerialKeyboard::Create bound to interrupt" );
       
   245 		
   240 		// Ask power resource manager to turn on clocks to the UART
   246 		// Ask power resource manager to turn on clocks to the UART
   241 		// (this could take some time but we're not in any hurry)
   247 		// (this could take some time but we're not in any hurry)
   242 		/*r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmFunctionClk(), Prcm::EClkOn );
   248 		/*r = PowerResourceManager::ChangeResourceState( iPrmClientId, iUart.PrmFunctionClk(), Prcm::EClkOn );
   243 		if( KErrNone != r )
   249 		if( KErrNone != r )
   244 			{
   250 			{
   302 			{
   308 			{
   303 			self->iState = EEscaping1;
   309 			self->iState = EEscaping1;
   304 			}
   310 			}
   305 		else
   311 		else
   306 			{
   312 			{
       
   313 			Kern::Printf("Key received: %d %d", self->iKey, KScanCode[self->iKey]);
   307 			self->AddKey( KScanCode[ self->iKey ] );
   314 			self->AddKey( KScanCode[ self->iKey ] );
   308 			}
   315 			}
   309 		break;
   316 		break;
   310 
   317 
   311 	case EEscaping1:
   318 	case EEscaping1:
   353 	const TBool func = ISFUNC(aKey);
   360 	const TBool func = ISFUNC(aKey);
   354 	const TUint8 stdKey = STDKEY(aKey);
   361 	const TUint8 stdKey = STDKEY(aKey);
   355 
   362 
   356 	TRawEvent e;
   363 	TRawEvent e;
   357 
   364 
       
   365 	Kern::Printf("AddKey %d %d %d %d", shifted, ctrl, func, stdKey);
       
   366 	
   358 	if ( func )
   367 	if ( func )
   359 		{
   368 		{
   360 		e.Set( TRawEvent::EKeyDown, EStdKeyRightFunc, 0 );
   369 		e.Set( TRawEvent::EKeyDown, EStdKeyRightFunc, 0 );
   361 		Kern::AddEvent( e );
   370 		Kern::AddEvent( e );
   362 		}
   371 		}