#include <canop.h>
#include <def.h>
#include <objdict.h>
Go to the source code of this file.
Data Structures | |
struct | td_s_pdo_receive_transfer_table |
struct | td_s_variable_mapping |
Typedefs | |
typedef td_s_variable_mapping | s_variable_mapping |
typedef td_s_pdo_receive_transfer_table | s_pdo_receive_transfer_table |
Functions | |
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) |
This file contains functions for receiving and transmitting PDOs.
|
Struct to store received PDOs. |
|
this struct is only for the receiving transfer-table. it is needed because of the different mapping parameter for one pdo. this means: one pdo (up to 64bit) can mapp the value on different variables e.g.: the value of bit 1 is for bit 1 of the variable UINT8 led1; and the value of bit 14 is for the variable UINT8 led12; |
|
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
|