include/ecrt.h
changeset 2054 3417bbc4ad2f
parent 2009 b5391b329b5d
child 2060 8b67602f5161
--- a/include/ecrt.h	Thu Mar 03 09:05:40 2011 +0100
+++ b/include/ecrt.h	Wed Mar 16 22:12:23 2011 +0100
@@ -455,6 +455,23 @@
         ec_master_t *master /**< EtherCAT master */
         );
 
+
+#ifdef __KERNEL__
+/** Attach to a running master
+ *   
+ * This function returns the master handle for the RTDM-Interface
+ *
+ * \return Pointer to the opened master, otherwise \a NULL.
+ */
+ec_master_t *ecrt_attach_master(
+       unsigned int master_index /**< Index of the master to request. */
+       );
+
+#endif // #ifdef __KERNEL__
+
+
+
+
 /******************************************************************************
  * Master methods
  *****************************************************************************/
@@ -500,8 +517,38 @@
                        */
         );
 
+
+/** Returns domain structure pointer
+ *
+ * This functions return the domain structure pointer for usage inside the
+ * RTDM-Interface.
+ *
+ * \return Pointer to the domain on success, else NULL.
+ */
+ec_domain_t *ecrt_master_find_domain(
+        ec_master_t *master, 
+        unsigned int index);
+
+
 #endif /* __KERNEL__ */
 
+
+#ifndef __KERNEL__
+/** Return the domain index of a given domain strucure
+ *
+ * Return the domain index of a given domain strucure. Usage inside of the
+ * RTDM Interface
+ *
+ * \return Index of the domain strucure
+ *
+ */
+ unsigned int ecrt_domain_index(
+         ec_domain_t *domain
+         );
+
+#endif // #ifndef __KERNEL__
+
+
 /** Creates a new process data domain.
  *
  * For process data exchange, at least one process data domain is needed.
@@ -515,6 +562,7 @@
         ec_master_t *master /**< EtherCAT master. */
         );
 
+
 /** Obtains a slave configuration.
  *
  * Creates a slave configuration object for the given \a alias and \a position