master/datagram.h
branchstable-1.2
changeset 1739 5fcbd29151d2
parent 1732 1cc865ba17c2
child 1744 7bc131b92039
equal deleted inserted replaced
1738:bc89e3fba1a5 1739:5fcbd29151d2
    70    EtherCAT datagram state.
    70    EtherCAT datagram state.
    71 */
    71 */
    72 
    72 
    73 typedef enum
    73 typedef enum
    74 {
    74 {
    75     EC_DATAGRAM_INIT, /**< new datagram */
    75     EC_DATAGRAM_INIT,      /**< new datagram */
    76     EC_DATAGRAM_QUEUED, /**< datagram queued by master */
    76     EC_DATAGRAM_QUEUED,    /**< datagram queued for sending */
    77     EC_DATAGRAM_SENT, /**< datagram has been sent and still in the queue */
    77     EC_DATAGRAM_SENT,      /**< datagram has been sent (still in the queue) */
    78     EC_DATAGRAM_RECEIVED, /**< datagram has been received and dequeued */
    78     EC_DATAGRAM_RECEIVED,  /**< datagram has been received (dequeued) */
    79     EC_DATAGRAM_TIMED_OUT, /**< datagram timed out and was dequeued */
    79     EC_DATAGRAM_TIMED_OUT, /**< datagram timed out (dequeued) */
    80     EC_DATAGRAM_ERROR /**< error while sending/receiving, datagram dequeued */
    80     EC_DATAGRAM_ERROR      /**< error while sending/receiving (dequeued) */
    81 }
    81 }
    82 ec_datagram_state_t;
    82 ec_datagram_state_t;
    83 
    83 
    84 /*****************************************************************************/
    84 /*****************************************************************************/
    85 
    85 
    87    EtherCAT address.
    87    EtherCAT address.
    88 */
    88 */
    89 
    89 
    90 typedef union
    90 typedef union
    91 {
    91 {
       
    92     /**
       
    93      * Physical address.
       
    94      */
    92     struct
    95     struct
    93     {
    96     {
    94         uint16_t slave; /**< configured or autoincrement address */
    97         uint16_t slave; /**< configured or autoincrement address */
    95         uint16_t mem; /**< physical memory address */
    98         uint16_t mem; /**< physical memory address */
    96     }
    99     }
    97     physical; /**< physical address */
   100     physical;
    98 
   101 
    99     uint32_t logical; /**< logical address */
   102     uint32_t logical; /**< logical address */
   100 }
   103 }
   101 ec_address_t;
   104 ec_address_t;
   102 
   105 
   117     size_t mem_size; /**< datagram \a data memory size */
   120     size_t mem_size; /**< datagram \a data memory size */
   118     size_t data_size; /**< size of the data in \a data */
   121     size_t data_size; /**< size of the data in \a data */
   119     uint8_t index; /**< datagram index (set by master) */
   122     uint8_t index; /**< datagram index (set by master) */
   120     uint16_t working_counter; /**< working counter */
   123     uint16_t working_counter; /**< working counter */
   121     ec_datagram_state_t state; /**< datagram state */
   124     ec_datagram_state_t state; /**< datagram state */
   122     cycles_t cycles_queued; /**< time, the datagram was queued */
       
   123     cycles_t cycles_sent; /**< time, the datagram was sent */
   125     cycles_t cycles_sent; /**< time, the datagram was sent */
   124     unsigned long jiffies_sent; /**< jiffies when datagram was sent */
   126     unsigned long jiffies_sent; /**< jiffies, when the datagram was sent */
   125     cycles_t cycles_received; /**< time, the datagram was received */
   127     cycles_t cycles_received; /**< time, when the datagram was received */
   126     unsigned long jiffies_received; /**< jiffies when datagram was received */
   128     unsigned long jiffies_received; /**< jiffies, when the datagram was rec. */
   127 }
   129 }
   128 ec_datagram_t;
   130 ec_datagram_t;
   129 
   131 
   130 /*****************************************************************************/
   132 /*****************************************************************************/
   131 
   133