[En-Nut-Discussion] RFC: CAN Bus driver buffer handling

Henrik Maier hmnews at proconx.com
Wed Aug 5 02:15:14 CEST 2009

Hi Ole,

This is a good idea and I second that approach. I am happy to modify and
verify the ATCAN driver.

If the CAN API is reviewed anyway, there are a few things which need
- time-out support also for sending
- unified API for setting masks and filters so this works across all
supported CAN controllers
- Buffer size configurable either via configurator OR run-time
- Buffer size configurable differently for RX and TX
- Support for multiple CAN controllers

Just one comment, the ATCAN driver does not use a TX buffer and a TX thread.
The reason back then was that the first AT90CAN128 chips had issues with the
stack which limited the amount of threads available so I did not want to
waste a precious thread for sending. In addition the controller offers 15
message objects which can be used as a buffer.



> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of Ole Reinhardt
> Sent: Tuesday, 4 August 2009 11:26 PM
> To: en-nut-discussion at egnite.de
> Subject: [En-Nut-Discussion] RFC: CAN Bus driver buffer handling
> Hi all,
> I'm currently writing a CAN bus driver for the SAM7x and try to reuse
> the same API the other platforms (ATMega with SJA1000 / AT90CAN) use.
> I noticed that both mentioned drivers implement their own buffer
> structure for rx / tx buffering. Both are based on the same concept.
> I'd better like a common concept for can bus buffering and would like to
> implement a can bus buffer api in dev/can_dev.c which might be used
> commonly by all drivers. I'd add a rx and tx buffer pointer to the
> CANINFO struct.
> This concept would also allow to have multiple can bus drivers in one
> system.
> Any comments?
> bye,
> Ole
> PS: I could adapt sja1000.c accordingly. But atcan.c (AT90CAN driver)
> directly includes the buffer handling into the interrupt routine so I'd
> like to ask henrik to adapt his driver.
> --
>  _____________________________________________________________
> |                                                             |
> | Embedded-IT                                                 |
> |                                                             |
> | Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
> | Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
> | 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
> | Germany              Web:         http://www.embedded-it.de |
> |_____________________________________________________________|
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion

More information about the En-Nut-Discussion mailing list