1 |
786 |
skrzyp |
#ifndef CYGONCE_HAL_PLF_IO_H
|
2 |
|
|
#define CYGONCE_HAL_PLF_IO_H
|
3 |
|
|
//=============================================================================
|
4 |
|
|
//
|
5 |
|
|
// plf_io.h
|
6 |
|
|
//
|
7 |
|
|
// Embedded Artists LPC2468 OEM board specific registers
|
8 |
|
|
//
|
9 |
|
|
//=============================================================================
|
10 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
11 |
|
|
// -------------------------------------------
|
12 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
13 |
|
|
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2008 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): Uwe Kindler
|
45 |
|
|
// Contributors:
|
46 |
|
|
// Date: 2008-07-06
|
47 |
|
|
// Purpose: EA LPC2468 oem board specific registers
|
48 |
|
|
// Description:
|
49 |
|
|
// Usage: #include <cyg/hal/plf_io.h>
|
50 |
|
|
//
|
51 |
|
|
//####DESCRIPTIONEND####
|
52 |
|
|
//
|
53 |
|
|
//=============================================================================
|
54 |
|
|
// On-chip device base addresses
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
// ----------------------------------------------------------------------------
|
58 |
|
|
// exported I2C devices on OEM board
|
59 |
|
|
//
|
60 |
|
|
#define HAL_I2C_EXPORTED_DEVICES \
|
61 |
|
|
extern cyg_i2c_device i2c_cat24c256_eeprom; \
|
62 |
|
|
extern cyg_i2c_bus hal_ea2468_i2c0_bus;
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
//----------------------------------------------------------------------
|
66 |
|
|
// The platform needs this initialization during the
|
67 |
|
|
// hal_hardware_init() function in the varient HAL.
|
68 |
|
|
#ifndef __ASSEMBLER__
|
69 |
|
|
extern void hal_plf_hardware_init(void);
|
70 |
|
|
#define HAL_PLF_HARDWARE_INIT() \
|
71 |
|
|
hal_plf_hardware_init()
|
72 |
|
|
|
73 |
|
|
//-----------------------------------------------------------------------------
|
74 |
|
|
// LPX24xx variant specific initialisation of CAN channels
|
75 |
|
|
// This function configures the pin functions for CAN use
|
76 |
|
|
//-----------------------------------------------------------------------------
|
77 |
|
|
#ifdef CYGPKG_DEVS_CAN_LPC2XXX
|
78 |
|
|
externC void hal_lpc_can_init(cyg_uint8 can_chan_no);
|
79 |
|
|
#define HAL_LPC2XXX_INIT_CAN(_can_chan_no_) hal_lpc_can_init(_can_chan_no_)
|
80 |
|
|
#endif // CYGPKG_DEVS_CAN_LPC2XXX
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
// ----------------------------------------------------------------------------
|
84 |
|
|
// I2C support. The LPC2468 OEM board supports up to 3 I2C busses. Only the
|
85 |
|
|
// I2C bus 0 is used on the board. The other I2C busses are available via
|
86 |
|
|
// the expansion connector. If only the first bus is used, the I2C driver
|
87 |
|
|
// will be optimized for a single I2C bus
|
88 |
|
|
#ifdef CYGPKG_DEVS_I2C_ARM_LPC2XXX
|
89 |
|
|
# define HAL_LPC2XXX_I2C_SINGLETON_BASE CYGARC_HAL_LPC24XX_REG_I2C0_BASE
|
90 |
|
|
# define HAL_LPC2XXX_I2C_SINGLETON_ISRVEC CYGNUM_HAL_INTERRUPT_I2C
|
91 |
|
|
# define HAL_LPC2XXX_I2C_SINGLETON_CLK CYGNUM_HAL_ARM_LPC24XX_I2C0_CLK
|
92 |
|
|
# define HAL_LPC2XXX_I2C_SINGLETON_ISRPRI CYGNUM_HAL_ARM_LPC24XX_I2C0_INT_PRIO
|
93 |
|
|
# define HAL_LPC2XXX_I2C_SINGLETON_BUS_FREQ CYGNUM_HAL_ARM_LPC24XX_I2C0_BUS_FREQ
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
//-----------------------------------------------------------------------------
|
97 |
|
|
// Write data to eeprom (page write)
|
98 |
|
|
// If the call is blocking (blocking == true) then the function will poll
|
99 |
|
|
// the device if it is busy writing. If it is non blocking then the function
|
100 |
|
|
// immediately return 0 if the device is busy
|
101 |
|
|
// Function returns number of bytes written to device
|
102 |
|
|
//-----------------------------------------------------------------------------
|
103 |
|
|
externC cyg_uint32 hal_lpc_eeprom_write(cyg_uint16 addr,
|
104 |
|
|
cyg_uint8 *pdata,
|
105 |
|
|
cyg_uint16 size,
|
106 |
|
|
cyg_bool blocking);
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
//-----------------------------------------------------------------------------
|
110 |
|
|
// Read data from eeprom (selcetive, sequencial read)
|
111 |
|
|
// If the call is blocking (blocking == true) then the function will poll
|
112 |
|
|
// the device if it is busy writing. If it is non blocking then the function
|
113 |
|
|
// immediately return 0 if the device is busy
|
114 |
|
|
// Function returns number of bytes read from device
|
115 |
|
|
//-----------------------------------------------------------------------------
|
116 |
|
|
externC cyg_uint32 hal_lpc_eeprom_read(cyg_uint16 addr,
|
117 |
|
|
cyg_uint8 *pdata,
|
118 |
|
|
cyg_uint16 size,
|
119 |
|
|
cyg_bool blocking);
|
120 |
|
|
#endif // CYGPKG_DEVS_I2C_ARM_LPC2XXX
|
121 |
|
|
#endif //__ASSEMBLER__
|
122 |
|
|
|
123 |
|
|
//-----------------------------------------------------------------------------
|
124 |
|
|
// end of plf_io.h
|
125 |
|
|
#endif // CYGONCE_HAL_PLF_IO_H
|
126 |
|
|
|