os/kernelhwsrv/bsptemplate/asspandvariant/template_variant/inc/variant.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// template\template_variant\inc\variant.h
sl@0
    15
// Template Variant Header
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
#ifndef __VA_STD_H__
sl@0
    20
#define __VA_STD_H__
sl@0
    21
#include <template_assp_priv.h>
sl@0
    22
#include "iolines.h"
sl@0
    23
sl@0
    24
NONSHARABLE_CLASS(Template) : public TemplateAssp
sl@0
    25
	{
sl@0
    26
public:
sl@0
    27
	Template();
sl@0
    28
public:
sl@0
    29
	/**
sl@0
    30
	 * These are the mandatory Asic class functions which need to be implemented here. The other mandatory
sl@0
    31
	 * functions are implemented in TemplateAssp
sl@0
    32
	 */
sl@0
    33
sl@0
    34
	/**
sl@0
    35
	 * initialisation
sl@0
    36
	 */
sl@0
    37
	virtual void Init1();
sl@0
    38
	virtual void Init3();
sl@0
    39
sl@0
    40
	/**
sl@0
    41
 	 * power management
sl@0
    42
 	 * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it
sl@0
    43
 	 */
sl@0
    44
 	virtual void Idle();
sl@0
    45
sl@0
    46
 	/**
sl@0
    47
	 * debug
sl@0
    48
	 * @param aChar Character to be output by debug serial port
sl@0
    49
	 */
sl@0
    50
	virtual void DebugOutput(TUint aChar);
sl@0
    51
sl@0
    52
	/**
sl@0
    53
	 * HAL
sl@0
    54
	 * @param aFunction A TVariantHalFunction enumerated value
sl@0
    55
	 * @param a1 Optional input/output parameter
sl@0
    56
	 * @param a2 Optional input/output parameter
sl@0
    57
	 * @return System wide error code. 
sl@0
    58
	 * @see TVariantHalFunction
sl@0
    59
	 */
sl@0
    60
	virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
sl@0
    61
sl@0
    62
	/**
sl@0
    63
	 * Machine configuration
sl@0
    64
	 * @return Pointer to a device configuration information
sl@0
    65
	 * @see TTemplateMachineConfig
sl@0
    66
	 */
sl@0
    67
	virtual TPtr8 MachineConfiguration();
sl@0
    68
sl@0
    69
public:
sl@0
    70
	/**
sl@0
    71
	 * external interrupt handling
sl@0
    72
	 * These are used to model second-level interrupt controllers at Variant level
sl@0
    73
	 * @param anId An interrupt identification number (TTemplateInterruptId enumerated value)
sl@0
    74
	 * @param an Isr Address of an Interrupt Service Routine
sl@0
    75
	 * @param aPtr Extra parameter to be passed to ISR function
sl@0
    76
	 * @return System wide error code
sl@0
    77
	 * @see TTemplateInterruptId
sl@0
    78
	 */
sl@0
    79
sl@0
    80
	virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr);
sl@0
    81
	virtual TInt InterruptUnbind(TInt anId);
sl@0
    82
	virtual TInt InterruptEnable(TInt anId);
sl@0
    83
	virtual TInt InterruptDisable(TInt anId);
sl@0
    84
	virtual TInt InterruptClear(TInt anId);
sl@0
    85
sl@0
    86
	/**
sl@0
    87
	 * USB client controller - Some example functions for the case that USB cable detection and
sl@0
    88
	 * UDC connect/disconnect functionality are part of the Variant.
sl@0
    89
	 * These virtual functions are called by the USB PSL (pa_usbc.cpp).
sl@0
    90
	 * If this functionality is part of the ASSP then these functions can be removed as calls to them
sl@0
    91
	 * in the PSL will have been replaced by the appropriate internal operations.
sl@0
    92
	 */
sl@0
    93
	virtual TBool UsbClientConnectorDetectable();
sl@0
    94
	virtual TBool UsbClientConnectorInserted();
sl@0
    95
	virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr);
sl@0
    96
	virtual void UnregisterUsbClientConnectorCallback();
sl@0
    97
	virtual TBool UsbSoftwareConnectable();
sl@0
    98
	virtual TInt UsbConnect();
sl@0
    99
	virtual TInt UsbDisconnect();
sl@0
   100
sl@0
   101
	/**
sl@0
   102
	 * miscellaneous if Video buffer is allocated in the main System memory during ASSP/Variant initialisation
sl@0
   103
	 * this will return the required size @return Size (in bytes) of required RAM for Video buffer
sl@0
   104
	 */
sl@0
   105
	virtual TInt VideoRamSize();
sl@0
   106
sl@0
   107
	/**
sl@0
   108
	 * RAM zone callback functions that will be invoked by the kernel when a RAM zone
sl@0
   109
	 * operation should be performed.
sl@0
   110
	 */
sl@0
   111
	static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks);
sl@0
   112
	TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks);
sl@0
   113
sl@0
   114
private: // or public:
sl@0
   115
	static void InitInterrupts();
sl@0
   116
	static void Spurious(TAny* aId);
sl@0
   117
	void DebugInit();
sl@0
   118
public:
sl@0
   119
	// TLinAddr iIdleFunction;		// may be used to point to a Bootstrap routine which prepares the CPU to Sleep 
sl@0
   120
	TBool iDebugInitialised;
sl@0
   121
	static TUint32 HandlerData[3];
sl@0
   122
	static SInterruptHandler Handlers[ENumXInts];
sl@0
   123
sl@0
   124
private:
sl@0
   125
	static void UsbClientConnectorIsr(TAny *);
sl@0
   126
sl@0
   127
private:
sl@0
   128
	TInt (*iUsbClientConnectorCallback)(TAny*);
sl@0
   129
	TAny* iUsbClientConnectorCallbackArg;
sl@0
   130
	};
sl@0
   131
sl@0
   132
GLREF_D Template TheVariant;
sl@0
   133
sl@0
   134
#endif