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 #include "xsdeviceid.h"
Alex Young 40:b77a8c10c76d 17
Alex Young 40:b77a8c10c76d 18 /*!
Alex Young 40:b77a8c10c76d 19 * \brief Return true if device ID corresponds to a MTi-1 series device.
Alex Young 40:b77a8c10c76d 20 */
Alex Young 40:b77a8c10c76d 21 bool XsDeviceId_isMtMk4_X(uint32_t deviceId)
Alex Young 40:b77a8c10c76d 22 {
Alex Young 40:b77a8c10c76d 23 uint8_t deviceSeries = (deviceId >> 20) & 0xF;
Alex Young 40:b77a8c10c76d 24 return ((deviceSeries == 0x8) || (deviceSeries == 0xC));
Alex Young 40:b77a8c10c76d 25 }
Alex Young 40:b77a8c10c76d 26
Alex Young 40:b77a8c10c76d 27 /*!
Alex Young 40:b77a8c10c76d 28 * \brief Get a string describing the function of the MTi device.
Alex Young 40:b77a8c10c76d 29 */
Alex Young 40:b77a8c10c76d 30 char const* XsDeviceId_functionDescription(enum DeviceFunction function)
Alex Young 40:b77a8c10c76d 31 {
Alex Young 40:b77a8c10c76d 32 switch (function)
Alex Young 40:b77a8c10c76d 33 {
Alex Young 40:b77a8c10c76d 34 case DF_IMU:
Alex Young 40:b77a8c10c76d 35 return "Inertial Measurement Unit";
Alex Young 40:b77a8c10c76d 36
Alex Young 40:b77a8c10c76d 37 case DF_VRU:
Alex Young 40:b77a8c10c76d 38 return "Vertical Reference Unit";
Alex Young 40:b77a8c10c76d 39
Alex Young 40:b77a8c10c76d 40 case DF_AHRS:
Alex Young 40:b77a8c10c76d 41 return "Attitude Heading Reference System";
Alex Young 40:b77a8c10c76d 42 }
Alex Young 40:b77a8c10c76d 43
Alex Young 40:b77a8c10c76d 44 return "Unknown device function";
Alex Young 40:b77a8c10c76d 45 }
Alex Young 40:b77a8c10c76d 46