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