master/slave.c
changeset 799 068a58b96965
parent 792 3778920f61e4
child 813 bfc3f1ab52de
equal deleted inserted replaced
798:5a58606726f3 799:068a58b96965
  1187 
  1187 
  1188 /*****************************************************************************/
  1188 /*****************************************************************************/
  1189 
  1189 
  1190 /**
  1190 /**
  1191  * Get an SDO from the dictionary.
  1191  * Get an SDO from the dictionary.
  1192  * \returns The desired SDO, of NULL.
  1192  * \returns The desired SDO, or NULL.
  1193  */
  1193  */
  1194 
  1194 
  1195 ec_sdo_t *ec_slave_get_sdo(
  1195 ec_sdo_t *ec_slave_get_sdo(
  1196         ec_slave_t *slave /**< EtherCAT slave */,
  1196         ec_slave_t *slave /**< EtherCAT slave */,
  1197         uint16_t index /**< SDO index */
  1197         uint16_t index /**< SDO index */
  1206 
  1206 
  1207     return NULL;
  1207     return NULL;
  1208 }
  1208 }
  1209 
  1209 
  1210 /*****************************************************************************/
  1210 /*****************************************************************************/
       
  1211 
       
  1212 /** Finds a mapped Pdo.
       
  1213  * \returns The desired Pdo object, or NULL.
       
  1214  */
       
  1215 const ec_pdo_t *ec_slave_find_pdo(
       
  1216         const ec_slave_t *slave, /**< Slave. */
       
  1217         uint16_t index /**< Pdo index to find. */
       
  1218         )
       
  1219 {
       
  1220     unsigned int i;
       
  1221     const ec_sync_t *sync;
       
  1222     const ec_pdo_t *pdo;
       
  1223 
       
  1224     for (i = 0; i < slave->sii_sync_count; i++) {
       
  1225         sync = &slave->sii_syncs[i];
       
  1226 
       
  1227         if (!(pdo = ec_pdo_mapping_find_pdo(&sync->mapping, index)))
       
  1228             continue;
       
  1229 
       
  1230         return pdo;
       
  1231     }
       
  1232 
       
  1233     return NULL;
       
  1234 }
       
  1235 
       
  1236 /*****************************************************************************/