1 | /*===============================================================*\ |
---|
2 | | Project: RTEMS generic MPC5200 BSP | |
---|
3 | +-----------------------------------------------------------------+ |
---|
4 | | Partially based on the code references which are named below. | |
---|
5 | | Adaptions, modifications, enhancements and any recent parts of | |
---|
6 | | the code are: | |
---|
7 | | Copyright (c) 2005 | |
---|
8 | | embedded brains GmbH | |
---|
9 | | Obere Lagerstr. 30 | |
---|
10 | | 82178 Puchheim | |
---|
11 | | Germany | |
---|
12 | | rtems@embedded-brains.de | |
---|
13 | +-----------------------------------------------------------------+ |
---|
14 | | The license and distribution terms for this file may be | |
---|
15 | | found in the file LICENSE in this distribution or at | |
---|
16 | | | |
---|
17 | | http://www.rtems.org/license/LICENSE. | |
---|
18 | | | |
---|
19 | +-----------------------------------------------------------------+ |
---|
20 | | this file declares functions to use the slice timer module |
---|
21 | \*===============================================================*/ |
---|
22 | #ifndef __SLICETIMER_H__ |
---|
23 | #define __SLICETIMER_H__ |
---|
24 | |
---|
25 | #ifdef __cplusplus |
---|
26 | extern "C" { |
---|
27 | #endif |
---|
28 | |
---|
29 | #define SLT0 0 |
---|
30 | #define SLT1 1 |
---|
31 | |
---|
32 | #define SLT0_INT_FREQUENCY 10000 |
---|
33 | #define SLT1_INT_FREQUENCY 0 |
---|
34 | |
---|
35 | #define SLT_CNTRL_RW (1 << 26) |
---|
36 | #define SLT_CNTRL_INTEN (1 << 25) |
---|
37 | #define SLT_CNTRL_TIMEN (1 << 24) |
---|
38 | |
---|
39 | #define SLT_TSR_ST (1 << 24) |
---|
40 | |
---|
41 | #define SLT_TSR_COUNT(freq) ((freq) ? ((IPB_CLOCK)/(freq)) : (0xFFFFFF)) |
---|
42 | |
---|
43 | rtems_device_driver slt_initialize( rtems_device_major_number, |
---|
44 | rtems_device_minor_number, |
---|
45 | void * |
---|
46 | ); |
---|
47 | |
---|
48 | #define SLTIME_DRIVER_TABLE_ENTRY \ |
---|
49 | { slt_initialize, NULL, NULL, \ |
---|
50 | NULL, NULL, NULL } |
---|
51 | |
---|
52 | void mpc5200_slt_isr(uint32_t); |
---|
53 | rtems_isr mpc5200_slt0_isr(rtems_irq_hdl_param); |
---|
54 | rtems_isr mpc5200_slt1_isr(rtems_irq_hdl_param); |
---|
55 | void mpc5200_init_slt(uint32_t); |
---|
56 | void mpc5200_set_slt_count(uint32_t); |
---|
57 | void mpc5200_enable_slt_int(uint32_t); |
---|
58 | void mpc5200_disable_slt_int(uint32_t); |
---|
59 | uint32_t mpc5200_check_slt_status(uint32_t); |
---|
60 | /*void sltOn(const rtems_irq_connect_data *); |
---|
61 | void sltOff(const rtems_irq_connect_data *); |
---|
62 | int sltIsOn(const rtems_irq_connect_data *);*/ |
---|
63 | void Install_slt(rtems_device_minor_number); |
---|
64 | |
---|
65 | #ifdef __cplusplus |
---|
66 | } |
---|
67 | #endif |
---|
68 | |
---|
69 | #endif /* __SLICETIMER_H__ */ |
---|