source: rtems/c/src/lib/libbsp/m68k/mcf5329/timer/timer.c @ c499856

4.11
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 874 bytes
Line 
1/*
2 *  Timer Init
3 *
4 *  Use the last DMA timer (DTIM3) as the diagnostic timer.
5 *
6 *  Author: W. Eric Norum <norume@aps.anl.gov>
7 *
8 *  COPYRIGHT (c) 2005.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#include <rtems.h>
17#include <rtems/btimer.h>
18#include <bsp.h>
19
20void benchmark_timer_initialize(void)
21{
22  uint32_t preScaleDivisor = bsp_get_BUS_clock_speed() / 1000000;
23
24  MCF_DTIM3_DTMR = 0;
25  MCF_DTIM3_DTMR = MCF_DTIM_DTMR_PS(preScaleDivisor - 1) |
26    MCF_DTIM_DTMR_CLK_DIV1 | MCF_DTIM_DTMR_RST;
27}
28
29/*
30 * Return timer value in microsecond units
31 */
32uint32_t benchmark_timer_read(void)
33{
34  return MCF_DTIM3_DTCN;
35}
36
37void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
38{
39}
Note: See TracBrowser for help on using the repository browser.