[En-Nut-Discussion] CAN-Bus driver

Ole Reinhardt ole.reinhardt at kernelconcepts.de
Wed May 26 15:43:09 CEST 2004


> Creating a simple API for this kind of devices doesn't
> seem to be trivial. I had similar problems with
> TWI/I2C and I'm not happy with the current solution.
> But I can't think of anything more intuitive without
> spoiling flexibility.

Perhaps one should think about a more generic driver layout? In my eyes
the Linux approach is a quite good solution and could be ported to
Ethernut without tooooo much work. The UART drivers are going just into
this direction.

One could create an api with the following layout:

- character devices with stream I/O
- blockdevices with random I/O
- ioctrl for every device driver
- every device driver should have a read and a write function and also 
  some kind of a poll function.
- With the poll function one could implement a mechanism like the 
  poll/select from linux for non-blocking io

UART / Terminal / Sound / I2C / SPI / IDE etc. could be done with this
kind of devices. CAN perhaps too...

Additionaly we have the network devices. CAN could also be a network
device. Perhaps even more than a serial interface...

So my first approch will be to develop a network like API with a
function to send and to receive CAN packets...

Any further ideas?

Regards,

Ole

-- 
kernel concepts    Tel: +49-271-771091-14
Dreisbachstr. 24   Fax: +49-271-771091-19
D-57250 Netphen    E+ : +49-177-7420433
--





More information about the En-Nut-Discussion mailing list