master/slave.c
changeset 619 15becb1879fd
parent 618 e4b89c862c43
child 620 4f76acbf54a0
equal deleted inserted replaced
618:e4b89c862c43 619:15becb1879fd
  1112 }
  1112 }
  1113 
  1113 
  1114 /*****************************************************************************/
  1114 /*****************************************************************************/
  1115 
  1115 
  1116 /**
  1116 /**
       
  1117  */
       
  1118 
       
  1119 ec_sii_sync_t *ec_slave_get_pdo_sync(
       
  1120         ec_slave_t *slave, /**< EtherCAT slave */
       
  1121         ec_direction_t dir /**< input or output */
       
  1122         )
       
  1123 {
       
  1124     unsigned int sync_index;
       
  1125 
       
  1126     switch (dir) {
       
  1127         case EC_DIR_OUTPUT: sync_index = 0; break;
       
  1128         case EC_DIR_INPUT:  sync_index = 1; break;
       
  1129         default:
       
  1130             EC_ERR("Invalid direction!\n");
       
  1131             return NULL;
       
  1132     }
       
  1133 
       
  1134     if (slave->sii_mailbox_protocols) sync_index += 2;
       
  1135 
       
  1136     if (sync_index >= slave->sii_sync_count) {
       
  1137         EC_ERR("No appropriate sync manager found.\n");
       
  1138         return NULL;
       
  1139     }
       
  1140 
       
  1141     return &slave->sii_syncs[sync_index];
       
  1142 }
       
  1143 
       
  1144 /*****************************************************************************/
       
  1145 
       
  1146 /**
  1117    Initializes a sync manager configuration page with EEPROM data.
  1147    Initializes a sync manager configuration page with EEPROM data.
  1118    The referenced memory (\a data) must be at least EC_SYNC_SIZE bytes.
  1148    The referenced memory (\a data) must be at least EC_SYNC_SIZE bytes.
  1119 */
  1149 */
  1120 
  1150 
  1121 void ec_slave_sync_config(const ec_slave_t *slave, /**< EtherCAT slave */
  1151 void ec_slave_sync_config(const ec_slave_t *slave, /**< EtherCAT slave */