connect progress signal directly to the logger.
[Rockbox.git] / firmware / export / timer.h
blob3613aa32d9a0f39aca365f151419a82c3b81dd1e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 Jens Arnold
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef __TIMER_H__
21 #define __TIMER_H__
23 #include <stdbool.h>
24 #include "config.h"
26 #if defined(CPU_PP)
27 /* Portalplayer chips use a microsecond timer. */
28 #define TIMER_FREQ 1000000
29 #elif defined(CPU_COLDFIRE)
30 /* timer is based on busclk == cpuclk/2 */
31 #define TIMER_FREQ (CPU_FREQ/2)
32 #elif CONFIG_CPU == PNX0101
33 #define TIMER_FREQ 3000000
34 #elif CONFIG_CPU == S3C2440 || CONFIG_CPU == DM320 || CONFIG_CPU == TCC7801 \
35 || defined(CPU_TCC77X)
36 #include "timer-target.h"
37 #elif defined(SIMULATOR)
38 #define TIMER_FREQ 1000000
39 #else
40 #define TIMER_FREQ CPU_FREQ
41 #endif
42 bool timer_register(int reg_prio, void (*unregister_callback)(void),
43 long cycles, int int_prio, void (*timer_callback)(void)
44 IF_COP(,int core));
45 bool timer_set_period(long cycles);
46 #ifdef CPU_COLDFIRE
47 void timers_adjust_prescale(int multiplier, bool enable_irq);
48 #endif
49 void timer_unregister(void);
51 /* For target-specific interface use */
52 extern void (*pfn_timer)(void);
53 extern void (*pfn_unregister)(void);
55 #endif /* __TIMER_H__ */