sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // template\template_variant\inc\iolines.h sl@0: // Variant layer header for Template Platform sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: #ifndef __V32TEMPLATEV1_H__ sl@0: #define __V32TEMPLATEV1_H__ sl@0: #include sl@0: #include sl@0: sl@0: //---------------------------------------------------------------------------- sl@0: // Variant-specific constants: use #define if constant dependencies are not sl@0: // declared within this file (this breaks the dependency on other header files) sl@0: //---------------------------------------------------------------------------- sl@0: sl@0: // Examples of what goes in here include: sl@0: // sl@0: // - General-purpose I/O allocation such as sl@0: // #define KtVariantGpio32KHzClkOut KHtGpioPort1 sl@0: // #define KtVariantGpioRClkOut KHtGpioPort0 sl@0: // sl@0: // #define KmVariantPinDirectionIn Sleep 0 sl@0: // sl@0: // - Memory constants (type, geometry, wait states, etc) such as: sl@0: // #define KwVariantRom0Type TTemplate::ERomTypeBurst4Rom sl@0: // #define KwVariantRom0Width TTemplate::ERomWidth32 sl@0: // const TUint KwVariantRom0WaitNs = 150; sl@0: // const TUint KwVariantRom0PageNs = 30; sl@0: // const TUint KwVariantRom0RecoverNs = 55; sl@0: // sl@0: // - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as sl@0: // const TUint KwVariantKeyColLshift = 7; sl@0: // #define KwVariantLcdBpp TTemplate::ELcd8BitsPerPixel sl@0: // const TUint KwVariantLcdMaxColors = 4096; sl@0: // const TUint KwVariantCodecMaxVolume = 0; sl@0: // sl@0: // - Off-chip hardware control blocks (addresses, register make-up) sl@0: // sl@0: // - Interrupts (second-level Interrupt controller base address, register make-up): sl@0: // (EXAMPLE ONLY:) sl@0: const TUint32 KHwVariantPhysBase = 0x40000000; sl@0: const TUint32 KHoVariantRegSpacing = 0x200; sl@0: sl@0: const TUint32 KHoBaseIntCont = 0x0B*KHoVariantRegSpacing; sl@0: sl@0: const TUint32 KHoIntContEnable = 0x00; // offsets from KHwVariantPhysBase+KHoBaseIntCont sl@0: const TUint32 KHoIntContPending = 0x04; sl@0: // other Variant and external blocks Base adrress offsets to KHwVariantPhysBase sl@0: sl@0: sl@0: // TO DO: (optional) sl@0: // sl@0: // Enumerate here all Variant (2nd level) interrupt sources. It could be a good idea to enumerate them in a way that sl@0: // facilitates operating on the corresponding interrupt controller registers (e.g using their value as a shift count) sl@0: // sl@0: // (EXAMPLE ONLY:) sl@0: enum TTemplateInterruptId sl@0: { sl@0: // the top-level bit is set to distinguish from first level (ASSP) Interrupts sl@0: EXIntIdA=0x80000000, sl@0: EXIntIdB=0x80000001, sl@0: // ... sl@0: EXIntIdZ=0x80000019, sl@0: sl@0: ENumXInts=0x1A sl@0: }; sl@0: sl@0: // sl@0: // TO DO: (optional) sl@0: // sl@0: // Define here some commonly used Variant (2nd level) interrupts sl@0: // sl@0: // (EXAMPLE ONLY:) sl@0: const TInt KIntIdKeyboard=EXIntIdB; sl@0: sl@0: class Variant sl@0: { sl@0: // below is a selection of functions usually implemented at this level. This do not constitute a mandatory sl@0: // set and it might not be relevant for your hardware... sl@0: public: sl@0: /** sl@0: * initialisation sl@0: */ sl@0: static void Init3(); sl@0: /** sl@0: * Returns the Linear Base address of the Variant Hardware sl@0: */ sl@0: IMPORT_C static TUint BaseLinAddress(); sl@0: /** sl@0: * When invoked, turns off all power supplies sl@0: */ sl@0: IMPORT_C static void PowerReset(); sl@0: /** sl@0: * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation sl@0: * As in, for example, the serial port was used by a device driver or the system is coming back from Standby sl@0: */ sl@0: IMPORT_C static void MarkDebugPortOff(); sl@0: /** sl@0: * When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings sl@0: * Called by Template::DebugInit() sl@0: */ sl@0: IMPORT_C static void UartInit(); sl@0: /** sl@0: * When invoked, read the state of on-board switches sl@0: * @return A bitmask with the state of on-board switches sl@0: */ sl@0: IMPORT_C static TUint Switches(); sl@0: // other functions to access hardware not covered by specific device-drivres, which may be called from drivers sl@0: // or platform-specifc code sl@0: // ... sl@0: public: sl@0: static TUint32 iBaseAddress; sl@0: // (optional): May need to have a follower variable to store the value of a read only register initialised at boot time sl@0: // static TUint aFollower; sl@0: }; sl@0: sl@0: #endif sl@0: