www.pudn.com > at91rm9200bsp.rar > at91systimer.c
void InitSystemTimer()
{
SYSTIMER_S* pst = (SYSTIMER_S*)SYSTIMER_BASE_ADDR;
pst ->ST_CR = ST_CR_WDRST;
pst ->ST_PIMR = ( UINT32 )( SLOW_RATE_CLK / DEFAULT_SYS_CLK_RATE );
pst ->ST_WDMR = 0x0;
/*
* real time prescale set to only 1, no prescale
*/
pst ->ST_RTMR = ST_RTMT_RT_PRESCALE;
pst ->ST_IDR = (ST_IE_DR_ALARMS | ST_IE_DR_PITS | ST_IE_DR_RTTINC | ST_IE_DR_WDOVF );
}
void InitSystemTimer2()
{
SYSTIMER_S* pst = (SYSTIMER_S*)SYSTIMER_BASE_ADDR;
/*
* enable interrupt of system period timer
*/
pst ->ST_IER = ST_IE_DR_PITS;
}