1 |
786 |
skrzyp |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# io_can.cdl
|
4 |
|
|
#
|
5 |
|
|
# eCos IO configuration data
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
## ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
12 |
|
|
##
|
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
|
16 |
|
|
## version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
## for more details.
|
22 |
|
|
##
|
23 |
|
|
## You should have received a copy of the GNU General Public License
|
24 |
|
|
## along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use
|
28 |
|
|
## macros or inline functions from this file, or you compile this file
|
29 |
|
|
## and link it with other works to produce a work based on this file,
|
30 |
|
|
## this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
## the GNU General Public License. However the source code for this file
|
32 |
|
|
## must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
## General Public License v2.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based
|
36 |
|
|
## on this file might be covered by the GNU General Public License.
|
37 |
|
|
## -------------------------------------------
|
38 |
|
|
## ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
# ====================================================================
|
40 |
|
|
######DESCRIPTIONBEGIN####
|
41 |
|
|
#
|
42 |
|
|
# Author(s): Uwe Kindler
|
43 |
|
|
# Original data: gthomas
|
44 |
|
|
# Contributors:
|
45 |
|
|
# Date: 2005-05-17
|
46 |
|
|
#
|
47 |
|
|
#####DESCRIPTIONEND####
|
48 |
|
|
#
|
49 |
|
|
# ====================================================================
|
50 |
|
|
|
51 |
|
|
cdl_package CYGPKG_IO_CAN {
|
52 |
|
|
display "CAN device drivers"
|
53 |
|
|
parent CYGPKG_IO
|
54 |
|
|
active_if CYGPKG_IO
|
55 |
|
|
requires CYGPKG_ERROR
|
56 |
|
|
include_dir cyg/io
|
57 |
|
|
description "
|
58 |
|
|
This option enables drivers for basic I/O services on
|
59 |
|
|
CAN devices."
|
60 |
|
|
doc ref/io.html
|
61 |
|
|
|
62 |
|
|
compile -library=libextras.a can.c
|
63 |
|
|
|
64 |
|
|
define_proc {
|
65 |
|
|
puts $::cdl_header "/***** proc output start *****/"
|
66 |
|
|
puts $::cdl_header "#include "
|
67 |
|
|
puts $::cdl_header "#ifdef CYGDAT_IO_CAN_DEVICE_HEADER"
|
68 |
|
|
puts $::cdl_header "# include CYGDAT_IO_CAN_DEVICE_HEADER"
|
69 |
|
|
puts $::cdl_header "#endif "
|
70 |
|
|
puts $::cdl_header "/****** proc output end ******/"
|
71 |
|
|
}
|
72 |
|
|
|
73 |
|
|
#-----------------------------------------------------------------
|
74 |
|
|
# Interfaces
|
75 |
|
|
# A hardware device driver should implement each interface it
|
76 |
|
|
# supports
|
77 |
|
|
#
|
78 |
|
|
cdl_interface CYGINT_IO_CAN_TIMESTAMP {
|
79 |
|
|
display "CAN driver supports timestamps"
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
cdl_interface CYGINT_IO_CAN_STD_CAN_ID {
|
83 |
|
|
display "11 Bit standard CAN ID support"
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
cdl_interface CYGINT_IO_CAN_EXT_CAN_ID {
|
87 |
|
|
display "29 Bit extended CAN ID support"
|
88 |
|
|
}
|
89 |
|
|
|
90 |
|
|
cdl_interface CYGINT_IO_CAN_RUNTIME_MBOX_CFG {
|
91 |
|
|
display "CAN driver supports message box runtime configuration"
|
92 |
|
|
}
|
93 |
|
|
|
94 |
|
|
cdl_interface CYGINT_IO_CAN_REMOTE_BUF {
|
95 |
|
|
display "CAN driver supports remote response buffers"
|
96 |
|
|
}
|
97 |
|
|
|
98 |
|
|
cdl_interface CYGINT_IO_CAN_AUTOBAUD {
|
99 |
|
|
display "CAN driver supports automatic baudrate detection"
|
100 |
|
|
}
|
101 |
|
|
|
102 |
|
|
cdl_interface CYGINT_IO_CAN_TX_EVENTS {
|
103 |
|
|
display "CAN driver supports TX events"
|
104 |
|
|
}
|
105 |
|
|
|
106 |
|
|
#-----------------------------------------------------------------
|
107 |
|
|
# Each single channel of a CAN chip or on chip CAN module should
|
108 |
|
|
# implement this interface. It counts the number of available
|
109 |
|
|
# CAN channels
|
110 |
|
|
#
|
111 |
|
|
cdl_interface CYGINT_IO_CAN_CHANNELS {
|
112 |
|
|
display "Number of CAN channels"
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
#-----------------------------------------------------------------
|
117 |
|
|
# Generic CAN driver configuration
|
118 |
|
|
#
|
119 |
|
|
cdl_component CYGPKG_IO_CAN_DEVICES {
|
120 |
|
|
display "Hardware CAN device drivers"
|
121 |
|
|
flavor bool
|
122 |
|
|
default_value 1
|
123 |
|
|
description "
|
124 |
|
|
This option enables the hardware device drivers
|
125 |
|
|
for the current platform."
|
126 |
|
|
}
|
127 |
|
|
|
128 |
|
|
cdl_option CYGOPT_IO_CAN_SUPPORT_TIMESTAMP {
|
129 |
|
|
display "Support CAN event timestamps"
|
130 |
|
|
requires { CYGINT_IO_CAN_TIMESTAMP > 0 }
|
131 |
|
|
active_if { CYGINT_IO_CAN_TIMESTAMP > 0 }
|
132 |
|
|
default_value 0
|
133 |
|
|
description "
|
134 |
|
|
If the CAN hardware driver supports some kind of timestamps
|
135 |
|
|
then this option enables propagation of timestamps to higher layers.
|
136 |
|
|
This may add some extra code to hardware drivers."
|
137 |
|
|
}
|
138 |
|
|
|
139 |
|
|
cdl_option CYGOPT_IO_CAN_TX_EVENT_SUPPORT {
|
140 |
|
|
display "Support TX events"
|
141 |
|
|
requires { CYGINT_IO_CAN_TX_EVENTS > 0 }
|
142 |
|
|
active_if { CYGINT_IO_CAN_TX_EVENTS > 0 }
|
143 |
|
|
default_value 0
|
144 |
|
|
description "
|
145 |
|
|
This option enables support for TX events. If a CAN message is
|
146 |
|
|
transmitted successfully a TX event will be inserted into the
|
147 |
|
|
receive event queue and propagated to higher layers. If this
|
148 |
|
|
option is enabled the RX event queue will be filled faster."
|
149 |
|
|
}
|
150 |
|
|
|
151 |
|
|
cdl_option CYGOPT_IO_CAN_STD_CAN_ID {
|
152 |
|
|
display "11 Bit standard CAN ID support"
|
153 |
|
|
requires { CYGINT_IO_CAN_STD_CAN_ID > 0 }
|
154 |
|
|
active_if { CYGINT_IO_CAN_STD_CAN_ID > 0 }
|
155 |
|
|
default_value { CYGINT_IO_CAN_STD_CAN_ID > 0 ? 1 : 0 }
|
156 |
|
|
description "
|
157 |
|
|
This option enables support for 11 Bit standard CAN identifiers.
|
158 |
|
|
If the application deals only with 29 Bit extended CAN messages
|
159 |
|
|
then disabling this option may reduce codesize or increase
|
160 |
|
|
performance."
|
161 |
|
|
}
|
162 |
|
|
|
163 |
|
|
cdl_option CYGOPT_IO_CAN_EXT_CAN_ID {
|
164 |
|
|
display "29 Bit extended CAN ID support"
|
165 |
|
|
requires { CYGINT_IO_CAN_EXT_CAN_ID > 0 }
|
166 |
|
|
active_if { CYGINT_IO_CAN_EXT_CAN_ID > 0 }
|
167 |
|
|
default_value { CYGINT_IO_CAN_EXT_CAN_ID > 0 ? 1 : 0 }
|
168 |
|
|
description "
|
169 |
|
|
This option enables support for 29 Bit extended CAN identifiers.
|
170 |
|
|
If the application deals only with 11 Bit standard CAN messages
|
171 |
|
|
then disabling this option may reduce codesize or increase
|
172 |
|
|
performance."
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
cdl_option CYGOPT_IO_CAN_AUTOBAUD {
|
176 |
|
|
display "Support automatic baudrate detection."
|
177 |
|
|
requires { CYGINT_IO_CAN_AUTOBAUD > 0 }
|
178 |
|
|
active_if { CYGINT_IO_CAN_AUTOBAUD > 0 }
|
179 |
|
|
default_value 0
|
180 |
|
|
description "
|
181 |
|
|
If the CAN hardware device driver supports any kind of automatic
|
182 |
|
|
baudrate detection then this option enables support for this feature.
|
183 |
|
|
If automatic baudrate detection is not required, then disabling this
|
184 |
|
|
option may reduce codesize."
|
185 |
|
|
}
|
186 |
|
|
|
187 |
|
|
cdl_option CYGOPT_IO_CAN_RUNTIME_MBOX_CFG {
|
188 |
|
|
display "Message box runtime configuration support"
|
189 |
|
|
requires { CYGINT_IO_CAN_RUNTIME_MBOX_CFG > 0 }
|
190 |
|
|
active_if { CYGINT_IO_CAN_RUNTIME_MBOX_CFG > 0 }
|
191 |
|
|
default_value 1
|
192 |
|
|
description "
|
193 |
|
|
Message box runtime configuration is required for for hardware message
|
194 |
|
|
filtering and for hardware remote response buffers. If no hardware
|
195 |
|
|
filtering is required and if the application does not need remote
|
196 |
|
|
response buffers this option can be disabled to decrease codesize."
|
197 |
|
|
}
|
198 |
|
|
|
199 |
|
|
cdl_option CYGOPT_IO_CAN_REMOTE_BUF {
|
200 |
|
|
display "Remote response buffer support"
|
201 |
|
|
requires { CYGOPT_IO_CAN_RUNTIME_MBOX_CFG }
|
202 |
|
|
requires { CYGINT_IO_CAN_REMOTE_BUF > 0}
|
203 |
|
|
active_if { CYGINT_IO_CAN_REMOTE_BUF > 0 }
|
204 |
|
|
default_value 1
|
205 |
|
|
description "
|
206 |
|
|
If the driver should handle remote requests automatically then remote
|
207 |
|
|
response buffers are required. Disabling this option may save some
|
208 |
|
|
bytes of ROM memory."
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
cdl_option CYGOPT_IO_CAN_SUPPORT_NONBLOCKING {
|
212 |
|
|
display "Support non-blocking read and write calls"
|
213 |
|
|
default_value 0
|
214 |
|
|
description "
|
215 |
|
|
This option enables extra code in the generic CAN driver
|
216 |
|
|
which allows clients to switch read() and write() call
|
217 |
|
|
semantics from blocking to non-blocking."
|
218 |
|
|
}
|
219 |
|
|
|
220 |
|
|
cdl_option CYGOPT_IO_CAN_SUPPORT_CALLBACK {
|
221 |
|
|
display "Support callback on events"
|
222 |
|
|
default_value 0
|
223 |
|
|
description "
|
224 |
|
|
This option enables extra code in the generic CAN driver
|
225 |
|
|
which allows application to register a callback for
|
226 |
|
|
events. The callback function is called from DSR
|
227 |
|
|
context so you should be careful to only call API
|
228 |
|
|
functions that are safe in DSR context."
|
229 |
|
|
}
|
230 |
|
|
|
231 |
|
|
cdl_component CYGOPT_IO_CAN_SUPPORT_TIMEOUTS {
|
232 |
|
|
display "Support read/write timeouts"
|
233 |
|
|
flavor bool
|
234 |
|
|
default_value 0
|
235 |
|
|
active_if CYGPKG_KERNEL
|
236 |
|
|
requires CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAIT
|
237 |
|
|
requires CYGOPT_IO_CAN_SUPPORT_NONBLOCKING
|
238 |
|
|
description "
|
239 |
|
|
Read and write operations are blocking calls. If no CAN message
|
240 |
|
|
arrives for a long time the calling thread remains blocked. If
|
241 |
|
|
nonblocking calls are enabled but the call should return after
|
242 |
|
|
a certain amount of time then this option should be enabled."
|
243 |
|
|
|
244 |
|
|
cdl_option CYGNUM_IO_CAN_DEFAULT_TIMEOUT_READ {
|
245 |
|
|
display "Default read timeout."
|
246 |
|
|
flavor data
|
247 |
|
|
default_value 100
|
248 |
|
|
description "
|
249 |
|
|
The initial timeout value in clock ticks for cyg_io_read() calls."
|
250 |
|
|
}
|
251 |
|
|
|
252 |
|
|
cdl_option CYGNUM_IO_CAN_DEFAULT_TIMEOUT_WRITE {
|
253 |
|
|
display "Default write timeout."
|
254 |
|
|
flavor data
|
255 |
|
|
default_value 100
|
256 |
|
|
description "
|
257 |
|
|
The initial timeout value in clock ticks for cyg_io_write() calls."
|
258 |
|
|
}
|
259 |
|
|
}
|
260 |
|
|
|
261 |
|
|
cdl_component CYGPKG_IO_CAN_OPTIONS {
|
262 |
|
|
display "CAN device driver build options"
|
263 |
|
|
flavor none
|
264 |
|
|
description "
|
265 |
|
|
Package specific build options including control over
|
266 |
|
|
compiler flags used only in building this package,
|
267 |
|
|
and details of which tests are built."
|
268 |
|
|
|
269 |
|
|
|
270 |
|
|
cdl_option CYGPKG_IO_CAN_CFLAGS_ADD {
|
271 |
|
|
display "Additional compiler flags"
|
272 |
|
|
flavor data
|
273 |
|
|
no_define
|
274 |
|
|
default_value { "" }
|
275 |
|
|
description "
|
276 |
|
|
This option modifies the set of compiler flags for
|
277 |
|
|
building the CAN device drivers. These flags are used
|
278 |
|
|
in addition to the set of global flags."
|
279 |
|
|
}
|
280 |
|
|
|
281 |
|
|
cdl_option CYGPKG_IO_CAN_CFLAGS_REMOVE {
|
282 |
|
|
display "Suppressed compiler flags"
|
283 |
|
|
flavor data
|
284 |
|
|
no_define
|
285 |
|
|
default_value { "" }
|
286 |
|
|
description "
|
287 |
|
|
This option modifies the set of compiler flags for
|
288 |
|
|
building the CAN device drivers. These flags are
|
289 |
|
|
removed from the set of global flags if present."
|
290 |
|
|
}
|
291 |
|
|
|
292 |
|
|
}
|
293 |
|
|
|
294 |
|
|
cdl_option CYGBLD_IO_CAN_EXTRA_TESTS {
|
295 |
|
|
display "Build extra CAN tests"
|
296 |
|
|
default_value 0
|
297 |
|
|
no_define
|
298 |
|
|
description "
|
299 |
|
|
This option enables the building of some extra tests which
|
300 |
|
|
can be used when testing / debugging CAN drivers. These
|
301 |
|
|
are not built by default since they do not use the dedicated
|
302 |
|
|
testing infrastructure. All tests require a properly configured
|
303 |
|
|
CAN network with a second CAN node that can send and receive
|
304 |
|
|
CAN messages."
|
305 |
|
|
|
306 |
|
|
make -priority 320 {
|
307 |
|
|
/bin/can_load : /tests/can_load.c
|
308 |
|
|
@sh -c "mkdir -p tests $(dir $@)"
|
309 |
|
|
$(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_load.o $<
|
310 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
311 |
|
|
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
|
312 |
|
|
@tail -n +2 deps.tmp >> $(notdir $@).deps
|
313 |
|
|
@echo >> $(notdir $@).deps
|
314 |
|
|
@rm deps.tmp
|
315 |
|
|
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_load.o
|
316 |
|
|
}
|
317 |
|
|
|
318 |
|
|
make -priority 320 {
|
319 |
|
|
/bin/can_remote : /tests/can_remote.c
|
320 |
|
|
@sh -c "mkdir -p tests $(dir $@)"
|
321 |
|
|
$(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_remote.o $<
|
322 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
323 |
|
|
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
|
324 |
|
|
@tail -n +2 deps.tmp >> $(notdir $@).deps
|
325 |
|
|
@echo >> $(notdir $@).deps
|
326 |
|
|
@rm deps.tmp
|
327 |
|
|
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_remote.o
|
328 |
|
|
}
|
329 |
|
|
|
330 |
|
|
make -priority 320 {
|
331 |
|
|
/bin/can_tx : /tests/can_tx.c
|
332 |
|
|
@sh -c "mkdir -p tests $(dir $@)"
|
333 |
|
|
$(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_tx.o $<
|
334 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
335 |
|
|
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
|
336 |
|
|
@tail -n +2 deps.tmp >> $(notdir $@).deps
|
337 |
|
|
@echo >> $(notdir $@).deps
|
338 |
|
|
@rm deps.tmp
|
339 |
|
|
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_tx.o
|
340 |
|
|
}
|
341 |
|
|
|
342 |
|
|
make -priority 320 {
|
343 |
|
|
/bin/can_filter : /tests/can_filter.c
|
344 |
|
|
@sh -c "mkdir -p tests $(dir $@)"
|
345 |
|
|
$(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_filter.o $<
|
346 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
347 |
|
|
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
|
348 |
|
|
@tail -n +2 deps.tmp >> $(notdir $@).deps
|
349 |
|
|
@echo >> $(notdir $@).deps
|
350 |
|
|
@rm deps.tmp
|
351 |
|
|
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_filter.o
|
352 |
|
|
}
|
353 |
|
|
|
354 |
|
|
make -priority 320 {
|
355 |
|
|
/bin/can_hdi : /tests/can_hdi.c
|
356 |
|
|
@sh -c "mkdir -p tests $(dir $@)"
|
357 |
|
|
$(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_hdi.o $<
|
358 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
359 |
|
|
@echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
|
360 |
|
|
@tail -n +2 deps.tmp >> $(notdir $@).deps
|
361 |
|
|
@echo >> $(notdir $@).deps
|
362 |
|
|
@rm deps.tmp
|
363 |
|
|
$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_hdi.o
|
364 |
|
|
}
|
365 |
|
|
}
|
366 |
|
|
}
|
367 |
|
|
|
368 |
|
|
# EOF io_can.cdl
|