Advertisement
Wistaro

EtherCAT SSC v5.12

Jul 1st, 2021
1,502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.28 KB | None | 0 0
  1. /*---------------------------------------------
  2. -    SDO-Info Header
  3. -----------------------------------------------*/
  4.  
  5. typedef struct MBX_STRUCT_PACKED_START
  6. {
  7.     UINT16 InfoHead; /**< \brief Opcode, Incomplete flag and 8 reserved bits*/
  8.         #define     INFOHEAD_OPCODE_MASK            0x007F /**< \brief Opcode mask*/
  9.         #define     INFOHEAD_OPCODE_SHIFT           0 /**< \brief Opcode shift*/
  10.         #define     INFOHEADER_INCOMPLETE_MASK      0x0080 /**< \brief Incomplete mask*/
  11.         #define     INFOHEADER_INCOMPLETE_SHIFT     0 /**< \brief Incomplete shift, the incomplete value "SDOINFOSERVICE_INCOMPLETE" is defined as a UINT8 => no shift required*/
  12.  
  13.     UINT16                FragmentsLeft; /**< \brief Number of fragments which will follow*/
  14.  
  15.     union MBX_STRUCT_PACKED_START
  16.     {
  17.         TSDOINFOLIST    List;/**< \brief List data*/
  18.         TSDOINFOOBJ     Obj;/**< \brief Object Description data*/
  19.         TSDOINFOENTRY   Entry;/**< \brief Entry description data*/
  20.         TSDOINFOERROR   Error;/**< \brief Error data*/
  21.         UINT16          Data[1];/**< \brief Unspecified data*/
  22.     }MBX_STRUCT_PACKED_END
  23.     Data;/**< \brief Service data*/
  24.  
  25. }MBX_STRUCT_PACKED_END
  26. TSDOINFOHEADER;
  27.  
  28.  
  29.  
  30.  
  31. /*---------------------------------------------
  32. -    SOE Structures
  33. -----------------------------------------------*/
  34.  
  35. /** \brief SoE Header*/
  36. typedef struct MBX_STRUCT_PACKED_START
  37. {
  38.     union MBX_STRUCT_PACKED_START
  39.     {
  40.         UINT16 Word; /**< \brief Flags buffer*/
  41.         #define    SOEFLAGS_OPCODE        0x0007 /**< \brief SoE Flags*/
  42.                                         /**<
  43.                                         * 0 = unused<br>
  44.                                         * 1 = readReq<br>
  45.                                         * 2 = readRes<br>
  46.                                         * 3 = writeReq<br>
  47.                                         * 4 = writeRes<br>
  48.                                         * 5 = notification (command changed notification)*/
  49.         #define    SOEFLAGS_INCOMPLETE    0x0008    /**< \brief more follows*/
  50.         #define    SOEFLAGS_ERROR         0x0010    /**< \brief an error word follows*/
  51.         #define    SOEFLAGS_DRIVENO       0x00E0    /**< \brief drive number*/
  52.  
  53.         #define    SOEFLAGS_DATASTATE     0x0100    /**< \brief Data state follows or requested*/
  54.         #define    SOEFLAGS_NAME          0x0200    /**< \brief Name follows or requested*/
  55.         #define    SOEFLAGS_ATTRIBUTE     0x0400    /**< \brief Attribute follows or requested*/
  56.         #define    SOEFLAGS_UNIT          0x0800    /**< \brief Unit follows or requested*/
  57.         #define    SOEFLAGS_MIN           0x1000    /**< \brief Min value follows or requested*/
  58.         #define    SOEFLAGS_MAX           0x2000    /**< \brief Max value follows or requested*/
  59.         #define    SOEFLAGS_VALUE         0x4000    /**< \brief Value follows or requested*/
  60.         #define    SOEFLAGS_DEFAULT       0x8000    /**< \brief Default value*/
  61.     }MBX_STRUCT_PACKED_END
  62.     Flags;/**< \brief Flags variable*/
  63.  
  64.     UINT16        IDN_Frag;  /**< \brief IDN fragments
  65.                               *
  66.                               * if (InComplete==0) SERCOS IDN else FragmentsLeft
  67.                               */
  68. }MBX_STRUCT_PACKED_END
  69. TSOEHEADER;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement