1 # ====================================================================
5 # eCos LPC2xxx CAN module configuration data
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 2003, 2004 eCosCentric Limited
13 ## eCos is free software; you can redistribute it and/or modify it under
14 ## the terms of the GNU General Public License as published by the Free
15 ## Software Foundation; either version 2 or (at your option) any later version.
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
35 ## -------------------------------------------
36 #####ECOSGPLCOPYRIGHTEND####
37 # ====================================================================
38 ######DESCRIPTIONBEGIN####
40 # Author(s): Uwe Kindler
44 #####DESCRIPTIONEND####
45 # ====================================================================
48 cdl_package CYGPKG_DEVS_CAN_LPC2XXX {
49 display "Philips LPC2xxx CAN device drivers"
50 parent CYGPKG_IO_CAN_DEVICES
51 active_if CYGPKG_IO_CAN
52 active_if CYGPKG_HAL_ARM_LPC2XXX || CYGPKG_HAL_ARM_LPC24XX
55 implements CYGINT_IO_CAN_STD_CAN_ID
56 implements CYGINT_IO_CAN_EXT_CAN_ID
60 This option enables the CAN device drivers for the
62 compile -library=libextras.a can_lpc2xxx.c
64 puts $::cdl_system_header "/***** CAN driver proc output start *****/"
65 puts $::cdl_system_header "#define CYGDAT_IO_CAN_DEVICE_HEADER <pkgconf/devs_can_lpc2xxx.h>"
66 puts $::cdl_system_header "/***** CAN driver proc output end *****/"
69 cdl_component CYGOPT_DEVS_CAN_LPC2XXX_RUNTIME_ACCFILT {
70 display "Acceptance filter runtime configuration"
72 implements CYGINT_IO_CAN_RUNTIME_MBOX_CFG
74 The LPC2xxx CAN module supports a global acceptance
75 filter. Enabling this option provides support for runtime
76 configuration of this acceptance filter. If each CAN
77 channel should receive all CAN messages and individual
78 message filtering is not required then disable this option
79 to eliminate almost the complete acceptance filter code
80 and to decrease code size. If this option is disabled the
81 option CYGOPT_IO_CAN_RUNTIME_MBOX_CFG is not available and
82 the configuration key CYG_IO_SET_CONFIG_CAN_MSGBUF is not
83 supported by this driver."
85 cdl_option CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS {
86 display "Extended acceptance filtering"
90 The common CAN I/O layer supports setup of single
91 message filters for reception of single CAN
92 messages. The global LPC2xxx acceptance filter
93 supports not only single message filters but also
94 message groups. A message group is defined by a
95 lower bound CAN identifier and an upper bound CAN
96 identifier. The acceptance filter will accept all
97 messages within this range of CAN identifiers. The
98 acceptance filter supports a number of message
99 groups for each CAN channel. The support of
100 message filter groups is not conform to the
101 standard API of the CAN I/O layer and should only
102 be used for application where portability is not
106 cdl_option CYGOPT_DEVS_CAN_LPC2XXX_LUT_ERR_SUPP {
107 display "LUT Error Support"
111 The CAN module contains a look-up table for
112 acceptance filtering of incoming CAN messages. The
113 look-up table indicates errors in the LUT error
114 registers. If this option is enabled, additional
115 error check code is executed if an interrupt is
116 serviced. Normally the acceptance filter code should
117 fill the look-up table properly and no LUT error
118 should ever occur. You need to decide if LUT error
119 checking is required for your application because it
120 adds some bytes of code and slows down the ISR/DSR
121 handling a little bit because of the additional code
122 that need to be executed."
127 cdl_option CYGOPT_DEVS_CAN_LPC2XXX_USE_SELF_RECEPTION {
128 display "Use Self Reception Request command"
130 active_if CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
133 Enable this option for using work-around of problem with
134 receiving messages while arbitration is lost. If this work
135 around is used each transmitted CAN message will be
136 received. This will produce additional RX interrupts an
137 requires additional time for processing these interrupts
138 and for filtering of received messages.
140 The errata sheet tells the following about this issue:
141 Introduction: The CAN module can lose arbitration to
142 another CAN node during an attempt to transmit a CAN
143 message. The message of the CAN node the arbitration was
144 lost to is supposed to be received correctly by the CAN
147 Problem: Messages might not be received correctly if
148 during a CAN Transmission the CAN bus arbitration is lost
151 Work-around: Use the Self Reception Request command
152 instead of the Transmission Request command. However, it
153 has to be taken into account that now all transmitted
154 messages may be received if not prevented by appropriate
155 Acceptance Filter settings. (Don't set up Acceptance
156 Filter Message Identifiers for the messages you are
157 transmitting yourself.)."
160 cdl_option CYGOPT_DEVS_CAN_LPC2XXX_ALIE {
161 display "Arbitration lost interrupt enable"
165 If the CAN controller loses arbitration while attempting to
166 transmit a message, an interrupt can be triggered. Normally
167 this is no real error condition and it is not necessary to
168 propagate these events to upper layers. But you can enable
169 this option if you want to check for arbitration lost events."
172 cdl_option CYGDBG_DEVS_CAN_LPC2XXX_DEBUG {
173 display "Support printing debug information"
176 Check this box to turn ON debug options for LPC2XXXX
180 # Support up to 4 on-chip CAN modules. The number may vary between
181 # processor variants so it is easy to update this here
182 for { set ::channel 0 } { $::channel < 4 } { incr ::channel } {
184 cdl_interface CYGINT_DEVS_CAN_LPC2XXX_CAN[set ::channel] {
185 display "Platform provides CAN [set ::channel]"
188 This interface will be implemented if the specific LPC2xxx
189 processor being used has on-chip CAN [set ::channel], and if
190 that CAN module is accessible on the target hardware."
193 cdl_component CYGPKG_DEVS_CAN_LPC2XXX_CAN[set ::channel] {
194 display "Allow access to the on-chip CAN [set ::channel] via a CAN driver"
196 active_if CYGINT_DEVS_CAN_LPC2XXX_CAN[set ::channel]
197 implements CYGINT_IO_CAN_CHANNELS
200 If the application needs to access the on-chip CAN
201 module [set ::channel] via an eCos CAN driver then
202 this option should be enabled."
204 cdl_option CYGPKG_DEVS_CAN_LPC2XXX_CAN[set ::channel]_NAME {
205 display "Device name for CAN module [set ::channel]"
207 default_value [format {"\"/dev/can%d\""} $::channel]
209 This option controls the name that an eCos application
210 should use to access this device via cyg_io_lookup(),
211 open(), or similar calls."
215 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_KBAUD {
216 display "Default baud rate for CAN module [set ::channel]"
219 legal_values { 10 20 50 100 125 250 500 800 1000 "AUTO"}
221 This option determines the initial baud rate in
222 KBaud for CAN module [set ::channel]"
225 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_QUEUESIZE_TX {
226 display "Size of TX Queue for the CAN module [set ::channel] driver"
229 legal_values 1 to 1024
231 The CAN device driver will run in interrupt mode
232 and will perform buffering of outgoing data. This
233 option controls the number of CAN messages the TX
237 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_QUEUESIZE_RX {
238 display "Size of RX Queue for the CAN module [set ::channel] driver"
241 legal_values 8 to 4096
243 The CAN device driver will run in interrupt mode
244 and will perform buffering of incoming data. This
245 option controls the number of CAN events the RX
249 cdl_option CYGOPT_DEVS_CAN_LPC2XXX_CAN[set ::channel]_ACCFILT_STARTUP_CFG {
250 display "Acceptance filter startup configuration"
252 legal_values {"RX_ALL" "RX_NONE"}
253 default_value {"RX_ALL"}
254 active_if CYGOPT_DEVS_CAN_LPC2XXX_RUNTIME_ACCFILT
256 Normally the acceptance filter will be configured
257 at startup time to receive all available CAN
258 messages. The application can setup single message
259 filters during runtime later. If RX_NONE is
260 selected then the acceptance filter for this
261 channel is configured to receive no CAN message
265 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_RX_INT_PRIORITY {
266 display "Priority level of CAN module [set ::channel] receive interrupt"
268 active_if CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
272 This option sets CAN module [set ::channel]
273 device receive interrupt priority level. We
274 support up to 17 interrupt levels. Interrupts
275 0 - 15 are vectored interrupt
276 requests. Priority 16 indicates a non vectored
277 IRQ. Vectored IRQs have the higher priority
278 then non vectored IRQs and slot 0 has the
279 highest priority and slot 15 has the lowest."
282 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_TX_INT_PRIORITY {
283 display "Priority level of CAN module [set ::channel] transmit interrupt"
285 active_if CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
289 This option sets CAN module [set ::channel]
290 device transmit interrupt priority level. We
291 support up to 17 interrupt levels. Interrupts
292 0 - 15 are vectored interrupt
293 requests. Priority 16 indicates a non vectored
294 IRQ. Vectored IRQs have the higher priority
295 then non vectored IRQs and slot 0 has the
296 highest priority and slot 15 has the lowest."
301 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_ERR_INT_PRIORITY {
302 display "Priority level of CAN error interrupt"
304 active_if CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
308 This option sets CAN device error interrupt priority level.
309 We support up to 17 interrupt levels. Interrupts 0 - 15
310 are vectored interrupt requests. Priority 16 indicates a
311 non vectored IRQ. Vectored IRQs have the higher priority
312 then non vectored IRQs and slot 0 has the highest priority
313 and slot 15 has the lowest."
316 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_INT_PRIORITY {
317 display "Priority level of all CAN interrupts"
319 active_if CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION >= 4
323 The LPC24xx family uses one single interrupt vector for
324 all CAN interrupts of all CAN channels. This if very
325 different from former LPC2xxx variants where each CAN
326 channels has its own interrupt vectors for transmit
327 and receive interrupts. There are 16 priority
328 levels, corresponding to the values 0 through 15 decimal,
329 of which 15 is the lowest priority. The reset value of
330 these interrupt priority registers defaults all interrupts
331 to the lowest priority 15, allowing a single write to
332 elevate the priority of an individual interrupt."
335 cdl_option CYGPKG_DEVS_CAN_LPC2XXX_TESTS {
336 display "CAN LPC2xxx device driver tests"
339 calculated { "tests/can_busload tests/can_rx_tx" }
341 This option specifies the set of tests for the LPC2xxx
345 cdl_option CYGBLD_DEVS_CAN_LPC2XXX_EXTRA_TESTS {
346 display "Build extra CAN tests"
350 This option enables the building of some extra tests which
351 can be used when testing / debugging the LPC2xxx CAN driver. These
352 are not built by default since they do not use the dedicated
353 testing infrastructure. All tests require a properly configured
354 CAN network with a second CAN node that can send and receive
358 <PREFIX>/bin/can_multichan_rx : <PACKAGE>/tests/can_multichan_rx.c
359 @sh -c "mkdir -p tests $(dir $@)"
360 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_multichan_rx.o $<
361 @echo $@ ": \\" > $(notdir $@).deps
362 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
363 @tail -n +2 deps.tmp >> $(notdir $@).deps
364 @echo >> $(notdir $@).deps
366 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_multichan_rx.o
370 <PREFIX>/bin/can_multichan_tx : <PACKAGE>/tests/can_multichan_tx.c
371 @sh -c "mkdir -p tests $(dir $@)"
372 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_multichan_tx.o $<
373 @echo $@ ": \\" > $(notdir $@).deps
374 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
375 @tail -n +2 deps.tmp >> $(notdir $@).deps
376 @echo >> $(notdir $@).deps
378 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_multichan_tx.o
382 <PREFIX>/bin/can_baudrates : <PACKAGE>/tests/can_baudrates.c
383 @sh -c "mkdir -p tests $(dir $@)"
384 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_baudrates.o $<
385 @echo $@ ": \\" > $(notdir $@).deps
386 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
387 @tail -n +2 deps.tmp >> $(notdir $@).deps
388 @echo >> $(notdir $@).deps
390 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_baudrates.o
394 <PREFIX>/bin/can_extended_cfg : <PACKAGE>/tests/can_extended_cfg.c
395 @sh -c "mkdir -p tests $(dir $@)"
396 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_extended_cfg.o $<
397 @echo $@ ": \\" > $(notdir $@).deps
398 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
399 @tail -n +2 deps.tmp >> $(notdir $@).deps
400 @echo >> $(notdir $@).deps
402 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_extended_cfg.o