bsptemplate/asspandvariant/template_variant/inc/variant.h
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // template\template_variant\inc\variant.h
       
    15 // Template Variant Header
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef __VA_STD_H__
       
    20 #define __VA_STD_H__
       
    21 #include <template_assp_priv.h>
       
    22 #include "iolines.h"
       
    23 
       
    24 NONSHARABLE_CLASS(Template) : public TemplateAssp
       
    25 	{
       
    26 public:
       
    27 	Template();
       
    28 public:
       
    29 	/**
       
    30 	 * These are the mandatory Asic class functions which need to be implemented here. The other mandatory
       
    31 	 * functions are implemented in TemplateAssp
       
    32 	 */
       
    33 
       
    34 	/**
       
    35 	 * initialisation
       
    36 	 */
       
    37 	virtual void Init1();
       
    38 	virtual void Init3();
       
    39 
       
    40 	/**
       
    41  	 * power management
       
    42  	 * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it
       
    43  	 */
       
    44  	virtual void Idle();
       
    45 
       
    46  	/**
       
    47 	 * debug
       
    48 	 * @param aChar Character to be output by debug serial port
       
    49 	 */
       
    50 	virtual void DebugOutput(TUint aChar);
       
    51 
       
    52 	/**
       
    53 	 * HAL
       
    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
       
    59 	 */
       
    60 	virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
       
    61 
       
    62 	/**
       
    63 	 * Machine configuration
       
    64 	 * @return Pointer to a device configuration information
       
    65 	 * @see TTemplateMachineConfig
       
    66 	 */
       
    67 	virtual TPtr8 MachineConfiguration();
       
    68 
       
    69 public:
       
    70 	/**
       
    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
       
    78 	 */
       
    79 
       
    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);
       
    85 
       
    86 	/**
       
    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.
       
    92 	 */
       
    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();
       
   100 
       
   101 	/**
       
   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
       
   104 	 */
       
   105 	virtual TInt VideoRamSize();
       
   106 
       
   107 	/**
       
   108 	 * RAM zone callback functions that will be invoked by the kernel when a RAM zone
       
   109 	 * operation should be performed.
       
   110 	 */
       
   111 	static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks);
       
   112 	TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks);
       
   113 
       
   114 private: // or public:
       
   115 	static void InitInterrupts();
       
   116 	static void Spurious(TAny* aId);
       
   117 	void DebugInit();
       
   118 public:
       
   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];
       
   123 
       
   124 private:
       
   125 	static void UsbClientConnectorIsr(TAny *);
       
   126 
       
   127 private:
       
   128 	TInt (*iUsbClientConnectorCallback)(TAny*);
       
   129 	TAny* iUsbClientConnectorCallbackArg;
       
   130 	};
       
   131 
       
   132 GLREF_D Template TheVariant;
       
   133 
       
   134 #endif