nico@207: \hypertarget{sync_8h}{ nico@207: \section{/home/epimerde/documents/tc11/Can\-Festival-3/include/sync.h File Reference} nico@207: \label{sync_8h}\index{/home/epimerde/documents/tc11/CanFestival-3/include/sync.h@{/home/epimerde/documents/tc11/CanFestival-3/include/sync.h}} nico@207: } nico@207: \subsection*{Typedefs} nico@207: \begin{CompactItemize} nico@207: \item nico@207: typedef void($\ast$) \hyperlink{sync_8h_8a0b5b8c19b375ef1c985caa120f3274}{post\_\-sync\_\-t} (void) nico@207: \item nico@207: typedef void($\ast$) \hyperlink{sync_8h_b9bc4632750ad12f918aa22a1eb7756b}{post\_\-TPDO\_\-t} (void) nico@207: \end{CompactItemize} nico@207: \subsection*{Functions} nico@207: \begin{CompactItemize} nico@207: \item nico@207: void \hyperlink{sync_8h_2e0bf669f5b40dfbdda0f12a5ae3631a}{start\-SYNC} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d) nico@207: \item nico@207: void \hyperlink{sync_8h_41c47dbd59d22bf9bab6cd288cf27164}{stop\-SYNC} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d) nico@207: \item nico@207: void \hyperlink{sync_8h_1da155dcbd7fa1271216d74a15e30490}{\_\-post\_\-sync} (void) nico@207: \item nico@207: void \hyperlink{sync_8h_1fdf94721303f1c60bb2de1a36b13cc4}{\_\-post\_\-TPDO} (void) nico@207: \item nico@207: UNS8 \hyperlink{sync_8h_0bcc501eb14c12365ffbaa3453905b50}{send\-SYNC} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS32 cob\_\-id) nico@207: \item nico@207: UNS8 \hyperlink{sync_8h_80cadcba23dc859db8a8d3f52789d6d1}{proceed\-SYNC} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, \hyperlink{structMessage}{Message} $\ast$m) nico@207: \end{CompactItemize} nico@207: nico@207: nico@207: \subsection{Typedef Documentation} nico@207: \hypertarget{sync_8h_8a0b5b8c19b375ef1c985caa120f3274}{ nico@207: \index{sync.h@{sync.h}!post_sync_t@{post\_\-sync\_\-t}} nico@207: \index{post_sync_t@{post\_\-sync\_\-t}!sync.h@{sync.h}} nico@207: \subsubsection[post\_\-sync\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{sync_8h_8a0b5b8c19b375ef1c985caa120f3274}{post\_\-sync\_\-t}(void)}} nico@207: \label{sync_8h_8a0b5b8c19b375ef1c985caa120f3274} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 30 of file sync.h.\hypertarget{sync_8h_b9bc4632750ad12f918aa22a1eb7756b}{ nico@207: \index{sync.h@{sync.h}!post_TPDO_t@{post\_\-TPDO\_\-t}} nico@207: \index{post_TPDO_t@{post\_\-TPDO\_\-t}!sync.h@{sync.h}} nico@207: \subsubsection[post\_\-TPDO\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{sync_8h_b9bc4632750ad12f918aa22a1eb7756b}{post\_\-TPDO\_\-t}(void)}} nico@207: \label{sync_8h_b9bc4632750ad12f918aa22a1eb7756b} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 33 of file sync.h. nico@207: nico@207: \subsection{Function Documentation} nico@207: \hypertarget{sync_8h_1da155dcbd7fa1271216d74a15e30490}{ nico@207: \index{sync.h@{sync.h}!_post_sync@{\_\-post\_\-sync}} nico@207: \index{_post_sync@{\_\-post\_\-sync}!sync.h@{sync.h}} nico@207: \subsubsection[\_\-post\_\-sync]{\setlength{\rightskip}{0pt plus 5cm}void \_\-post\_\-sync (void)}} nico@207: \label{sync_8h_1da155dcbd7fa1271216d74a15e30490} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 245 of file sync.c.\hypertarget{sync_8h_1fdf94721303f1c60bb2de1a36b13cc4}{ nico@207: \index{sync.h@{sync.h}!_post_TPDO@{\_\-post\_\-TPDO}} nico@207: \index{_post_TPDO@{\_\-post\_\-TPDO}!sync.h@{sync.h}} nico@207: \subsubsection[\_\-post\_\-TPDO]{\setlength{\rightskip}{0pt plus 5cm}void \_\-post\_\-TPDO (void)}} nico@207: \label{sync_8h_1fdf94721303f1c60bb2de1a36b13cc4} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 246 of file sync.c.\hypertarget{sync_8h_80cadcba23dc859db8a8d3f52789d6d1}{ nico@207: \index{sync.h@{sync.h}!proceedSYNC@{proceedSYNC}} nico@207: \index{proceedSYNC@{proceedSYNC}!sync.h@{sync.h}} nico@207: \subsubsection[proceedSYNC]{\setlength{\rightskip}{0pt plus 5cm}UNS8 proceed\-SYNC (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, \hyperlink{structMessage}{Message} $\ast$ {\em m})}} nico@207: \label{sync_8h_80cadcba23dc859db8a8d3f52789d6d1} nico@207: nico@207: nico@207: This function is called when the node is receiving a SYNC message (cob-id = 0x80). What does the function : check if the node is in OERATIONAL mode. (other mode : return 0 but does nothing). Get the SYNC cob\-Id by reading the dictionary index 1005. (Return -1 if it does not correspond to the cob\-Id received). Scan the dictionary from index 0x1800 to the last PDO defined (dict\_\-cstes.max\_\-count\_\-of\_\-PDO\_\-transmit) for each PDO whose transmission type is on synchro (transmission type $<$ 241) and if the msg must be send at this SYNC. read the COBID. Verify that the node\-Id inside the node\-Id correspond to b\-Device\-Node\-Id. (Assume that the cob\-Id of a PDO Transmit is made with the node id of the node who transmit), get the mapping, launch PDOm\-GR to send the PDO $\ast$m is a pointer to the message received bus\_\-id is hardware dependant return 0 if OK, 0x\-FF if error nico@207: nico@207: Definition at line 93 of file sync.c. nico@207: nico@207: References td\_\-indextable::b\-Sub\-Count, Copy\-Bits(), struct\_\-s\_\-process\_\-var::count, struct\_\-CO\_\-Data::count\_\-sync, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-process\_\-var::data, struct\_\-CO\_\-Data::first\-Index, get\-ODentry(), struct\_\-CO\_\-Data::last\-Index, MSG\_\-ERR, MSG\_\-WAR, struct\_\-CO\_\-Data::node\-State, struct\_\-CO\_\-Data::objdict, OD\_\-SUCCESSFUL, Operational, s\_\-quick\_\-index::PDO\_\-TRS, s\_\-quick\_\-index::PDO\_\-TRS\_\-MAP, PDOm\-GR(), td\_\-subindex::p\-Object, struct\_\-CO\_\-Data::post\_\-sync, struct\_\-CO\_\-Data::post\_\-TPDO, struct\_\-CO\_\-Data::process\_\-var, td\_\-indextable::p\-Subindex, state10, state11, state3, state4, state5, state7, state8, state9, TRANS\_\-SYNC\_\-MAX, TRANS\_\-SYNC\_\-MIN, UNS16, UNS32, and UNS8.\hypertarget{sync_8h_0bcc501eb14c12365ffbaa3453905b50}{ nico@207: \index{sync.h@{sync.h}!sendSYNC@{sendSYNC}} nico@207: \index{sendSYNC@{sendSYNC}!sync.h@{sync.h}} nico@207: \subsubsection[sendSYNC]{\setlength{\rightskip}{0pt plus 5cm}UNS8 send\-SYNC (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS32 {\em cob\_\-id})}} nico@207: \label{sync_8h_0bcc501eb14c12365ffbaa3453905b50} nico@207: nico@207: nico@207: transmit a SYNC message on the bus number bus\_\-id bus\_\-id is hardware dependant return can\-Send(bus\_\-id,\&m) nico@207: nico@207: Definition at line 77 of file sync.c. nico@207: nico@207: References struct\_\-CO\_\-Data::can\-Handle, can\-Send(), Message::cob\_\-id, struct\_\-s\_\-timer\_\-entry::d, Message::len, MSG\_\-WAR, NOT\_\-A\_\-REQUEST, proceed\-SYNC(), Message::rtr, UNS8, and SHORT\_\-CAN::w.\hypertarget{sync_8h_2e0bf669f5b40dfbdda0f12a5ae3631a}{ nico@207: \index{sync.h@{sync.h}!startSYNC@{startSYNC}} nico@207: \index{startSYNC@{startSYNC}!sync.h@{sync.h}} nico@207: \subsubsection[startSYNC]{\setlength{\rightskip}{0pt plus 5cm}void start\-SYNC (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}} nico@207: \label{sync_8h_2e0bf669f5b40dfbdda0f12a5ae3631a} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 50 of file sync.c. nico@207: nico@207: References struct\_\-CO\_\-Data::COB\_\-ID\_\-Sync, struct\_\-s\_\-timer\_\-entry::d, On\-COB\_\-ID\_\-Sync\-Update(), Register\-Set\-ODentry\-Call\-Back(), Set\-Alarm(), stop\-SYNC(), struct\_\-CO\_\-Data::Sync\_\-Cycle\_\-Period, Sync\-Alarm(), struct\_\-CO\_\-Data::sync\-Timer, and US\_\-TO\_\-TIMEVAL.\hypertarget{sync_8h_41c47dbd59d22bf9bab6cd288cf27164}{ nico@207: \index{sync.h@{sync.h}!stopSYNC@{stopSYNC}} nico@207: \index{stopSYNC@{stopSYNC}!sync.h@{sync.h}} nico@207: \subsubsection[stopSYNC]{\setlength{\rightskip}{0pt plus 5cm}void stop\-SYNC (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}} nico@207: \label{sync_8h_41c47dbd59d22bf9bab6cd288cf27164} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 71 of file sync.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, Del\-Alarm(), and struct\_\-CO\_\-Data::sync\-Timer.