1 // Copyright (c) 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".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    14 // /omap3530/assp/inc/omap3530_timer.h
 
    17 #ifndef HEADER_OMAP3530_TIMER_H_INCLUDED
 
    18 #	define HEADER_OMAP3530_TIMER_H_INCLUDED
 
    22 	omap3530_timer.h header file
 
    23 This file provides timer handling for the omap3530 timers
 
    28 #include <assp/omap3530_assp/omap3530_hardware_base.h>
 
    29 #include <assp/omap3530_assp/omap3530_irqmap.h>
 
    31 namespace TexasInstruments
 
    44 					0 AUTOIDLE Internal L4 interface clock gating strategy 0
 
    45 					0x0: L4 interface clock is free-running.
 
    46 					0x1: Automatic L4 interface clock gating strategy isapplied, based on the L4 interface activity.
 
    48 				typedef TSingleBitField<0>	T_AUTOIDLE ;
 
    51 					1 SOFTRESET Software reset. This bit is automatically reset by the RW 0 hardware. During reads, it always returns 0.
 
    53 					0x1: The module is reset.
 
    55 				typedef TSingleBitField<1>	T_SOFTRESET ;
 
    58 					2 ENAWAKEUP Wake-up feature global control RW 0
 
    59 					0x0: No wake-up line assertion in idle mode
 
    60 					0x1: Wake-up line assertion enabled in smart-idle mode
 
    62 				typedef TSingleBitField<2>	T_ENAWAKEUP ;
 
    65 					4:3 IDLEMODE Power management, req/ack control RW 0x0
 
    66 					0x0: Force-idle. An idle request is acknowledged unconditionally.
 
    67 					0x1: No-idle. An idle request is never acknowledged.
 
    68 					0x2: Smart-idle. Acknowledgement to an idle request is given based on the internal activity of the module.
 
    69 					0x3: Reserved. Do not use.
 
    71 				class T_IDLEMODE : public TBitField<3, 2>
 
    76 						KForceIdle		= TConstVal<0>::KValue,
 
    77 						KNoIdle			= TConstVal<1>::KValue,
 
    78 						KSmartIdle		= TConstVal<2>::KValue
 
    83 					5 EMUFREE Emulation mode RW 0
 
    84 					0x0: Timer counter frozen in emulation
 
    85 					0x1: Timer counter free-running in emulation
 
    87 				typedef TSingleBitField<5>	T_EMUFREE ;
 
    90 					9:8 CLOCKACTIVITY Clock activity during wakeup mode period: RW 0x0
 
    91 					0x0: L4 interface and Functional clocks can be switched off.
 
    92 					0x1: L4 interface clock is maintained during wake-up period; Functional clock can be switched off.
 
    93 					0x2: L4 interface clock can be switched off; Functional clock is maintained during wake-up period.
 
    94 					0x3: L4 interface and Functional clocks are maintained during wake-up period.
 
    96 				class T_CLOCKACTIVITY : public TBitField<8, 2>
 
   101 						KMaintainNeither	= TConstVal<0>::KValue,
 
   102 						KMaintainIfClock	= TConstVal<1>::KValue,
 
   103 						KMaintainFuncClock	= TConstVal<2>::KValue,
 
   104 						KMaintainBoth		= TConstVal<3>::KValue
 
   108 				} ;	// namespace TIOCP_CFG
 
   113 				0 RESETDONE Internal reset monitoring R 0
 
   114 				0x0: Internal module reset is ongoing.
 
   117 				typedef TSingleBitField<0>	T_RESETDONE ;
 
   119 				} ;	// namespace TISTAT
 
   124 				0 MAT_IT_FLAG Pending match interrupt status RW 0
 
   125 				Read 0x0: No match interrupt pending
 
   126 				Write 0x0: Status unchanged
 
   127 				Read 0x1: Match interrupt pending
 
   128 				Write 0x1: Status bit cleared
 
   130 				typedef TSingleBitField<0>	T_MAT_IT_FLAG ;
 
   133 				1 OVF_IT_FLAG Pending overflow interrupt status RW 0
 
   134 				Read 0x0: No overflow interrupt pending
 
   135 				Write 0x0: Status unchanged
 
   136 				Read 0x1: Overflow interrupt pending
 
   137 				Write 0x1: Status bit cleared
 
   139 				typedef TSingleBitField<1>	T_OVF_IT_FLAG ;
 
   142 				2 TCAR_IT_FLAG Pending capture interrupt status RW 0
 
   143 				Read 0x0: No capture interrupt event pending
 
   144 				Write 0x0: Status unchanged
 
   145 				Read 0x1: Capture interrupt event pending
 
   146 				Write 0x1: Status bit cleared
 
   148 				typedef TSingleBitField<2>	T_TCAR_IT_FLAG ;
 
   150 				} ;	// namespace TISR
 
   155 				0 MAT_IT_ENA Enable match interrupt RW 0
 
   156 				0x0: Disable match interrupt.
 
   157 				0x1: Enable match interrupt.
 
   159 				typedef TSingleBitField<0>	T_MAT_IT_ENA ;
 
   162 				1 OVF_IT_ENA Enable overflow interrupt RW 0
 
   163 				0x0: Disable overflow interrupt.
 
   164 				0x1: Enable overflow interrupt.
 
   166 				typedef TSingleBitField<1>	T_OVF_IT_ENA ;
 
   169 				2 TCAR_IT_ENA Enable capture interrupt RW 0
 
   170 				0x0: Disable capture interrupt.
 
   171 				0x1: Enable capture interrupt.
 
   173 				typedef TSingleBitField<2>	T_TCAR_IT_ENA ;
 
   175 				} ;	// namespace TIER
 
   180 				0 MAT_WUP_ENA Enable match wake-up RW 0
 
   181 				0x0: Disable match wake-up.
 
   182 				0x1: Enable match wake-up.
 
   184 				typedef TSingleBitField<0>	T_MAT_WUP_ENA ;
 
   187 				1 OVF_WUP_ENA Enable overflow wake-up RW 0
 
   188 				0x0: Disable overflow wake-up.
 
   189 				0x1: Enable overflow wake-up.
 
   191 				typedef TSingleBitField<1>	T_OVF_WUP_ENA ;
 
   194 				2 TCAR_WUP_ENA Enable capture wake-up RW 0
 
   195 				0x0: Disable capture wake-up.
 
   196 				0x1: Enable capture wake-up.
 
   198 				typedef TSingleBitField<2>	T_TCAR_WUP_ENA ;
 
   200 				} ;	// namespace TWER
 
   205 				0 ST Start/stop timer control RW 0
 
   209 				typedef TSingleBitField<0>	T_ST ;
 
   212 				1 AR Autoreload mode RW 0
 
   213 				0x0: One-shot mode overflow
 
   214 				0x1: Autoreload mode overflow
 
   216 				typedef TSingleBitField<1>	T_AR ;
 
   219 				4:2 PTV Trigger output mode
 
   220 				0x0: The timer counter is prescaled with the value: RW 0x0
 
   221 				2(PTV+1). Example: PTV = 3, counter increases value (if started) after 16 functional clock periods.
 
   223 				class T_PTV : public TBitField<2, 3>
 
   228 						KPS_2		= TConstVal<0>::KValue,
 
   229 						KPS_4		= TConstVal<1>::KValue,
 
   230 						KPS_8		= TConstVal<2>::KValue,
 
   231 						KPS_16		= TConstVal<3>::KValue,
 
   232 						KPS_32		= TConstVal<4>::KValue,
 
   233 						KPS_64		= TConstVal<5>::KValue,
 
   234 						KPS_128		= TConstVal<6>::KValue,
 
   235 						KPS_256		= TConstVal<7>::KValue
 
   240 				5 PRE Prescaler enable RW 0
 
   241 				0x0: Prescaler disabled
 
   242 				0x1: Prescaler enabled
 
   244 				typedef TSingleBitField<5>	T_PRE ;
 
   247 				6 CE Compare enable RW 0
 
   248 				0x0: Compare disabled
 
   251 				typedef TSingleBitField<6>	T_CE ;
 
   254 				7 SCPWM Pulse-width-modulation output pin default setting when RW 0
 
   255 				counter is stopped or trigger output mode is set to no trigger.
 
   256 				0x0: Default value of PWM_out output: 0
 
   257 				0x1: Default value of PWM_out output: 1
 
   259 				typedef TSingleBitField<7>	T_SCPWM ;
 
   262 				9:8 TCM Transition capture mode RW 0x0
 
   264 				0x1: Capture on rising edges of EVENT_CAPTURE pin.
 
   265 				0x2: Capture on falling edges of EVENT_CAPTURE pin.
 
   266 				0x3: Capture on both edges of EVENT_CAPTURE pin.
 
   268 				class T_TCM : public TBitField<8, 2>
 
   273 						KNoCapture			= TConstVal<0>::KValue,
 
   274 						KRisingEdge			= TConstVal<1>::KValue,
 
   275 						KFallingEdge		= TConstVal<2>::KValue,
 
   276 						KBothEdges			= TConstVal<3>::KValue
 
   281 				11:10 TRG Trigger output mode RW 0x0
 
   283 				0x1: Overflow trigger
 
   284 				0x2: Overflow and match trigger
 
   287 				class T_IDLEMODE : public TBitField<10, 2>
 
   292 						KNoTrigger				= TConstVal<0>::KValue,
 
   293 						KOverflow				= TConstVal<1>::KValue,
 
   294 						KOverflowAndMatch		= TConstVal<2>::KValue
 
   299 				12 PT Pulse or toggle select bit RW 0
 
   300 				0x0: Pulse modulation
 
   301 				0x1: Toggle modulation
 
   303 				typedef TSingleBitField<12>	T_PT ;
 
   306 				13 CAPT_MODE Capture mode select bit (first/second) RW 0
 
   307 				0x0: Capture the first enabled capture event in TCAR1.
 
   308 				0x1: Capture the second enabled capture event in TCAR2.
 
   310 				typedef TSingleBitField<13>	T_CAPT_MODE ;
 
   313 				14 GPO_CFG PWM output/event detection input pin direction control: RW 0
 
   314 				0x0: Configures the pin as an output (needed when PWM mode is required)
 
   315 				0x1: Configures the pin as an input (needed when capture mode is required)
 
   317 				typedef TSingleBitField<14>	T_GPO_CFG ;
 
   319 				} ;	// namespace TCLR
 
   324 				0 W_PEND_TCLR Write pending for register GPT_TCLR R 0
 
   325 				0x0: Control register write not pending
 
   326 				0x1: Control register write pending
 
   328 				typedef TSingleBitField<0>	T_W_PEND_TCLR ;
 
   331 				1 W_PEND_TCRR Write pending for register GPT_TCRR R 0
 
   332 				0x0: Counter register write not pending
 
   333 				0x1: Counter register write pending
 
   335 				typedef TSingleBitField<1>	T_W_PEND_TCRR ;
 
   338 				2 W_PEND_TLDR Write pending for register GPT_TLDR R 0
 
   339 				0x0: Load register write not pending
 
   340 				0x1: Load register write pending
 
   342 				typedef TSingleBitField<2>	T_W_PEND_TLDR ;
 
   345 				3 W_PEND_TTGR Write pending for register GPT_TTGR R 0
 
   346 				0x0: Trigger register write not pending
 
   347 				0x1: Trigger register write pending
 
   349 				typedef TSingleBitField<3>	T_W_PEND_TTGR ;
 
   352 				4 W_PEND_TMAR Write pending for register GPT_TMAR R 0
 
   353 				0x0: Match register write not pending
 
   354 				0x1: Match register write pending
 
   356 				typedef TSingleBitField<4>	T_W_PEND_TMAR;
 
   359 				5 W_PEND_TPIR Write pending for register GPT_TPIR R 0
 
   360 				Reserved for instances 3, 4, 5, 6, 7, 8, 9, 11, 12 Read returns reset value. R 0
 
   361 				0x0: Positive increment register write not pending
 
   362 				0x1: Positive increment register write pending
 
   364 				typedef TSingleBitField<5>	T_W_PEND_TPIR ;
 
   367 				6 W_PEND_TNIR Write pending for register GPT_TNIR R 0
 
   368 				0x0: Negative increment register write not pending
 
   369 				0x1: Negative increment register write pending
 
   370 				Reserved for instances 3, 4, 5, 6, 7, 8, 9, 11, 12 Read returns reset value. R 0
 
   372 				typedef TSingleBitField<6>	T_W_PEND_TNIR ;
 
   375 				7 W_PEND_TCVR Write pending for register GPT_TCVR R 0
 
   376 				0x0: Counter value register write not pending
 
   377 				0x1: Counter value register write pending
 
   378 				Reserved for instances 3, 4, 5, 6, 7, 8, 9, 11, 12 Read returns reset value. R 0
 
   380 				typedef TSingleBitField<7>	T_W_PEND_TCVR ;
 
   383 				8 W_PEND_TOCR Write pending for register GPT_TOCR R 0
 
   384 				0x0: Overflow counter register write not pending
 
   385 				0x1: Overflow counter register write pending
 
   386 				Reserved for instances 3, 4, 5, 6, 7, 8, 9, 11, 12 Read returns reset value. R 0
 
   388 				typedef TSingleBitField<8>	T_W_PEND_TOCR ;
 
   391 				9 W_PEND_TOWR Write pending for register GPT_TOWR R 0
 
   392 				0x0: Overflow wrapping register write not pending
 
   393 				0x1: Overflow wrapping register write pending
 
   394 				Reserved for instances 3, 4, 5, 6, 7, 8, 9, 11, 12 Read returns reset value. R 0
 
   396 				typedef TSingleBitField<9>	T_W_PEND_TOWR ;
 
   398 				} ;	// namespace TWPS
 
   403 				1 SFT Reset software functional registers. This bit is automatically reset RW 0
 
   404 				by the hardware. During reads, it always returns 0.
 
   405 				0x0: Normal functional mode
 
   406 				0x1: The functional registers are reset.
 
   408 				typedef TSingleBitField<1>	T_SFT ;
 
   411 				2 POSTED Posted mode selection RW 1
 
   412 				0x0: Non-posted mode selected
 
   413 				0x1: Posted mode selected
 
   415 				typedef TSingleBitField<2>	T_POSTED ;
 
   417 				} ;	// namespace TSICR
 
   422 				23:0 OVF_COUNTER_VALUE The number of overflow events. RW 0x00000000
 
   424 				class T_OVF_COUNTER_VALUE : public TBitField<0, 24>
 
   432 				} ;	// namespace TOCR
 
   437 				23:0 OVF_WRAPPING_VALUE The number of masked interrupts. RW 0x00000000
 
   439 				class T_OVF_WRAPPING_VALUE : public TBitField<0, 24>
 
   447 				} ;	// namespace TOWR
 
   451 				KGPTIMER1_Base			= TVirtual<0x48318000>::Value,
 
   452 				KGPTIMER2_Base			= TVirtual<0x49032000>::Value,
 
   453 				KGPTIMER3_Base			= TVirtual<0x49034000>::Value,
 
   454 				KGPTIMER4_Base			= TVirtual<0x49036000>::Value,
 
   455 				KGPTIMER5_Base			= TVirtual<0x49038000>::Value,
 
   456 				KGPTIMER6_Base			= TVirtual<0x4903A000>::Value,
 
   457 				KGPTIMER7_Base			= TVirtual<0x4903C000>::Value,
 
   458 				KGPTIMER8_Base			= TVirtual<0x4903E000>::Value,
 
   459 				KGPTIMER9_Base			= TVirtual<0x49040000>::Value,
 
   460 				KGPTIMER10_Base			= TVirtual<0x48086000>::Value,
 
   461 				KGPTIMER11_Base			= TVirtual<0x48088000>::Value,
 
   462 				KGPTIMER12_Base			= TVirtual<0x48304000>::Value,
 
   481 			typedef void (*TTimerIsr)(TAny*) ;
 
   483 			template<const TTimerNumber tImEr>
 
   489 			struct TTimerTraits<EGpTimer1>
 
   493 					KBaseAddress	= KGPTIMER1_Base,
 
   494 					KIrq			= EOmap3530_IRQ37_GPT1_IRQ,
 
   495 					KClockSelMask	= TSingleBitField<7>::KMask,
 
   496 					KClockSelValue	= TSingleBitField<7>::KOn,
 
   501 			struct TTimerTraits<EGpTimer2>
 
   505 					KBaseAddress	= KGPTIMER2_Base,
 
   506 					KIrq	= EOmap3530_IRQ38_GPT2_IRQ,
 
   511 			struct TTimerTraits<EGpTimer3>
 
   515 					KBaseAddress	= KGPTIMER3_Base,
 
   516 					KIrq	= EOmap3530_IRQ39_GPT3_IRQ,
 
   521 			struct TTimerTraits<EGpTimer4>
 
   525 					KBaseAddress	= KGPTIMER4_Base,
 
   526 					KIrq	= EOmap3530_IRQ40_GPT4_IRQ,
 
   531 			struct TTimerTraits<EGpTimer5>
 
   535 					KBaseAddress	= KGPTIMER5_Base,
 
   536 					KIrq	= EOmap3530_IRQ41_GPT5_IRQ,
 
   541 			struct TTimerTraits<EGpTimer6>
 
   545 					KBaseAddress	= KGPTIMER6_Base,
 
   546 					KIrq	= EOmap3530_IRQ42_GPT6_IRQ,
 
   551 			struct TTimerTraits<EGpTimer7>
 
   555 					KBaseAddress	= KGPTIMER7_Base,
 
   556 					KIrq	= EOmap3530_IRQ43_GPT7_IRQ,
 
   561 			struct TTimerTraits<EGpTimer8>
 
   565 					KBaseAddress	= KGPTIMER8_Base,
 
   566 					KIrq	= EOmap3530_IRQ44_GPT8_IRQ,
 
   571 			struct TTimerTraits<EGpTimer9>
 
   575 					KBaseAddress	= KGPTIMER9_Base,
 
   576 					KIrq			= EOmap3530_IRQ45_GPT9_IRQ,
 
   581 			struct TTimerTraits<EGpTimer10>
 
   585 					KBaseAddress	= KGPTIMER10_Base,
 
   586 					KIrq	= EOmap3530_IRQ46_GPT10_IRQ,
 
   591 			struct TTimerTraits<EGpTimer11>
 
   595 					KBaseAddress	= KGPTIMER11_Base,
 
   596 					KIrq			= EOmap3530_IRQ47_GPT11_IRQ,
 
   601 			struct TTimerTraits<EGpTimer12>
 
   605 					KBaseAddress	= KGPTIMER12_Base,
 
   606 					KIrq			= EOmap3530_IRQ95_GPT12_IRQ,
 
   611 					KClockSelValue	= KClockSel32K
 
   616 			An interface template for OMAP3530 General Purpose timer functionality.
 
   618 			template <const TTimerNumber tImEr>
 
   622 				enum TRegisterOffsets
 
   624 					KTIOCP_CFG_Offset	= 0x010,
 
   625 					KTISTAT_Offset		= 0x014,
 
   626 					KTISR_Offset		= 0x018,
 
   627 					KTIER_Offset		= 0x01C,
 
   628 					KTWER_Offset		= 0x020,
 
   629 					KTCLR_Offset		= 0x024,
 
   630 					KTCRR_Offset		= 0x028,
 
   631 					KTLDR_Offset		= 0x02C,
 
   632 					KTTGR_Offset		= 0x030,
 
   633 					KTWPS_Offset		= 0x034,
 
   634 					KTMAR_Offset		= 0x038,
 
   635 					KTCAR1_Offset		= 0x03C,
 
   636 					KTSICR_Offset		= 0x040,
 
   637 					KTCAR2_Offset		= 0x044
 
   642 					KClockInputFrequency	= 32768,
 
   646 				static inline TOmap3530_IRQ Irq()
 
   648 					return TOmap3530_IRQ(TTimerTraits<tImEr>::KIrq) ;
 
   650 				static inline TBool CanWriteTCLR()
 
   652 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TCLR::KOn)) ;
 
   654 				static inline TBool CanWriteTCRR()
 
   656 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TCRR::KOn)) ;
 
   658 				static inline TBool CanWriteTLDR()
 
   660 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TLDR::KOn)) ;
 
   662 				static inline TBool CanWriteTTGR()
 
   664 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TTGR::KOn)) ;
 
   666 				static inline TBool CanWriteTMAR()
 
   668 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TMAR::KOn)) ;
 
   670 				static inline void Reset()
 
   672 					iTIOCP_CFG.Write(TIOCP_CFG::T_SOFTRESET::KOn) ;
 
   674 				static inline TBool ResetComplete()
 
   676 					return (TISTAT::T_RESETDONE::KOn & iTISTAT.Read()) ;
 
   678 				static inline TBool WriteOutstanding()
 
   680 					return (iTWPS.Read()) ;
 
   684 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTIOCP_CFG_Offset)>	iTIOCP_CFG ;
 
   685 				static TReg32_R<(TTimerTraits<tImEr>::KBaseAddress  + KTISTAT_Offset)>		iTISTAT ;
 
   686 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTISR_Offset)>		iTISR ;
 
   687 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTIER_Offset)>		iTIER ;
 
   688 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTWER_Offset)>		iTWER ;
 
   689 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTCLR_Offset)>		iTCLR ;
 
   690 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTCRR_Offset)>		iTCRR ;
 
   691 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTLDR_Offset)>		iTLDR ;
 
   692 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTTGR_Offset)>		iTTGR ;
 
   693 				static TReg32_R<(TTimerTraits<tImEr>::KBaseAddress  + KTWPS_Offset)>		iTWPS ;
 
   694 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTMAR_Offset)>		iTMAR ;
 
   695 				static TReg32_R<(TTimerTraits<tImEr>::KBaseAddress  + KTCAR1_Offset)>		iTCAR1 ;
 
   696 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTSICR_Offset)>		iTSICR ;
 
   697 				static TReg32_R<(TTimerTraits<tImEr>::KBaseAddress  + KTCAR2_Offset)>		iTCAR2 ;
 
   702 			An interface template for OMAP3530 Microsecond aligned timer functionality.
 
   703 			Encapsulates the extra registers provided for timers 1, 2 and 10.
 
   705 			template <const TTimerNumber tImEr>
 
   706 			class TMsSyncTimer : public TGPT<tImEr>
 
   708 				using TGPT<tImEr>::iTWPS ;
 
   709 				using TGPT<tImEr>::iTLDR ;
 
   712 				enum TRegisterOffsets
 
   714 					KTPIR_Offset		= 0x048,
 
   715 					KTNIR_Offset		= 0x04C,
 
   716 					KTCVR_Offset		= 0x050,
 
   717 					KTOCR_Offset		= 0x054,
 
   724 					KInitialLoad	= 0xFFFFFFE0,
 
   725 					KInitialPIR		= 0x38A40,
 
   726 					KInitialNIR		= 0xFFF44800
 
   729 				static inline TBool CanWriteTPIR()
 
   731 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TPIR::KOn)) ;
 
   733 				static inline TBool CanWriteTNIR()
 
   735 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TNIR::KOn)) ;
 
   737 				static inline TBool CanWriteTCVR()
 
   739 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TCVR::KOn)) ;
 
   741 				static inline TBool CanWriteTOCR()
 
   743 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TOCR::KOn)) ;
 
   745 				static inline TBool CanWriteTOWR()
 
   747 					return (0 == (iTWPS.Read() & TWPS::T_W_PEND_TOWR::KOn)) ;
 
   750 				static inline void ConfigureFor1Ms()
 
   752 					iTLDR.Write( KInitialLoad );
 
   753 					iTPIR.Write( KInitialPIR );
 
   754 					iTNIR.Write( KInitialNIR );
 
   758 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTPIR_Offset)>		iTPIR ;
 
   759 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTNIR_Offset)>		iTNIR ;
 
   760 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTCVR_Offset)>		iTCVR ;
 
   761 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTOCR_Offset)>		iTOCR ;
 
   762 				static TReg32_RW<(TTimerTraits<tImEr>::KBaseAddress + KTOWR_Offset)>		iTOWR ;
 
   763 				} ;	// class TMsSyncTimer
 
   766 			}	// namespage GPTimer
 
   768 		typedef GPTimer::TMsSyncTimer<GPTimer::EGpTimer1>		TGpTimer1 ;
 
   769 		typedef GPTimer::TMsSyncTimer<GPTimer::EGpTimer2>		TGpTimer2 ;
 
   770 		typedef GPTimer::TGPT<GPTimer::EGpTimer3>				TGpTimer3 ;
 
   771 		typedef GPTimer::TGPT<GPTimer::EGpTimer4>				TGpTimer4 ;
 
   772 		typedef GPTimer::TGPT<GPTimer::EGpTimer5>				TGpTimer5 ;
 
   773 		typedef GPTimer::TGPT<GPTimer::EGpTimer6>				TGpTimer6 ;
 
   774 		typedef GPTimer::TGPT<GPTimer::EGpTimer7>				TGpTimer7 ;
 
   775 		typedef GPTimer::TGPT<GPTimer::EGpTimer8>				TGpTimer8 ;
 
   776 		typedef GPTimer::TGPT<GPTimer::EGpTimer9>				TGpTimer9 ;
 
   777 		typedef GPTimer::TMsSyncTimer<GPTimer::EGpTimer10>		TGpTimer10 ;
 
   778 		typedef GPTimer::TGPT<GPTimer::EGpTimer11>				TGpTimer11 ;
 
   779 		typedef GPTimer::TGPT<GPTimer::EGpTimer12>				TGpTimer12 ;
 
   783 		An interface template for OMAP3530 32-KHz aligned timer functionality.
 
   785 		class T32KhzSyncTimer
 
   788 			enum TRegisterAddress
 
   790 				KREG_32KSYNCNT_SYSCONFIG	= TVirtual<0x48320004>::Value,
 
   791 				KREG_32KSYNCNT_CR			= TVirtual<0x48320010>::Value
 
   795 			static TReg32_RW<KREG_32KSYNCNT_SYSCONFIG>		iSysConfig ;
 
   796 			static TReg32_R<KREG_32KSYNCNT_CR>				iCR ;
 
   799 			} ;	// class TMsSyncTimer
 
   801 		}	// namespace Omap3530
 
   803 	}	// namespace TexasInstruments
 
   806 // **** TEST CODE ****
 
   807 //#	define HEADER_OMAP3530_TIMER_H_DO_COMPILE_TIME_CHECK_TESTS 1
 
   808 #	ifdef HEADER_OMAP3530_TIMER_H_DO_COMPILE_TIME_CHECK_TESTS
 
   809 		inline void CompileTimeChecks(void)
 
   811 			__ASSERT_COMPILE((TI::Omap3530::GPTimer::TIOCP_CFG::T_IDLEMODE::KSmartIdle == (2 << 3))) ;
 
   812 			__ASSERT_COMPILE((TI::Omap3530::GPTimer::TIOCP_CFG::T_CLOCKACTIVITY::KMaintainIfClock == (1 << 8))) ;
 
   813 			__ASSERT_COMPILE((TI::Omap3530::GPTimer::KGPTIMER1_Base == (0xC6318000))) ;
 
   814 			__ASSERT_COMPILE((0)) ;		// Prove that testing is happening
 
   817 #endif	/* ndef HEADER_OMAP3530_TIMER_H_INCLUDED */