navienginebsp/naviengine_assp/upd35001_timer.h
author Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
Fri, 08 Oct 2010 14:36:55 +0100
changeset 4 5937e08d5244
parent 0 5de814552237
permissions -rw-r--r--
Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     1
/*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     8
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    11
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    12
* Contributors:
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    13
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    14
* Description:  
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    15
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    16
*/
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    17
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    18
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    19
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    20
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    21
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    22
#ifndef __UPD35001_TIMER_H__
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    23
#define __UPD35001_TIMER_H__
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    24
#include <naviengine.h>
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    25
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    26
struct NETimer
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    27
	{
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    28
	static inline NETimer& Timer(TUint a) { return *(NETimer*)(KHwTimersBase + (a<<10)); }
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    29
	volatile TUint32 iTimerCount;				/* counter register */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    30
	volatile TUint32 iTimerCtrl;				/* control register */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    31
	volatile TUint32 iTimerReset;				/* counter resets to zero upon reaching this value */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    32
	volatile TUint32 iGTOPulseStart;			/* output pulse starts at this value */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    33
	volatile TUint32 iGTOPulseEnd;				/* output pulse ends at this value */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    34
	volatile TUint32 iGTICtrl;					/* input capture mode control */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    35
	volatile TUint32 iGTIRisingEdgeCapture;		/* count captured at rising edge */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    36
	volatile TUint32 iGTIFallingEdgeCapture;	/* count captured at falling edge */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    37
	volatile TUint32 iGTInterrupt;				/* interrupt flags */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    38
	volatile TUint32 iGTInterruptEnable;		/* interrupt enable mask */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    39
	volatile TUint32 iPrescaler;				/* prescaler control */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    40
	};
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    41
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    42
const TUint32	KNETimerCtrl_CAE			= 0x00000001u;	/* Count up enable (held static until set) */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    43
const TUint32	KNETimerCtrl_CE				= 0x00000002u;	/* Counter enable (held at 0 until set) */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    44
const TUint32	KNETimerCtrl_GTOEnable		= 0x00000004u;	/* GTO output enable */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    45
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    46
const TUint32	KNETimerGTICtrl_FAL_M		= 0x00000001u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    47
const TUint32	KNETimerGTICtrl_FAL_C		= 0x00000002u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    48
const TUint32	KNETimerGTICtrl_RIS_M		= 0x00000004u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    49
const TUint32	KNETimerGTICtrl_RIS_C		= 0x00000008u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    50
const TUint32	KNETimerGTICtrl_FilterMask	= 0xfffffff0u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    51
const TUint32	KNETimerGTICtrl_FilterShift	= 4;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    52
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    53
const TUint32	KNETimerGTIInt_GTIFI		= 0x00000001u;	/* interrupt detected on falling edge of GTI */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    54
const TUint32	KNETimerGTIInt_GTIRI		= 0x00000002u;	/* interrupt detected on rising edge of GTI */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    55
const TUint32	KNETimerGTIInt_GTOFI		= 0x00000004u;	/* interrupt detected on falling edge of GTO */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    56
const TUint32	KNETimerGTIInt_GTORI		= 0x00000008u;	/* interrupt detected on rising edge of GTO */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    57
const TUint32	KNETimerGTIInt_TCI			= 0x00000010u;	/* interrupt detected on timer counter reset */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    58
const TUint32	KNETimerGTIInt_All			= 0x0000001fu;	/* mask to clear all pending interrupts */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    59
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    60
const TUint32	KNETimerGTIIntE_GTIFE		= 0x00000001u;	/* interrupt enabled on falling edge of GTI */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    61
const TUint32	KNETimerGTIIntE_GTIRE		= 0x00000002u;	/* interrupt enabled on rising edge of GTI */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    62
const TUint32	KNETimerGTIIntE_GTOFE		= 0x00000004u;	/* interrupt enabled on falling edge of GTO */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    63
const TUint32	KNETimerGTIIntE_GTORE		= 0x00000008u;	/* interrupt enabled on rising edge of GTO */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    64
const TUint32	KNETimerGTIIntE_TCE			= 0x00000010u;	/* interrupt enabled on timer counter reset */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    65
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    66
const TUint32	KNETimerPrescaleBy1			= 0x00000001u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    67
const TUint32	KNETimerPrescaleBy2			= 0x00000002u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    68
const TUint32	KNETimerPrescaleBy4			= 0x00000004u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    69
const TUint32	KNETimerPrescaleBy8			= 0x00000008u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    70
const TUint32	KNETimerPrescaleBy16		= 0x00000010u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    71
const TUint32	KNETimerPrescaleBy32		= 0x00000020u;
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    72
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    73
#endif
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    74
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    75