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