epoc32/include/assp/template_assp/template_assp_priv.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // template\template_assp\template_assp_priv.h
    15 // Template ASSP architecture private header file
    16 // 
    17 //
    18 
    19 
    20 
    21 #ifndef __KA_TEMPLATE_H__
    22 #define __KA_TEMPLATE_H__
    23 #include <e32const.h>
    24 #include <arm.h>
    25 #include <assp.h>
    26 #include <template_assp.h>
    27 
    28 // Example only
    29 const TInt KNumTemplateInts=EAsspIntIdZ+1;
    30 
    31 class TemplateInterrupt : public Interrupt
    32 	{
    33 public:
    34 	/**
    35 	 * These functions are required to initialise the Interrupt controller,or perform housekeeping
    36 	 * functions, or dispatch the incoming IRQ or FIQ interrupts.
    37 	 */
    38 
    39 	/**
    40 	 * initialisation
    41 	 */
    42 	static void Init1();
    43 	static void Init3();
    44 	/**
    45 	 * IRQ/FIQ dispatchers
    46 	 */
    47 	static void IrqDispatch();
    48 	static void FiqDispatch();
    49 	/**
    50 	 * Housekeeping (disable and clear all hardware interrupt sources)
    51 	 */
    52 	static void DisableAndClearAll();
    53 	/**
    54 	 * Empty interrupt handler
    55 	 */
    56 	static void Spurious(TAny* anId);
    57 public:
    58 	static SInterruptHandler Handlers[KNumTemplateInts];
    59 	};
    60 
    61 class TemplateAssp : public Asic
    62 	{
    63 public:
    64 	IMPORT_C TemplateAssp();
    65 
    66 public:
    67 	/**
    68 	 * These are the mandatory Asic class functions which are implemented here rather than in the Variant.
    69 	 * It makes sense having an ASSP class when there is functionality at Variant/Core level which is common
    70 	 * to a group of devices and is provided by an IP block(s) which is likely to be used in future generations
    71 	 * of the same family of devices.
    72 	 * In general the common functionality includes first-level Interrupt controllers, Power and Reset controllers,
    73 	 * and timing functions
    74 	 */
    75 
    76 	/**
    77 	 * initialisation
    78 	 */
    79 	IMPORT_C virtual void Init1();
    80 	IMPORT_C virtual void Init3();
    81 	/**
    82 	 * Read and return the Startup reason of the Super Page (set up by Bootstrap)
    83 	 * @return A TMachineStartupType enumerated value
    84 	 * @see TMachineStartupType
    85 	 */
    86 	IMPORT_C virtual TMachineStartupType StartupReason();
    87 
    88 	/**
    89 	 * timing functions
    90 	 */
    91 
    92 	/**
    93 	 * Obtain the period of System Tick timer in microseconds
    94 	 * @return Period of System Tick timer in microseconds
    95 	 */
    96 	IMPORT_C virtual TInt MsTickPeriod();
    97 	/**
    98 	 * Obtain System Time from the RTC
    99 	 * @return System Time in seconds from 00:00 hours of 1/1/2000
   100 	 */
   101 	IMPORT_C virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
   102 	/**
   103 	 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
   104 	 * @return System wide error code
   105 	 */
   106 	IMPORT_C virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
   107 	/**
   108 	 * Obtain the time it takes to execute two processor instructions
   109 	 * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
   110 	 */
   111 	IMPORT_C virtual TUint32 NanoWaitCalibration();
   112 
   113 public:
   114 	/**
   115 	 * for derivation by Variant
   116 	 */
   117 
   118 	/**
   119 	 * external interrupt handling
   120 	 * used by second-level interrupt controllers at Variant level
   121 	 */
   122 	virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
   123 	virtual TInt InterruptUnbind(TInt anId)=0;
   124 	virtual TInt InterruptEnable(TInt anId)=0;
   125 	virtual TInt InterruptDisable(TInt anId)=0;
   126 	virtual TInt InterruptClear(TInt anId)=0;
   127 
   128 	/**
   129 	 * USB client controller - Some example functions for the case that USB cable detection and
   130 	 * UDC connect/disconnect functionality are part of the Variant.
   131 	 * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
   132 	 * If this functionality is part of the ASSP then these functions can be removed and calls to them
   133 	 * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
   134 	 */
   135 	virtual TBool UsbClientConnectorDetectable()=0;
   136 	virtual TBool UsbClientConnectorInserted()=0;
   137 	virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
   138 	virtual void UnregisterUsbClientConnectorCallback()=0;
   139 	virtual TBool UsbSoftwareConnectable()=0;
   140 	virtual TInt UsbConnect()=0;
   141 	virtual TInt UsbDisconnect()=0;
   142 
   143 	/**
   144 	 * miscellaneous
   145 	 */
   146 	virtual TInt VideoRamSize()=0;
   147 
   148 public:
   149 	static TemplateAssp* Variant;
   150 	static TPhysAddr VideoRamPhys;
   151 	NTimerQ* iTimerQ;
   152 	};
   153 
   154 #endif