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