epoc32/include/beagle/iolines.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/beagle/iolines.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/beagle/iolines.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,132 +1,117 @@
     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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 -//
    1.21 -
    1.22 -
    1.23 -
    1.24 -#ifndef __V32TEMPLATEV1_H__
    1.25 -#define __V32TEMPLATEV1_H__
    1.26 -#include <e32cmn.h>
    1.27 -#include <kpower.h>
    1.28 -
    1.29 -//----------------------------------------------------------------------------
    1.30 -// Variant-specific constants: use #define if constant dependencies are not
    1.31 -// declared within this file (this breaks the dependency on other header files)
    1.32 -//----------------------------------------------------------------------------
    1.33 -
    1.34 -// Examples of what goes in here include:
    1.35 -//
    1.36 -// - General-purpose I/O allocation such as 
    1.37 -//	 #define KtVariantGpio32KHzClkOut		KHtGpioPort1
    1.38 -//	 #define KtVariantGpioRClkOut			KHtGpioPort0
    1.39 -//
    1.40 -//	 #define KmVariantPinDirectionIn Sleep	0
    1.41 -//
    1.42 -// - Memory constants (type, geometry, wait states, etc) such as:
    1.43 -//	 #define KwVariantRom0Type				TTemplate::ERomTypeBurst4Rom
    1.44 -//	 #define KwVariantRom0Width				TTemplate::ERomWidth32
    1.45 -//	 const TUint KwVariantRom0WaitNs		= 150;
    1.46 -//	 const TUint KwVariantRom0PageNs		= 30;
    1.47 -//	 const TUint KwVariantRom0RecoverNs		= 55;
    1.48 -//
    1.49 -// - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as 
    1.50 -//	 const TUint KwVariantKeyColLshift		= 7;
    1.51 -//	 #define KwVariantLcdBpp				TTemplate::ELcd8BitsPerPixel
    1.52 -//   const TUint KwVariantLcdMaxColors		= 4096;
    1.53 -//   const TUint KwVariantCodecMaxVolume	= 0;
    1.54 -//
    1.55 -// - Off-chip hardware control blocks (addresses, register make-up)
    1.56 -//
    1.57 -// - Interrupts (second-level Interrupt controller base address, register make-up):
    1.58 -//   (EXAMPLE ONLY:)
    1.59 -const TUint32 KHwVariantPhysBase		=	0x40000000;
    1.60 -const TUint32 KHoVariantRegSpacing		=	0x200;
    1.61 -
    1.62 -const TUint32 KHoBaseIntCont			=	0x0B*KHoVariantRegSpacing;
    1.63 -
    1.64 -const TUint32 KHoIntContEnable			=	0x00;		// offsets from KHwVariantPhysBase+KHoBaseIntCont
    1.65 -const TUint32 KHoIntContPending			=	0x04;
    1.66 -// other Variant and external blocks Base adrress offsets to KHwVariantPhysBase
    1.67 -
    1.68 -
    1.69 -// TO DO: (optional)
    1.70 -//
    1.71 -// Enumerate here all Variant (2nd level)  interrupt sources. It could be a good idea to enumerate them in a way that 
    1.72 -// facilitates operating on the corresponding interrupt controller registers (e.g using their value as a shift count)
    1.73 -//
    1.74 -//   (EXAMPLE ONLY:)
    1.75 -enum TTemplateInterruptId
    1.76 -	{
    1.77 -	// the top-level bit is set to distinguish from first level (ASSP) Interrupts
    1.78 -	EXIntIdA=0x80000000,
    1.79 -	EXIntIdB=0x80000001,
    1.80 -	// ...
    1.81 -	EXIntIdZ=0x80000019,
    1.82 -
    1.83 -	ENumXInts=0x1A
    1.84 -	};
    1.85 -
    1.86 -//
    1.87 -// TO DO: (optional)
    1.88 -//
    1.89 -// Define here some commonly used Variant (2nd level) interrupts
    1.90 -//
    1.91 -//   (EXAMPLE ONLY:)
    1.92 -const TInt KIntIdKeyboard=EXIntIdB;
    1.93 -
    1.94 -class Variant
    1.95 -    {
    1.96 -	// below is a selection of functions usually implemented  at this level. This do not constitute a mandatory
    1.97 -	// set and it might not be relevant for your hardware...
    1.98 -public:
    1.99 -	/**
   1.100 -	 * initialisation
   1.101 -	 */
   1.102 -	static void Init3();
   1.103 -	/**
   1.104 -	 * Returns the Linear Base address of the Variant Hardware
   1.105 -	 */
   1.106 -	IMPORT_C static TUint BaseLinAddress();
   1.107 -	/**
   1.108 -	 * When invoked, turns off all power supplies
   1.109 -	 */
   1.110 -	IMPORT_C static void PowerReset();
   1.111 -	/**
   1.112 -	 * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation
   1.113 -	 * As in, for example, the serial port was used by a device driver or the system is coming back from Standby
   1.114 -	 */
   1.115 -	IMPORT_C static void MarkDebugPortOff();
   1.116 -	/**
   1.117 -	 * When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings
   1.118 -	 * Called by Template::DebugInit()
   1.119 -	 */
   1.120 -	IMPORT_C static void UartInit();
   1.121 -	/**
   1.122 -	 * When invoked, read the state of on-board switches
   1.123 -	 * @return A bitmask with the state of on-board switches
   1.124 -	 */
   1.125 -	IMPORT_C static TUint Switches();
   1.126 -	// other functions to access hardware not covered by specific device-drivres, which may be called from drivers
   1.127 -	// or platform-specifc code
   1.128 -	// ...
   1.129 -public:
   1.130 -	static TUint32 iBaseAddress;
   1.131 -	// (optional): May need to have a follower variable to store the value of a read only register initialised at boot time
   1.132 -	// static TUint aFollower;
   1.133 -    };
   1.134 -
   1.135 -#endif
   1.136 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
   1.137 +// All rights reserved.
   1.138 +// This component and the accompanying materials are made available
   1.139 +// under the terms of the License "Eclipse Public License v1.0"
   1.140 +// which accompanies this distribution, and is available
   1.141 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
   1.142 +//
   1.143 +// Initial Contributors:
   1.144 +// Nokia Corporation - initial contribution.
   1.145 +//
   1.146 +// Contributors:
   1.147 +//
   1.148 +// Description:
   1.149 +// omap3530/beagleboard/inc/iolines.h
   1.150 +// Variant layer header for Beagle Platform
   1.151 +//
   1.152 +
   1.153 +
   1.154 +
   1.155 +#ifndef __V32TEMPLATEV1_H__
   1.156 +#define __V32TEMPLATEV1_H__
   1.157 +#include <e32cmn.h>
   1.158 +#include <kpower.h>
   1.159 +#include <assp/omap3530_assp/omap3530_assp_priv.h>
   1.160 +
   1.161 +//----------------------------------------------------------------------------
   1.162 +// Variant-specific constants: use #define if constant dependencies are not
   1.163 +// declared within this file (this breaks the dependency on other header files)
   1.164 +//----------------------------------------------------------------------------
   1.165 +
   1.166 +// Examples of what goes in here include:
   1.167 +//
   1.168 +// - General-purpose I/O allocation such as 
   1.169 +//	 #define KtVariantGpio32KHzClkOut		KHtGpioPort1
   1.170 +//	 #define KtVariantGpioRClkOut			KHtGpioPort0
   1.171 +//
   1.172 +//	 #define KmVariantPinDirectionIn Sleep	0
   1.173 +//
   1.174 +// - Memory constants (type, geometry, wait states, etc) such as:
   1.175 +//	 #define KwVariantRom0Type				TTemplate::ERomTypeBurst4Rom
   1.176 +//	 #define KwVariantRom0Width				TTemplate::ERomWidth32
   1.177 +//	 const TUint KwVariantRom0WaitNs		= 150;
   1.178 +//	 const TUint KwVariantRom0PageNs		= 30;
   1.179 +//	 const TUint KwVariantRom0RecoverNs		= 55;
   1.180 +//
   1.181 +// - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as 
   1.182 +//	 const TUint KwVariantKeyColLshift		= 7;
   1.183 +//	 #define KwVariantLcdBpp				TTemplate::ELcd8BitsPerPixel
   1.184 +//   const TUint KwVariantLcdMaxColors		= 4096;
   1.185 +//   const TUint KwVariantCodecMaxVolume	= 0;
   1.186 +//
   1.187 +// - Off-chip hardware control blocks (addresses, register make-up)
   1.188 +//
   1.189 +// - Interrupts (second-level Interrupt controller base address, register make-up):
   1.190 +//   (EXAMPLE ONLY:)
   1.191 +const TUint32 KHwVariantPhysBase		=	0x40000000;
   1.192 +const TUint32 KHoVariantRegSpacing		=	0x200;
   1.193 +
   1.194 +const TUint32 KHoBaseIntCont			=	0x0B*KHoVariantRegSpacing;
   1.195 +
   1.196 +const TUint32 KHoIntContEnable			=	0x00;		// offsets from KHwVariantPhysBase+KHoBaseIntCont
   1.197 +const TUint32 KHoIntContPending			=	0x04;
   1.198 +// other Variant and external blocks Base adrress offsets to KHwVariantPhysBase
   1.199 +
   1.200 +
   1.201 +const TInt KIntIdKeyboard=0; 
   1.202 +
   1.203 +
   1.204 +class GpioPin;
   1.205 +
   1.206 +class Variant
   1.207 +    {
   1.208 +	// below is a selection of functions usually implemented  at this level. This do not constitute a mandatory
   1.209 +	// set and it might not be relevant for your hardware...
   1.210 +public:
   1.211 +	/**
   1.212 +	 * initialisation
   1.213 +	 */
   1.214 +	static void Init3();
   1.215 +	/**
   1.216 +	 * Returns the Linear Base address of the Variant Hardware
   1.217 +	 */
   1.218 +	IMPORT_C static TUint BaseLinAddress();
   1.219 +	/**
   1.220 +	 * When invoked, turns off all power supplies
   1.221 +	 */
   1.222 +	IMPORT_C static void PowerReset();
   1.223 +	/**
   1.224 +	 * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation
   1.225 +	 * As in, for example, the serial port was used by a device driver or the system is coming back from Standby
   1.226 +	 */
   1.227 +	IMPORT_C static void MarkDebugPortOff();
   1.228 +	/**
   1.229 +	 * When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings
   1.230 +	 * Called by Template::DebugInit()
   1.231 +	 */
   1.232 +	IMPORT_C static void UartInit();
   1.233 +	/**
   1.234 +	 * When invoked, read the state of on-board switches
   1.235 +	 * @return A bitmask with the state of on-board switches
   1.236 +	 */
   1.237 +	IMPORT_C static TUint Switches();
   1.238 +	// other functions to access hardware not covered by specific device-drivres, which may be called from drivers
   1.239 +	// or platform-specifc code
   1.240 +	// ...
   1.241 +	IMPORT_C static TInt SetGPIOPin(TInt aId,GpioPin *aPin);
   1.242 +	IMPORT_C static TInt GetGPIOPin(TInt aId,GpioPin * aPin);
   1.243 +	IMPORT_C static TInt GetMsTickPeriod();
   1.244 +	
   1.245 +public:
   1.246 +	static TUint32 iBaseAddress;
   1.247 +	// (optional): May need to have a follower variable to store the value of a read only register initialised at boot time
   1.248 +	// static TUint aFollower;
   1.249 +    };
   1.250 +
   1.251 +#endif
   1.252 +