include/ecrt.h
branchstable-1.0
changeset 1624 9dc190591c0f
parent 1623 05622513f627
equal deleted inserted replaced
1623:05622513f627 1624:9dc190591c0f
   209    \param DATA EtherCAT data pointer
   209    \param DATA EtherCAT data pointer
   210    \return EtherCAT data value
   210    \return EtherCAT data value
   211 */
   211 */
   212 
   212 
   213 #define EC_READ_S8(DATA) \
   213 #define EC_READ_S8(DATA) \
   214      ((int8_t)  *((uint8_t *) (DATA)))
   214      ((int8_t) *((uint8_t *) (DATA)))
   215 
   215 
   216 /**
   216 /**
   217    Read a 16-bit unsigned value from EtherCAT data.
   217    Read a 16-bit unsigned value from EtherCAT data.
   218    \param DATA EtherCAT data pointer
   218    \param DATA EtherCAT data pointer
   219    \return EtherCAT data value
   219    \return EtherCAT data value
   227    \param DATA EtherCAT data pointer
   227    \param DATA EtherCAT data pointer
   228    \return EtherCAT data value
   228    \return EtherCAT data value
   229 */
   229 */
   230 
   230 
   231 #define EC_READ_S16(DATA) \
   231 #define EC_READ_S16(DATA) \
   232      ((int16_t)  le16_to_cpup((void *) (DATA)))
   232      ((int16_t) le16_to_cpup((void *) (DATA)))
   233 
   233 
   234 /**
   234 /**
   235    Read a 32-bit unsigned value from EtherCAT data.
   235    Read a 32-bit unsigned value from EtherCAT data.
   236    \param DATA EtherCAT data pointer
   236    \param DATA EtherCAT data pointer
   237    \return EtherCAT data value
   237    \return EtherCAT data value
   245    \param DATA EtherCAT data pointer
   245    \param DATA EtherCAT data pointer
   246    \return EtherCAT data value
   246    \return EtherCAT data value
   247 */
   247 */
   248 
   248 
   249 #define EC_READ_S32(DATA) \
   249 #define EC_READ_S32(DATA) \
   250      ((int32_t)  le32_to_cpup((void *) (DATA)))
   250      ((int32_t) le32_to_cpup((void *) (DATA)))
   251 
   251 
   252 
   252 
   253 /******************************************************************************
   253 /******************************************************************************
   254  *  Write macros
   254  *  Write macros
   255  *****************************************************************************/
   255  *****************************************************************************/