00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __pdo_h__
00024 #define __pdo_h__
00025
00026 #include <applicfg.h>
00027 #include <def.h>
00028
00029 #include "can.h"
00030
00031 typedef struct struct_s_PDO_status s_PDO_status;
00032
00033 #include "data.h"
00034
00035
00036 #define PDO_INHIBITED 0x01
00037 #define PDO_RTR_SYNC_READY 0x01
00038
00040 struct struct_s_PDO_status {
00041 UNS8 transmit_type_parameter;
00042 TIMER_HANDLE event_timer;
00043 TIMER_HANDLE inhibit_timer;
00044 Message last_message;
00045 };
00046
00047 #define s_PDO_staus_Initializer {0, TIMER_NONE, TIMER_NONE, Message_Initializer}
00048
00053 #define TRANS_EVERY_N_SYNC(n) (n)
00054 #define TRANS_SYNC_MIN 1
00055 #define TRANS_SYNC_MAX 240
00056 #define TRANS_RTR_SYNC 252
00057 #define TRANS_RTR 253
00058 #define TRANS_EVENT_SPECIFIC 254
00059 #define TRANS_EVENT_PROFILE 255
00060
00069 UNS8 buildPDO(CO_Data* d, UNS8 numPdo, Message *pdo);
00070
00076 UNS8 sendPDOrequest( CO_Data* d, UNS16 RPDOIndex );
00077
00082 UNS8 proceedPDO (CO_Data* d, Message *m);
00083
00090 UNS8 sendPDOevent (CO_Data* d);
00091
00095 UNS8 _sendPDOevent(CO_Data* d, UNS8 isSyncEvent);
00096
00097
00098 void PDOInit(CO_Data* d);
00099 void PDOStop(CO_Data* d);
00100 void PDOEventTimerAlarm(CO_Data* d, UNS32 pdoNum);
00101 void PDOInhibitTimerAlarm(CO_Data* d, UNS32 pdoNum);
00102
00103
00104 void CopyBits(UNS8 NbBits, UNS8* SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8* DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian);
00105 #endif