#include <pdo.h>
#include <def.h>
#include <objacces.h>
#include <general.h>
#include <canop.h>
#include <objdict.h>
#include <init.h>
Data Structures | |
struct | sd_pdo_transmit_transfer_table |
Defines | |
#define | FILL_DATA 0, 0, 0, 0, 0 |
#define | FILL_IN_DATA 0, 0, 0, 0, 0, 0, 0, 0 |
#define | FILL_IN_MESSAGE_DATA 0, 0, 0, 0 |
Typedefs | |
typedef sd_pdo_transmit_transfer_table | s_pdo_transmit_transfer_table |
Functions | |
void | CopyBits (int NbBits, char *SrcByteIndex, int SrcBitIndex, BOOL SrcLittleEndian, char *DestByteIndex, int DestBitIndex, BOOL DestLittleEndian) |
void | processSendPDO (void) |
void | processReceivedPDO (s_rx_buffer_message *canopenMessage) |
void | sendPDO (const WORD wID, const BYTE *pbData, const BYTE bLength, const BOOL bRemoteReceive) |
BOOL | resetTxPDOData (BYTE bPDONr) |
|
|
|
for the next two vars: adjust the count of lines according to the value of MAX_COUNT_OF_PDO, to avoid unexpected things... |
|
|
|
some data definitions |
|
|
|
This function should be called in every while-loop of the operational( )-function (file app.c). It is responsible to analyse incoming PDO messages. Therefore it sets local variables to the received values if there are some rx-PDOs defined. only transmissiontype 255 (0xFF) is supported yet.
|
|
Sends PDO (if any data has changed) to other CANopen devices. Only transmissiontype 255 (0xFF) is supported yet. This function has to be called every time a PDO has changed and should be sent to foreign nodes. So you should either call this function in interrupt service routines, which modifies PDOs or in the while-loop in the operational( )-function (in file app.c) |
|
At the moment the SlaveLib can only handle PDOs with transmissiontype 255. It sends PDOs and stores the values in the struct called TxPDOTransferTable. Therefore, if the next time processSendPDO is called, it checkes wheter the values have changed since last sending of a PDO or not. If the lether is the case, no data are sent. For some programs it is useful to always send a message due to several reasons. Therefore this function sets the previous stored data to invalid, so the function processSendPDO sends the new data (that may contain the same data as sent before) out to the CAN-Bus.
|
|
sends a PDO message to the CANopen device with the id bID and the data defined by the m
|