navienginebsp/naviengine_assp/highrestimer.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 * Defintions for High resolution timer
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __HIGHRESTIMER_H__
       
    24 #define __HIGHRESTIMER_H__
       
    25 
       
    26 /**
       
    27  * Macro indicating that a high resolution timer is supported.
       
    28  */
       
    29 #define HAS_HIGH_RES_TIMER
       
    30 
       
    31 #ifdef __MEMMODEL_DIRECT__
       
    32 #define HIGH_RES_COUNT_HW_ADDR 0x18036800	/* address of timer 2 counter */
       
    33 #else
       
    34 #define HIGH_RES_COUNT_HW_ADDR 0xC6003800	/* address of timer 2 counter */
       
    35 #endif
       
    36 
       
    37 /**
       
    38  * Assembler macro to get the the current value of the high res timer and place
       
    39  * it in the specified register.
       
    40  */
       
    41 #define GET_HIGH_RES_TICK_COUNT(Rd) \
       
    42 	asm("ldr	"#Rd", = %a0" : : "i" (HIGH_RES_COUNT_HW_ADDR)); \
       
    43 	asm("ldr	"#Rd", ["#Rd"]")
       
    44 
       
    45 /**
       
    46  * The frequency of the timer in Hz.
       
    47  */
       
    48 const TInt KHighResTimerFrequency = 2083333; // 200MHz/(3*32)
       
    49 
       
    50 /**
       
    51  * Macro indicating that the timer counts up if defined.
       
    52  */
       
    53 #define HIGH_RES_TIMER_COUNTS_UP
       
    54 
       
    55 #endif