omap3530/assp/inc/omap3530_timer.inl
changeset 0 6663340f3fc9
equal deleted inserted replaced
-1:000000000000 0:6663340f3fc9
       
     1 // Copyright (c) 2008-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // omap3530/assp/inc/omap3530_timer.inl
       
    15 //
       
    16 
       
    17 
       
    18 #ifndef __OMAP3530_TIMER_INL__
       
    19 #	define _OMAP3530_TIMER_INL__
       
    20 
       
    21 /**
       
    22 @file
       
    23 	omap3530_timer.inl header file
       
    24 This file provides timer handling for the omap3530 timers
       
    25 @publishedAll
       
    26 @released
       
    27 */
       
    28 
       
    29 #	include <assp/omap3530_assp/omap3530_prcm.h>
       
    30 
       
    31 inline void CompileTimeChecks(void) ;
       
    32 
       
    33 namespace OMAP3530
       
    34 	{
       
    35 
       
    36 	namespace GPTimer
       
    37 		{
       
    38 
       
    39 		template <const TLinAddr bAsEaDdReSs>
       
    40 		inline TOmap3530_IRQ TGPTi<bAsEaDdReSs>::Irq()
       
    41 			{
       
    42 			return TOmap3530_IRQ(TTimerTraits<bAsEaDdReSs>::KIrq) ;
       
    43 			}
       
    44 			
       
    45 		template <const TLinAddr bAsEaDdReSs>
       
    46 		inline void TGPTi<bAsEaDdReSs>::SelectClock()
       
    47 			{
       
    48 			typename TTimerTraits<bAsEaDdReSs>::TClockSelReg		reg ;
       
    49 			reg.Modify(!TTimerTraits<bAsEaDdReSs>::KClockSelMask,
       
    50 					   TTimerTraits<bAsEaDdReSs>::KClockSelValue) ;
       
    51 			}
       
    52 			
       
    53 		template <const TLinAddr bAsEaDdReSs>
       
    54 		inline TBool TGPTi<bAsEaDdReSs>::CanWriteTCLR()
       
    55 			{
       
    56 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TCLR::KOn)) ;
       
    57 			}
       
    58 			
       
    59 		template <const TLinAddr bAsEaDdReSs>
       
    60 		inline TBool TGPTi<bAsEaDdReSs>::CanWriteTCRR()
       
    61 			{
       
    62 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TCRR::KOn)) ;
       
    63 			}
       
    64 			
       
    65 		template <const TLinAddr bAsEaDdReSs>
       
    66 		inline TBool TGPTi<bAsEaDdReSs>::CanWriteTLDR()
       
    67 			{
       
    68 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TLDR::KOn)) ;
       
    69 			}
       
    70 			
       
    71 		template <const TLinAddr bAsEaDdReSs>
       
    72 		inline TBool TGPTi<bAsEaDdReSs>::CanWriteTTGR()
       
    73 			{
       
    74 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TTGR::KOn)) ;
       
    75 			}
       
    76 			
       
    77 		template <const TLinAddr bAsEaDdReSs>
       
    78 		inline TBool TGPTi<bAsEaDdReSs>::CanWriteTMAR()
       
    79 			{
       
    80 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TMAR::KOn)) ;
       
    81 			}
       
    82 			
       
    83 		template <const TLinAddr bAsEaDdReSs>
       
    84 		inline void TGPTi<bAsEaDdReSs>::Reset()
       
    85 			{
       
    86 			iTIOCP_CFG.Write(TIOCP_CFG::T_SOFTRESET::KOn) ;
       
    87 			}
       
    88 			
       
    89 		template <const TLinAddr bAsEaDdReSs>
       
    90 		inline TBool TGPTi<bAsEaDdReSs>::ResetComplete()
       
    91 			{
       
    92 			return (TISTAT::T_RESETDONE::KOn & iTISTAT.Read()) ;
       
    93 			}
       
    94 			
       
    95 		template <const TLinAddr bAsEaDdReSs>
       
    96 		inline ::TBool TGPTi<bAsEaDdReSs>::WriteOutstanding()
       
    97 			{
       
    98 			return (iTWPS.Read()) ;
       
    99 			}
       
   100 			
       
   101 
       
   102 		template <TLinAddr bAsEaDdReSs>
       
   103 		inline TBool TMsSyncTimer<bAsEaDdReSs>::CanWriteTPIR()
       
   104 			{
       
   105 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TPIR::KOn)) ;
       
   106 			}
       
   107 			
       
   108 		template <TLinAddr bAsEaDdReSs>
       
   109 		inline TBool TMsSyncTimer<bAsEaDdReSs>::CanWriteTNIR()
       
   110 			{
       
   111 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TNIR::KOn)) ;
       
   112 			}
       
   113 			
       
   114 		template <TLinAddr bAsEaDdReSs>
       
   115 		inline TBool TMsSyncTimer<bAsEaDdReSs>::CanWriteTCVR()
       
   116 			{
       
   117 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TCVR::KOn)) ;
       
   118 			}
       
   119 			
       
   120 		template <TLinAddr bAsEaDdReSs>
       
   121 		inline TBool TMsSyncTimer<bAsEaDdReSs>::CanWriteTOCR()
       
   122 			{
       
   123 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TOCR::KOn)) ;
       
   124 			}
       
   125 			
       
   126 		template <TLinAddr bAsEaDdReSs>
       
   127 		inline TBool TMsSyncTimer<bAsEaDdReSs>::CanWriteTOWR()
       
   128 			{
       
   129 			return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TOWR::KOn)) ;
       
   130 			}
       
   131 			
       
   132 		}	// namespace GPTimer
       
   133 		
       
   134 	}	// namespace OMAP3530
       
   135 
       
   136 #endif	/* ndef __OMAP3530_TIMER_INL__ */