Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SOEM SPI_STMPE610 SPI_TFT_ILI9341 TFT_fonts
Diff: SOEM/oshw/oshw.cpp
- Revision:
- 0:7077d8f28b3e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SOEM/oshw/oshw.cpp Tue Jun 11 10:19:08 2019 +0000
@@ -0,0 +1,56 @@
+/*
+ * Licensed under the GNU General Public License version 2 with exceptions. See
+ * LICENSE file in the project root for full license information
+ */
+
+#include "oshw.h"
+#include <stdlib.h>
+#include "lwip/def.h"
+
+
+/**
+ * Host to Network byte order (i.e. to big endian).
+ *
+ * Note that Ethercat uses little endian byte order, except for the Ethernet
+ * header which is big endian as usual.
+ */
+
+
+
+uint16 oshw_htons(const uint16 host)
+{
+ return htons (host);
+}
+
+
+/**
+ * Network (i.e. big endian) to Host byte order.
+ *
+ * Note that Ethercat uses little endian byte order, except for the Ethernet
+ * header which is big endian as usual.
+ */
+uint16 oshw_ntohs(const uint16 network)
+{
+ return ntohs (network);
+}
+
+/* Create list over available network adapters.
+ * @return First element in linked list of adapters
+ */
+ec_adaptert * oshw_find_adapters(void)
+{
+ ec_adaptert * ret_adapter = NULL;
+
+ /* TODO if needed */
+
+ return ret_adapter;
+}
+
+/** Free memory allocated memory used by adapter collection.
+ * @param[in] adapter = First element in linked list of adapters
+ * EC_NOFRAME.
+ */
+void oshw_free_adapters(ec_adaptert * adapter)
+{
+ /* TODO if needed */
+}
