master/device.c
changeset 670 f57de4585a5f
parent 590 5801d4a4ff7d
child 679 62fc387ec928
equal deleted inserted replaced
669:884a5b5b0163 670:f57de4585a5f
   299    If the device notifies the master about the link being down, the master
   299    If the device notifies the master about the link being down, the master
   300    will not try to send frames using this device.
   300    will not try to send frames using this device.
   301    \ingroup DeviceInterface
   301    \ingroup DeviceInterface
   302 */
   302 */
   303 
   303 
   304 void ecdev_link_state(ec_device_t *device, /**< EtherCAT device */
   304 void ecdev_set_link(ec_device_t *device, /**< EtherCAT device */
   305                       uint8_t state /**< new link state */
   305         uint8_t state /**< new link state */
   306                       )
   306         )
   307 {
   307 {
   308     if (unlikely(!device)) {
   308     if (unlikely(!device)) {
   309         EC_WARN("ecdev_link_state: no device!\n");
   309         EC_WARN("ecdev_link_state: no device!\n");
   310         return;
   310         return;
   311     }
   311     }
   316     }
   316     }
   317 }
   317 }
   318 
   318 
   319 /*****************************************************************************/
   319 /*****************************************************************************/
   320 
   320 
       
   321 /**
       
   322    Reads the link state.
       
   323    \ingroup DeviceInterface
       
   324 */
       
   325 
       
   326 uint8_t ecdev_get_link(ec_device_t *device /**< EtherCAT device */)
       
   327 {
       
   328     if (unlikely(!device)) {
       
   329         EC_WARN("ecdev_link_state: no device!\n");
       
   330         return 0;
       
   331     }
       
   332 
       
   333     return device->link_state;
       
   334 }
       
   335 
       
   336 /*****************************************************************************/
       
   337 
   321 /** \cond */
   338 /** \cond */
   322 
   339 
   323 EXPORT_SYMBOL(ecdev_receive);
   340 EXPORT_SYMBOL(ecdev_receive);
   324 EXPORT_SYMBOL(ecdev_link_state);
   341 EXPORT_SYMBOL(ecdev_get_link);
       
   342 EXPORT_SYMBOL(ecdev_set_link);
   325 
   343 
   326 /** \endcond */
   344 /** \endcond */
   327 
   345 
   328 /*****************************************************************************/
   346 /*****************************************************************************/