source: rtems/c/src/lib/libbsp/arm/edb7312/clock/clockdrv.c @ 0fe59ec

4.104.114.84.95
Last change on this file since 0fe59ec was 0fe59ec, checked in by Joel Sherrill <joel.sherrill@…>, on 06/22/07 at 19:15:54

2007-06-22 Joel Sherrill <joel.sherrill@…>

  • clock/clockdrv.c: Fix spacing.
  • Property mode set to 100644
File size: 2.3 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.rtems.com/license/LICENSE.
10 *
11 *
12 *  $Id$
13*/
14#include <rtems.h>
15#include <ep7312.h>
16#include <bsp.h>
17#include <irq.h>
18
19rtems_isr Clock_isr(rtems_vector_number vector);
20static void clock_isr_on(const rtems_irq_connect_data *unused);
21static void clock_isr_off(const rtems_irq_connect_data *unused);
22static int clock_isr_is_on(const rtems_irq_connect_data *irq);
23
24rtems_irq_connect_data clock_isr_data = {BSP_TC1OI,
25                                         (rtems_irq_hdl)Clock_isr,
26                                         clock_isr_on,
27                                         clock_isr_off,
28                                         clock_isr_is_on,
29                                         3,
30                                         0 };
31
32#define CLOCK_VECTOR 0
33
34#define Clock_driver_support_at_tick()                \
35  do {                                                \
36    *EP7312_TC1EOI = 0xffffffff;                      \
37  } while(0)
38
39#define Clock_driver_support_install_isr( _new, _old ) \
40  do {                                                 \
41      (_old) = NULL; /* avoid warning */;              \
42      BSP_install_rtems_irq_handler(&clock_isr_data);  \
43  } while(0)
44
45/*
46 * Set up the clock hardware
47*/
48#define Clock_driver_support_initialize_hardware()                            \
49  do {                                                                        \
50    *EP7312_SYSCON1 |= EP7312_SYSCON1_TC1_PRESCALE;                         \
51    *EP7312_TC1D =(BSP_Configuration.microseconds_per_tick * 2000)/1000000; \
52    *EP7312_TC1EOI = 0xFFFFFFFF;                                            \
53  } while (0)
54
55#define Clock_driver_support_shutdown_hardware()                        \
56  do {                                                                  \
57    BSP_remove_rtems_irq_handler(&clock_isr_data);                  \
58  } while (0)
59
60static void clock_isr_on(const rtems_irq_connect_data *unused)
61{
62    return;
63}
64
65static void clock_isr_off(const rtems_irq_connect_data *unused)
66{
67    return;
68}
69
70static int clock_isr_is_on(const rtems_irq_connect_data *irq)
71{
72    return 1;
73}
74
75#include "../../../shared/clockdrv_shell.c"
Note: See TracBrowser for help on using the repository browser.