os/kernelhwsrv/bsptemplate/asspandvariant/template_variant/inc/iolines.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/bsptemplate/asspandvariant/template_variant/inc/iolines.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,134 @@
     1.4 +// Copyright (c) 1998-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 the License "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 +// template\template_variant\inc\iolines.h
    1.18 +// Variant layer header for Template Platform
    1.19 +// 
    1.20 +// WARNING: This file contains some APIs which are internal and are subject
    1.21 +//          to change without notice. Such APIs should therefore not be used
    1.22 +//          outside the Kernel and Hardware Services package.
    1.23 +//
    1.24 +
    1.25 +#ifndef __V32TEMPLATEV1_H__
    1.26 +#define __V32TEMPLATEV1_H__
    1.27 +#include <e32cmn.h>
    1.28 +#include <kernel/kpower.h>
    1.29 +
    1.30 +//----------------------------------------------------------------------------
    1.31 +// Variant-specific constants: use #define if constant dependencies are not
    1.32 +// declared within this file (this breaks the dependency on other header files)
    1.33 +//----------------------------------------------------------------------------
    1.34 +
    1.35 +// Examples of what goes in here include:
    1.36 +//
    1.37 +// - General-purpose I/O allocation such as 
    1.38 +//	 #define KtVariantGpio32KHzClkOut		KHtGpioPort1
    1.39 +//	 #define KtVariantGpioRClkOut			KHtGpioPort0
    1.40 +//
    1.41 +//	 #define KmVariantPinDirectionIn Sleep	0
    1.42 +//
    1.43 +// - Memory constants (type, geometry, wait states, etc) such as:
    1.44 +//	 #define KwVariantRom0Type				TTemplate::ERomTypeBurst4Rom
    1.45 +//	 #define KwVariantRom0Width				TTemplate::ERomWidth32
    1.46 +//	 const TUint KwVariantRom0WaitNs		= 150;
    1.47 +//	 const TUint KwVariantRom0PageNs		= 30;
    1.48 +//	 const TUint KwVariantRom0RecoverNs		= 55;
    1.49 +//
    1.50 +// - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as 
    1.51 +//	 const TUint KwVariantKeyColLshift		= 7;
    1.52 +//	 #define KwVariantLcdBpp				TTemplate::ELcd8BitsPerPixel
    1.53 +//   const TUint KwVariantLcdMaxColors		= 4096;
    1.54 +//   const TUint KwVariantCodecMaxVolume	= 0;
    1.55 +//
    1.56 +// - Off-chip hardware control blocks (addresses, register make-up)
    1.57 +//
    1.58 +// - Interrupts (second-level Interrupt controller base address, register make-up):
    1.59 +//   (EXAMPLE ONLY:)
    1.60 +const TUint32 KHwVariantPhysBase		=	0x40000000;
    1.61 +const TUint32 KHoVariantRegSpacing		=	0x200;
    1.62 +
    1.63 +const TUint32 KHoBaseIntCont			=	0x0B*KHoVariantRegSpacing;
    1.64 +
    1.65 +const TUint32 KHoIntContEnable			=	0x00;		// offsets from KHwVariantPhysBase+KHoBaseIntCont
    1.66 +const TUint32 KHoIntContPending			=	0x04;
    1.67 +// other Variant and external blocks Base adrress offsets to KHwVariantPhysBase
    1.68 +
    1.69 +
    1.70 +// TO DO: (optional)
    1.71 +//
    1.72 +// Enumerate here all Variant (2nd level)  interrupt sources. It could be a good idea to enumerate them in a way that 
    1.73 +// facilitates operating on the corresponding interrupt controller registers (e.g using their value as a shift count)
    1.74 +//
    1.75 +//   (EXAMPLE ONLY:)
    1.76 +enum TTemplateInterruptId
    1.77 +	{
    1.78 +	// the top-level bit is set to distinguish from first level (ASSP) Interrupts
    1.79 +	EXIntIdA=0x80000000,
    1.80 +	EXIntIdB=0x80000001,
    1.81 +	// ...
    1.82 +	EXIntIdZ=0x80000019,
    1.83 +
    1.84 +	ENumXInts=0x1A
    1.85 +	};
    1.86 +
    1.87 +//
    1.88 +// TO DO: (optional)
    1.89 +//
    1.90 +// Define here some commonly used Variant (2nd level) interrupts
    1.91 +//
    1.92 +//   (EXAMPLE ONLY:)
    1.93 +const TInt KIntIdKeyboard=EXIntIdB;
    1.94 +
    1.95 +class Variant
    1.96 +    {
    1.97 +	// below is a selection of functions usually implemented  at this level. This do not constitute a mandatory
    1.98 +	// set and it might not be relevant for your hardware...
    1.99 +public:
   1.100 +	/**
   1.101 +	 * initialisation
   1.102 +	 */
   1.103 +	static void Init3();
   1.104 +	/**
   1.105 +	 * Returns the Linear Base address of the Variant Hardware
   1.106 +	 */
   1.107 +	IMPORT_C static TUint BaseLinAddress();
   1.108 +	/**
   1.109 +	 * When invoked, turns off all power supplies
   1.110 +	 */
   1.111 +	IMPORT_C static void PowerReset();
   1.112 +	/**
   1.113 +	 * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation
   1.114 +	 * As in, for example, the serial port was used by a device driver or the system is coming back from Standby
   1.115 +	 */
   1.116 +	IMPORT_C static void MarkDebugPortOff();
   1.117 +	/**
   1.118 +	 * When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings
   1.119 +	 * Called by Template::DebugInit()
   1.120 +	 */
   1.121 +	IMPORT_C static void UartInit();
   1.122 +	/**
   1.123 +	 * When invoked, read the state of on-board switches
   1.124 +	 * @return A bitmask with the state of on-board switches
   1.125 +	 */
   1.126 +	IMPORT_C static TUint Switches();
   1.127 +	// other functions to access hardware not covered by specific device-drivres, which may be called from drivers
   1.128 +	// or platform-specifc code
   1.129 +	// ...
   1.130 +public:
   1.131 +	static TUint32 iBaseAddress;
   1.132 +	// (optional): May need to have a follower variable to store the value of a read only register initialised at boot time
   1.133 +	// static TUint aFollower;
   1.134 +    };
   1.135 +
   1.136 +#endif
   1.137 +