Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:44

0001 /*
0002  *  Timer Init
0003  *
0004  *  Use the last DMA timer (DTIM3) as the diagnostic timer.
0005  */
0006 
0007 #include <rtems.h>
0008 #include <rtems/btimer.h>
0009 #include <bsp.h>
0010 
0011 void
0012 benchmark_timer_initialize(void)
0013 {
0014     int preScaleDivisor = 58;
0015     int div = MCF5282_TIMER_DTMR_CLK_DIV1;
0016     MCF5282_TIMER3_DTRR = 0x2710;
0017     MCF5282_TIMER3_DTMR = 0;
0018     MCF5282_TIMER3_DTMR = MCF5282_TIMER_DTMR_PS(preScaleDivisor - 1) | div |
0019                           MCF5282_TIMER_DTMR_RST;
0020 }
0021 
0022 /*
0023  * Return timer value in microsecond units
0024  */
0025 uint32_t
0026 benchmark_timer_read(void)
0027 {
0028     return MCF5282_TIMER3_DTCN;
0029 }
0030 
0031 void
0032 benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
0033 {
0034 }