Xsens / Mbed 2 deprecated MTi-1_example

Dependencies:   mbed-rtos mbed Xbus

Fork of MTi-1_example by Alex Young

Committer:
Alex Young
Date:
Thu May 21 14:36:52 2015 +0200
Revision:
40:b77a8c10c76d
Child:
61:b9d3e7e5ba0c
Add utility module for processing device ids

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Alex Young 40:b77a8c10c76d 1 /*!
Alex Young 40:b77a8c10c76d 2 * \file
Alex Young 40:b77a8c10c76d 3 * \copyright
Alex Young 40:b77a8c10c76d 4 * Copyright (C) Xsens Technologies B.V., 2015. All rights reserved.
Alex Young 40:b77a8c10c76d 5 *
Alex Young 40:b77a8c10c76d 6 * This source code is intended for use only by Xsens Technologies BV and
Alex Young 40:b77a8c10c76d 7 * those that have explicit written permission to use it from
Alex Young 40:b77a8c10c76d 8 * Xsens Technologies BV.
Alex Young 40:b77a8c10c76d 9 *
Alex Young 40:b77a8c10c76d 10 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
Alex Young 40:b77a8c10c76d 11 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
Alex Young 40:b77a8c10c76d 12 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
Alex Young 40:b77a8c10c76d 13 * PARTICULAR PURPOSE.
Alex Young 40:b77a8c10c76d 14 */
Alex Young 40:b77a8c10c76d 15
Alex Young 40:b77a8c10c76d 16 #ifndef __XSDEVICEID_H
Alex Young 40:b77a8c10c76d 17 #define __XSDEVICEID_H
Alex Young 40:b77a8c10c76d 18
Alex Young 40:b77a8c10c76d 19 #include <stdint.h>
Alex Young 40:b77a8c10c76d 20 #include <stdbool.h>
Alex Young 40:b77a8c10c76d 21
Alex Young 40:b77a8c10c76d 22 #ifdef __cplusplus
Alex Young 40:b77a8c10c76d 23 extern "C" {
Alex Young 40:b77a8c10c76d 24 #endif
Alex Young 40:b77a8c10c76d 25
Alex Young 40:b77a8c10c76d 26 bool XsDeviceId_isMtMk4_X(uint32_t deviceId);
Alex Young 40:b77a8c10c76d 27
Alex Young 40:b77a8c10c76d 28 enum DeviceFunction
Alex Young 40:b77a8c10c76d 29 {
Alex Young 40:b77a8c10c76d 30 /*! \brief Inertial Measurement Unit. */
Alex Young 40:b77a8c10c76d 31 DF_IMU = 1,
Alex Young 40:b77a8c10c76d 32 /*! \brief Vertical Reference Unit. */
Alex Young 40:b77a8c10c76d 33 DF_VRU = 2,
Alex Young 40:b77a8c10c76d 34 /*! \brief Attitude Heading Reference System. */
Alex Young 40:b77a8c10c76d 35 DF_AHRS = 3
Alex Young 40:b77a8c10c76d 36 };
Alex Young 40:b77a8c10c76d 37
Alex Young 40:b77a8c10c76d 38 /*!
Alex Young 40:b77a8c10c76d 39 * \brief Get the function of the MTi device.
Alex Young 40:b77a8c10c76d 40 */
Alex Young 40:b77a8c10c76d 41 static inline enum DeviceFunction XsDeviceId_getFunction(uint32_t deviceId)
Alex Young 40:b77a8c10c76d 42 {
Alex Young 40:b77a8c10c76d 43 return (enum DeviceFunction)((deviceId >> 24) & 0xF);
Alex Young 40:b77a8c10c76d 44 }
Alex Young 40:b77a8c10c76d 45
Alex Young 40:b77a8c10c76d 46 char const* XsDeviceId_functionDescription(enum DeviceFunction function);
Alex Young 40:b77a8c10c76d 47
Alex Young 40:b77a8c10c76d 48 #ifdef __cplusplus
Alex Young 40:b77a8c10c76d 49 }
Alex Young 40:b77a8c10c76d 50 #endif // extern "C"
Alex Young 40:b77a8c10c76d 51
Alex Young 40:b77a8c10c76d 52 #endif // __XSDEVICEID_H