annotate packages/hal/arm/lpc2xxx/olpcl2294/current/src/olpcl2294_misc.c @ 2836:6283be95ef53

* cdl/hal_arm_lpc2xxx_olpcl2294.cdl: Expanded a list the legal baud rates for both diagnostic and debug channels (upon 230400b bps). * include/hal_platform_setup.h, include/plf_io.h: Extra tabs expanded. * include/hal_platform_setup.h: Fixed a comment about JTAG pinouts. * src/olpcl2294_misc.c: Removed odd _impure_ptr stub.
author asl
date Mon, 02 Mar 2009 20:35:21 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
1 //==========================================================================
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
2 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
3 // olpcl2294_misc.c
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
4 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
5 // HAL misc board support code for Olimex LPC-L2294-1MB development
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
6 // board
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
7 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
8 //==========================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
9 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
10 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
11 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
12 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2008 Free Software Foundation, Inc.
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
13 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
14 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
15 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
16 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
17 // version.
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
18 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
19 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
20 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
22 // for more details.
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
23 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
24 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
25 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
26 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
27 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
28 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
29 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
30 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
31 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
32 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
33 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
34 // General Public License v2.
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
35 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
36 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
37 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
38 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2665
diff changeset
39 // ####ECOSGPLCOPYRIGHTEND####
2665
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
40 //==========================================================================
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
41 //#####DESCRIPTIONBEGIN####
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
42 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
43 // Author(s): Sergei Gavrikov
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
44 // Contributors: Sergei Gavrikov
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
45 // Date: 2008-08-31
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
46 // Purpose: HAL board support
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
47 // Description: Implementations of HAL board interfaces
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
48 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
49 //####DESCRIPTIONEND####
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
50 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
51 //========================================================================*/
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
52
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
53 #include <pkgconf/hal.h>
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
54 #include <cyg/hal/hal_io.h> // IO macros
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
55 #include <cyg/hal/hal_arch.h> // Register state info
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
56
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
57 #include <cyg/infra/cyg_type.h> // base types
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
58 #include <cyg/hal/var_io.h>
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
59
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
60 #include <cyg/hal/hal_var_ints.h>
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
61 #include <cyg/hal/drv_api.h>
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
62
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
63 extern void cyg_hal_plf_serial_init (void);
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
64
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
65 //--------------------------------------------------------------------------
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
66 // hal_lpc2xxx_set_leds --
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
67 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
68 // There is one diagnostic LED marked 'STAT' on the board
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
69 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
70 void
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
71 hal_lpc2xxx_set_leds (int mask)
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
72 {
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
73 HAL_WRITE_UINT32 (CYGARC_HAL_LPC2XXX_REG_IO_BASE +
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
74 CYGARC_HAL_LPC2XXX_REG_IO1SET, (1 << 23));
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
75 if (mask & 1)
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
76 HAL_WRITE_UINT32 (CYGARC_HAL_LPC2XXX_REG_IO_BASE +
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
77 CYGARC_HAL_LPC2XXX_REG_IO1CLR, (1 << 23));
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
78 }
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
79
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
80 //--------------------------------------------------------------------------
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
81 // cyg_hal_plf_comms_init --
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
82 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
83 void
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
84 cyg_hal_plf_comms_init (void)
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
85 {
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
86 static int initialized = 0;
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
87
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
88 if (initialized)
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
89 return;
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
90 initialized = 1;
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
91
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
92 cyg_hal_plf_serial_init ();
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
93 }
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
94
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
95 #ifdef HAL_PLF_HARDWARE_INIT
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
96 //--------------------------------------------------------------------------
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
97 // hal_plf_hardware_init --
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
98 //
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
99 void
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
100 hal_plf_hardware_init (void)
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
101 {
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
102 // configure IRQ level from CL CS8900A
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
103 cyg_drv_interrupt_configure (CYGNUM_HAL_INTERRUPT_EINT2, 0, 1);
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
104 }
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
105 #endif // HAL_PLF_HARDWARE_INIT
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
106
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
107 // indent: --indent-level4 -br -nut; vim: expandtab tabstop=4 shiftwidth=4
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
108 //--------------------------------------------------------------------------
60c9e53bbe45 * LPC-L2294 development board package
asl
parents:
diff changeset
109 // EOF olpcl2294_misc.c