Update contrib.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // template\template_variant\inc\variant.h
15 // Template Variant Header
21 #include <template_assp_priv.h>
24 NONSHARABLE_CLASS(Template) : public TemplateAssp
30 * These are the mandatory Asic class functions which need to be implemented here. The other mandatory
31 * functions are implemented in TemplateAssp
42 * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it
48 * @param aChar Character to be output by debug serial port
50 virtual void DebugOutput(TUint aChar);
54 * @param aFunction A TVariantHalFunction enumerated value
55 * @param a1 Optional input/output parameter
56 * @param a2 Optional input/output parameter
57 * @return System wide error code.
58 * @see TVariantHalFunction
60 virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
63 * Machine configuration
64 * @return Pointer to a device configuration information
65 * @see TTemplateMachineConfig
67 virtual TPtr8 MachineConfiguration();
71 * external interrupt handling
72 * These are used to model second-level interrupt controllers at Variant level
73 * @param anId An interrupt identification number (TTemplateInterruptId enumerated value)
74 * @param an Isr Address of an Interrupt Service Routine
75 * @param aPtr Extra parameter to be passed to ISR function
76 * @return System wide error code
77 * @see TTemplateInterruptId
80 virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr);
81 virtual TInt InterruptUnbind(TInt anId);
82 virtual TInt InterruptEnable(TInt anId);
83 virtual TInt InterruptDisable(TInt anId);
84 virtual TInt InterruptClear(TInt anId);
87 * USB client controller - Some example functions for the case that USB cable detection and
88 * UDC connect/disconnect functionality are part of the Variant.
89 * These virtual functions are called by the USB PSL (pa_usbc.cpp).
90 * If this functionality is part of the ASSP then these functions can be removed as calls to them
91 * in the PSL will have been replaced by the appropriate internal operations.
93 virtual TBool UsbClientConnectorDetectable();
94 virtual TBool UsbClientConnectorInserted();
95 virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr);
96 virtual void UnregisterUsbClientConnectorCallback();
97 virtual TBool UsbSoftwareConnectable();
98 virtual TInt UsbConnect();
99 virtual TInt UsbDisconnect();
102 * miscellaneous if Video buffer is allocated in the main System memory during ASSP/Variant initialisation
103 * this will return the required size @return Size (in bytes) of required RAM for Video buffer
105 virtual TInt VideoRamSize();
108 * RAM zone callback functions that will be invoked by the kernel when a RAM zone
109 * operation should be performed.
111 static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks);
112 TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks);
114 private: // or public:
115 static void InitInterrupts();
116 static void Spurious(TAny* aId);
119 // TLinAddr iIdleFunction; // may be used to point to a Bootstrap routine which prepares the CPU to Sleep
120 TBool iDebugInitialised;
121 static TUint32 HandlerData[3];
122 static SInterruptHandler Handlers[ENumXInts];
125 static void UsbClientConnectorIsr(TAny *);
128 TInt (*iUsbClientConnectorCallback)(TAny*);
129 TAny* iUsbClientConnectorCallbackArg;
132 GLREF_D Template TheVariant;