2009-01-15 22:49:59 UTC
I am just studying relations between driver and application (Example) and between driver and CANopenNode.
It looks quite straightforward.
Driver Interface for an application
-----------------------------------
CO_CANmodule_init() is called from an application. Most important functionality is providing buffers/slots for sending and receiving of CAN messages.
Driver Interface for CANopenNode
--------------------------------
I have to implement
CO_CANrxBufferInit(),
CO_CANtxBufferInit(),
CO_CANsend(),
+ something unknown yet,
+ task/thread which will in loop receive CAN message from eCos driver and checks receive slots if it is expected. If it is call receive callback.
I think I will add function for synchronization into driver. It will be called from an application e.g. between CO_SDOclientDownloadInitiate() and CO_SDOclientDownload() so application thread can be switched into waiting mode until CAN msg is received. eCos provides synchronization primitives.
something like
void CO_CANrxWait(CO_CANmodule_t *CANmodule,
UNSIGNED16 index,
UNSIGNED16 timeout);
I am not implementing CANopen device. I need to control them. Currently I need only SDO client(master) functionality. Later I will need to be also PDO consumer. I have to control more nodes. Fortunately such functionality is supported by CANopenNode.
Thanks,
Bronislav Gabrhelik