navienginebsp/ne1_tb/inc/iolines.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 * ne1_tb\inc\iolines.h
       
    16 * Variant layer header for NE1_TBVariant Platform
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __NE1_TBIOLINES_H__
       
    23 #define __NE1_TBIOLINES_H__
       
    24 #include <e32cmn.h>
       
    25 #include <kernel/kpower.h>
       
    26 
       
    27 //----------------------------------------------------------------------------
       
    28 // Variant-specific constants: use #define if constant dependencies are not
       
    29 // declared within this file (this breaks the dependency on other header files)
       
    30 //----------------------------------------------------------------------------
       
    31 
       
    32 // Examples of what goes in here include:
       
    33 //
       
    34 // - General-purpose I/O allocation such as 
       
    35 //	 #define KtVariantGpio32KHzClkOut		KHtGpioPort1
       
    36 //	 #define KtVariantGpioRClkOut			KHtGpioPort0
       
    37 //
       
    38 //	 #define KmVariantPinDirectionIn Sleep	0
       
    39 //
       
    40 // - Memory constants (type, geometry, wait states, etc) such as:
       
    41 //	 #define KwVariantRom0Type				TNaviEngine::ERomTypeBurst4Rom
       
    42 //	 #define KwVariantRom0Width				TNaviEngine::ERomWidth32
       
    43 //	 const TUint KwVariantRom0WaitNs		= 150;
       
    44 //	 const TUint KwVariantRom0PageNs		= 30;
       
    45 //	 const TUint KwVariantRom0RecoverNs		= 55;
       
    46 //
       
    47 // - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as 
       
    48 //	 const TUint KwVariantKeyColLshift		= 7;
       
    49 //	 #define KwVariantLcdBpp				TNaviEngine::ELcd8BitsPerPixel
       
    50 //   const TUint KwVariantLcdMaxColors		= 4096;
       
    51 //   const TUint KwVariantCodecMaxVolume	= 0;
       
    52 //
       
    53 // - Off-chip hardware control blocks (addresses, register make-up)
       
    54 //
       
    55 // - Interrupts (second-level Interrupt controller base address, register make-up):
       
    56 //   (EXAMPLE ONLY:)
       
    57 const TUint32 KHwVariantPhysBase		=	0x40000000;
       
    58 const TUint32 KHoVariantRegSpacing		=	0x200;
       
    59 
       
    60 const TUint32 KHoBaseIntCont			=	0x0B*KHoVariantRegSpacing;
       
    61 
       
    62 const TUint32 KHoIntContEnable			=	0x00;		// offsets from KHwVariantPhysBase+KHoBaseIntCont
       
    63 const TUint32 KHoIntContPending			=	0x04;
       
    64 // other Variant and external blocks Base adrress offsets to KHwVariantPhysBase
       
    65 
       
    66 
       
    67 // TO DO: (optional)
       
    68 //
       
    69 // Enumerate here all Variant (2nd level)  interrupt sources. It could be a good idea to enumerate them in a way that 
       
    70 // facilitates operating on the corresponding interrupt controller registers (e.g using their value as a shift count)
       
    71 //
       
    72 //   (EXAMPLE ONLY:)
       
    73 enum TTemplateInterruptId
       
    74 	{
       
    75 	// the top-level bit is set to distinguish from first level (ASSP) Interrupts
       
    76 	EXIntIdA=0x80000000,
       
    77 	EXIntIdB=0x80000001,
       
    78 	// ...
       
    79 	EXIntIdZ=0x80000019,
       
    80 
       
    81 	ENumXInts=0x1A
       
    82 	};
       
    83 
       
    84 //
       
    85 // TO DO: (optional)
       
    86 //
       
    87 // Define here some commonly used Variant (2nd level) interrupts
       
    88 //
       
    89 //   (EXAMPLE ONLY:)
       
    90 const TInt KIntIdKeyboard=EXIntIdB;
       
    91 
       
    92 class Variant
       
    93     {
       
    94 	// below is a selection of functions usually implemented  at this level. This do not constitute a mandatory
       
    95 	// set and it might not be relevant for your hardware...
       
    96 public:
       
    97 	/**
       
    98 	 * initialisation
       
    99 	 */
       
   100 	static void Init3();
       
   101 	/**
       
   102 	 * Returns the Linear Base address of the Variant Hardware
       
   103 	 */
       
   104 	IMPORT_C static TUint BaseLinAddress();
       
   105 	/**
       
   106 	 * When invoked, turns off all power supplies
       
   107 	 */
       
   108 	IMPORT_C static void PowerReset();
       
   109 	/**
       
   110 	 * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation
       
   111 	 * As in, for example, the serial port was used by a device driver or the system is coming back from Standby
       
   112 	 */
       
   113 	IMPORT_C static void MarkDebugPortOff();
       
   114 	/**
       
   115 	 * When invoked, read the state of on-board switches
       
   116 	 * @return A bitmask with the state of on-board switches
       
   117 	 */
       
   118 	IMPORT_C static TUint Switches();
       
   119 	// other functions to access hardware not covered by specific device-drivres, which may be called from drivers
       
   120 	// or platform-specifc code
       
   121 	// ...
       
   122 public:
       
   123 	static TUint32 iBaseAddress;
       
   124 	// (optional): May need to have a follower variable to store the value of a read only register initialised at boot time
       
   125 	// static TUint aFollower;
       
   126     };
       
   127 
       
   128 #endif
       
   129