source:
rtems/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c
@
3d6669cc
Last change on this file since 3d6669cc was 3d6669cc, checked in by Joel Sherrill <joel.sherrill@…>, on 11/13/02 at 17:55:09 | |
---|---|
|
|
File size: 2.4 KB |
Line | |
---|---|
1 | /* |
2 | * Cirrus EP7312 Clock driver |
3 | * |
4 | * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com> |
5 | * |
6 | * The license and distribution terms for this file may be |
7 | * found in the file LICENSE in this distribution or at |
8 | * |
9 | * http://www.OARcorp.com/rtems/license.html. |
10 | * |
11 | * |
12 | * $Id$ |
13 | */ |
14 | #include <rtems.h> |
15 | #include <ep7312.h> |
16 | #include <bsp.h> |
17 | #include <irq.h> |
18 | |
19 | |
20 | rtems_isr clock_isr(rtems_vector_number vector); |
21 | rtems_isr Clock_isr(rtems_vector_number vector); |
22 | static void clock_isr_on(const rtems_irq_connect_data *unused); |
23 | static void clock_isr_off(const rtems_irq_connect_data *unused); |
24 | static int clock_isr_is_on(const rtems_irq_connect_data *irq); |
25 | |
26 | rtems_irq_connect_data clock_isr_data = {BSP_TC1OI, |
27 | (rtems_irq_hdl)Clock_isr, |
28 | clock_isr_on, |
29 | clock_isr_off, |
30 | clock_isr_is_on, |
31 | 3, |
32 | 0 }; |
33 | |
34 | #define CLOCK_VECTOR 0 |
35 | |
36 | #define Clock_driver_support_at_tick() \ |
37 | do { \ |
38 | *EP7312_TC1EOI = 0xffffffff; \ |
39 | } while(0) |
40 | |
41 | #define Clock_driver_support_install_isr( _new, _old ) \ |
42 | do { \ |
43 | BSP_install_rtems_irq_handler(&clock_isr_data); \ |
44 | } while(0) |
45 | |
46 | |
47 | /* |
48 | * Set up the clock hardware |
49 | */ |
50 | #define Clock_driver_support_initialize_hardware() \ |
51 | do { \ |
52 | *EP7312_SYSCON1 |= EP7312_SYSCON1_TC1_PRESCALE; \ |
53 | *EP7312_TC1D =(BSP_Configuration.microseconds_per_tick * 2000)/1000000; \ |
54 | *EP7312_TC1EOI = 0xFFFFFFFF; \ |
55 | } while (0) |
56 | |
57 | #define Clock_driver_support_shutdown_hardware() \ |
58 | do { \ |
59 | BSP_remove_rtems_irq_handler(&clock_isr_data); \ |
60 | } while (0) |
61 | |
62 | static void clock_isr_on(const rtems_irq_connect_data *unused) |
63 | { |
64 | return; |
65 | } |
66 | |
67 | static void clock_isr_off(const rtems_irq_connect_data *unused) |
68 | { |
69 | return; |
70 | } |
71 | |
72 | static int clock_isr_is_on(const rtems_irq_connect_data *irq) |
73 | { |
74 | return 1; |
75 | } |
76 | |
77 | |
78 | #include "../../../shared/clockdrv_shell.c" |
Note: See TracBrowser
for help on using the repository browser.