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\variant.h sl@0: // Template Variant Header sl@0: // sl@0: // sl@0: sl@0: #ifndef __VA_STD_H__ sl@0: #define __VA_STD_H__ sl@0: #include sl@0: #include "iolines.h" sl@0: sl@0: NONSHARABLE_CLASS(Template) : public TemplateAssp sl@0: { sl@0: public: sl@0: Template(); sl@0: public: sl@0: /** sl@0: * These are the mandatory Asic class functions which need to be implemented here. The other mandatory sl@0: * functions are implemented in TemplateAssp sl@0: */ sl@0: sl@0: /** sl@0: * initialisation sl@0: */ sl@0: virtual void Init1(); sl@0: virtual void Init3(); sl@0: sl@0: /** sl@0: * power management sl@0: * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it sl@0: */ sl@0: virtual void Idle(); sl@0: sl@0: /** sl@0: * debug sl@0: * @param aChar Character to be output by debug serial port sl@0: */ sl@0: virtual void DebugOutput(TUint aChar); sl@0: sl@0: /** sl@0: * HAL sl@0: * @param aFunction A TVariantHalFunction enumerated value sl@0: * @param a1 Optional input/output parameter sl@0: * @param a2 Optional input/output parameter sl@0: * @return System wide error code. sl@0: * @see TVariantHalFunction sl@0: */ sl@0: virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2); sl@0: sl@0: /** sl@0: * Machine configuration sl@0: * @return Pointer to a device configuration information sl@0: * @see TTemplateMachineConfig sl@0: */ sl@0: virtual TPtr8 MachineConfiguration(); sl@0: sl@0: public: sl@0: /** sl@0: * external interrupt handling sl@0: * These are used to model second-level interrupt controllers at Variant level sl@0: * @param anId An interrupt identification number (TTemplateInterruptId enumerated value) sl@0: * @param an Isr Address of an Interrupt Service Routine sl@0: * @param aPtr Extra parameter to be passed to ISR function sl@0: * @return System wide error code sl@0: * @see TTemplateInterruptId sl@0: */ sl@0: sl@0: virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr); sl@0: virtual TInt InterruptUnbind(TInt anId); sl@0: virtual TInt InterruptEnable(TInt anId); sl@0: virtual TInt InterruptDisable(TInt anId); sl@0: virtual TInt InterruptClear(TInt anId); sl@0: sl@0: /** sl@0: * USB client controller - Some example functions for the case that USB cable detection and sl@0: * UDC connect/disconnect functionality are part of the Variant. sl@0: * These virtual functions are called by the USB PSL (pa_usbc.cpp). sl@0: * If this functionality is part of the ASSP then these functions can be removed as calls to them sl@0: * in the PSL will have been replaced by the appropriate internal operations. sl@0: */ sl@0: virtual TBool UsbClientConnectorDetectable(); sl@0: virtual TBool UsbClientConnectorInserted(); sl@0: virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr); sl@0: virtual void UnregisterUsbClientConnectorCallback(); sl@0: virtual TBool UsbSoftwareConnectable(); sl@0: virtual TInt UsbConnect(); sl@0: virtual TInt UsbDisconnect(); sl@0: sl@0: /** sl@0: * miscellaneous if Video buffer is allocated in the main System memory during ASSP/Variant initialisation sl@0: * this will return the required size @return Size (in bytes) of required RAM for Video buffer sl@0: */ sl@0: virtual TInt VideoRamSize(); sl@0: sl@0: /** sl@0: * RAM zone callback functions that will be invoked by the kernel when a RAM zone sl@0: * operation should be performed. sl@0: */ sl@0: static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks); sl@0: TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks); sl@0: sl@0: private: // or public: sl@0: static void InitInterrupts(); sl@0: static void Spurious(TAny* aId); sl@0: void DebugInit(); sl@0: public: sl@0: // TLinAddr iIdleFunction; // may be used to point to a Bootstrap routine which prepares the CPU to Sleep sl@0: TBool iDebugInitialised; sl@0: static TUint32 HandlerData[3]; sl@0: static SInterruptHandler Handlers[ENumXInts]; sl@0: sl@0: private: sl@0: static void UsbClientConnectorIsr(TAny *); sl@0: sl@0: private: sl@0: TInt (*iUsbClientConnectorCallback)(TAny*); sl@0: TAny* iUsbClientConnectorCallbackArg; sl@0: }; sl@0: sl@0: GLREF_D Template TheVariant; sl@0: sl@0: #endif