[En-Nut-Discussion] CAN driver for mcp2510, what have I to do to create the driver?

Harald Kipp harald.kipp at egnite.de
Thu Aug 25 09:33:59 CEST 2005


Hello Franck,

Nothing special. In general you can run any existing C
Routine for AVR MCUs under Nut/OS as long as you take
care not to block the CPU. The best way to avoid this
is to use interrupts instead of polling.

There is no such thing like special driver code. You
can freely use port I/O and interrupts within your
application.

arch\avr\dev\sja1000.c contains code for the SJA1000,
which may provide a good API sample. This has been
implemented as a driver, but just to support NutRegisterDevice(),
I guess. It's not really required.

For the application the app/tcps or app/httpd may provide
good starting points.

You'll find several sources in the web about how to use
the ATmega SPI.

Harald

At 18:55 24.08.2005 +0200, you wrote:
>   I'm asking my self how (what are the conditions?), what have I to do (C
>file) to create driver for my mcp2510 (it's a CAN controller which is
>usuable on the SPI interface!)




More information about the En-Nut-Discussion mailing list