Basic implementation of Xbus message parsing and generation for embedded processors. The code has no dependencies and should also work for other MCU architectures than ARM provided a C99 compiler is available.

Dependents:   MTi-1_example_LPC1768 MTi-1_rikbeun MTi-1_example MTi-1_example

For an example of using the Xbus library to communicate with an MTi-1 series device using a full-duplex UART see:

Import programMTi-1_example

Example of using Xbus library to communicate with an MTi-1 series device using a full-duplex UART connection.

Revision:
0:eb25b1785ee4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xsdeviceid.h	Tue Jun 16 07:54:23 2015 +0000
@@ -0,0 +1,54 @@
+/*!
+ * \file
+ * \copyright Copyright (C) Xsens Technologies B.V., 2015.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef __XSDEVICEID_H
+#define __XSDEVICEID_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+bool XsDeviceId_isMtMk4_X(uint32_t deviceId);
+
+enum DeviceFunction
+{
+	/*! \brief Inertial Measurement Unit. */
+	DF_IMU  = 1,
+	/*! \brief Vertical Reference Unit. */
+	DF_VRU  = 2,
+	/*! \brief Attitude Heading Reference System. */
+	DF_AHRS = 3
+};
+
+/*!
+ * \brief Get the function of the MTi device.
+ */
+static inline enum DeviceFunction XsDeviceId_getFunction(uint32_t deviceId)
+{
+	return (enum DeviceFunction)((deviceId >> 24) & 0xF);
+}
+
+char const* XsDeviceId_functionDescription(enum DeviceFunction function);
+
+#ifdef __cplusplus
+}
+#endif // extern "C"
+
+#endif // __XSDEVICEID_H