1 |
786 |
skrzyp |
#ifndef CYGONCE_HAL_ARM_LPC2XXX_VAR_LPC2XXX_MISC_H
|
2 |
|
|
#define CYGONCE_HAL_ARM_LPC2XXX_VAR_LPC2XXX_MISC_H
|
3 |
|
|
//=============================================================================
|
4 |
|
|
//
|
5 |
|
|
// lpc2xxx_misc.h
|
6 |
|
|
//
|
7 |
|
|
// HAL misc variant support code for Philips LPC2xxx header file
|
8 |
|
|
//
|
9 |
|
|
//=============================================================================
|
10 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
11 |
|
|
// -------------------------------------------
|
12 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
13 |
|
|
// Copyright (C) 2006 Free Software Foundation, Inc.
|
14 |
|
|
//
|
15 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
16 |
|
|
// the terms of the GNU General Public License as published by the Free
|
17 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
18 |
|
|
// version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
21 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License
|
26 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use
|
30 |
|
|
// macros or inline functions from this file, or you compile this file
|
31 |
|
|
// and link it with other works to produce a work based on this file,
|
32 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
33 |
|
|
// the GNU General Public License. However the source code for this file
|
34 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
35 |
|
|
// General Public License v2.
|
36 |
|
|
//
|
37 |
|
|
// This exception does not invalidate any other reasons why a work based
|
38 |
|
|
// on this file might be covered by the GNU General Public License.
|
39 |
|
|
// -------------------------------------------
|
40 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
//=============================================================================
|
42 |
|
|
//#####DESCRIPTIONBEGIN####
|
43 |
|
|
//
|
44 |
|
|
// Author(s): andyj
|
45 |
|
|
// Contributors: jani
|
46 |
|
|
// Date: 2006-02-04
|
47 |
|
|
// Purpose: LPC2XXX specific miscellaneous support header file
|
48 |
|
|
// Description:
|
49 |
|
|
// Usage: #include <cyg/hal/lpc2xxx_misc.h>
|
50 |
|
|
//
|
51 |
|
|
//####DESCRIPTIONEND####
|
52 |
|
|
//
|
53 |
|
|
//=============================================================================
|
54 |
|
|
|
55 |
|
|
//-----------------------------------------------------------------------------
|
56 |
|
|
// Macros to derive the baudrate divider values for the internal UARTs
|
57 |
|
|
//-----------------------------------------------------------------------------
|
58 |
|
|
#define CYG_HAL_ARM_LPC2XXX_BAUD_GENERATOR(baud) \
|
59 |
|
|
(CYGNUM_HAL_ARM_LPC2XXX_PCLK/((baud)*16))
|
60 |
|
|
|
61 |
|
|
//-----------------------------------------------------------------------------
|
62 |
|
|
// LPX2xxx varaint specific initialisatio of CAN channels
|
63 |
|
|
// This function configures the pin functions for CAN use
|
64 |
|
|
//-----------------------------------------------------------------------------
|
65 |
|
|
#ifdef CYGPKG_DEVS_CAN_LPC2XXX
|
66 |
|
|
externC void hal_lpc_can_init(cyg_uint8 can_chan_no);
|
67 |
|
|
#define HAL_LPC2XXX_INIT_CAN(_can_chan_no_) hal_lpc_can_init(_can_chan_no_)
|
68 |
|
|
#define CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK CYGNUM_HAL_ARM_LPC2XXX_PCLK
|
69 |
|
|
#endif // CYGPKG_DEVS_CAN_LPC2XXX
|
70 |
|
|
|
71 |
|
|
//-----------------------------------------------------------------------------
|
72 |
|
|
// LPX2xxx watchdog support
|
73 |
|
|
//-----------------------------------------------------------------------------
|
74 |
|
|
externC void hal_lpc_watchdog_reset(void);
|
75 |
|
|
|
76 |
|
|
#define HAL_PLATFORM_RESET() hal_lpc_watchdog_reset()
|
77 |
|
|
#define HAL_PLATFORM_RESET_ENTRY 0
|
78 |
|
|
|
79 |
|
|
//-----------------------------------------------------------------------------
|
80 |
|
|
// end of lpc2xxx_misc.h
|
81 |
|
|
#endif // CYGONCE_HAL_ARM_LPC2XXX_VAR_LPC2XXX_MISC_H
|