include/sync.h
changeset 263 d221d387ad2f
parent 235 f812bf6b7237
child 291 6165554cbfe9
equal deleted inserted replaced
262:f1c892f3f93c 263:d221d387ad2f
    31 void _post_sync(void);
    31 void _post_sync(void);
    32 
    32 
    33 typedef void (*post_TPDO_t)(void);
    33 typedef void (*post_TPDO_t)(void);
    34 void _post_TPDO(void);
    34 void _post_TPDO(void);
    35 
    35 
    36 /** transmit a SYNC message on the bus number bus_id
    36 /** transmit a SYNC message and trigger sync TPDOs
    37  * bus_id is hardware dependant
       
    38  * return canSend(bus_id,&m)
       
    39  */
    37  */
    40 UNS8 sendSYNC (CO_Data* d, UNS32 cob_id);
    38 UNS8 sendSYNC (CO_Data* d, UNS32 cob_id);
       
    39 /** transmit a SYNC message on CAN bus
       
    40  */
       
    41 UNS8 sendSYNCMessage(CO_Data* d, UNS32 cob_id);
    41 
    42 
    42 /** This function is called when the node is receiving a SYNC message (cob-id = 0x80).
    43 /** This function is called when the node is receiving a SYNC message (cob-id = 0x80).
    43  *  - check if the node is in OERATIONAL mode. (other mode : return 0 but does nothing).
    44  *  - check if the node is in OERATIONAL mode. (other mode : return 0 but does nothing).
    44  *  - Get the SYNC cobId by reading the dictionary index 1005, check it does correspond to the received cobId
    45  *  - Get the SYNC cobId by reading the dictionary index 1005, check it does correspond to the received cobId
    45  *  - Trigger sync TPDO emission 
    46  *  - Trigger sync TPDO emission 
    46  *  - return 0 if OK, 0xFF if error
    47  *  - return 0 if OK, 0xFF if error
    47  */
    48  */
    48 UNS8 proceedSYNC (CO_Data* d, Message * m);
    49 UNS8 proceedSYNC (CO_Data* d);
    49 
    50 
    50 #endif
    51 #endif