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: mbed-rtos mbed Xbus
Fork of MTi-1_example by
xbus/xsdeviceid.c@61:b9d3e7e5ba0c, 2015-06-12 (annotated)
- Committer:
- Alex Young
- Date:
- Fri Jun 12 13:23:26 2015 +0200
- Revision:
- 61:b9d3e7e5ba0c
- Parent:
- 40:b77a8c10c76d
Change to Apache license
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Alex Young |
40:b77a8c10c76d | 1 | /*! |
| Alex Young |
40:b77a8c10c76d | 2 | * \file |
| Alex Young |
61:b9d3e7e5ba0c | 3 | * \copyright Copyright (C) Xsens Technologies B.V., 2015. |
| Alex Young |
61:b9d3e7e5ba0c | 4 | * |
| Alex Young |
61:b9d3e7e5ba0c | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| Alex Young |
61:b9d3e7e5ba0c | 6 | * use this file except in compliance with the License. You may obtain a copy |
| Alex Young |
61:b9d3e7e5ba0c | 7 | * of the License at |
| Alex Young |
40:b77a8c10c76d | 8 | * |
| Alex Young |
61:b9d3e7e5ba0c | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| Alex Young |
40:b77a8c10c76d | 10 | * |
| Alex Young |
61:b9d3e7e5ba0c | 11 | * Unless required by applicable law or agreed to in writing, software |
| Alex Young |
61:b9d3e7e5ba0c | 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| Alex Young |
61:b9d3e7e5ba0c | 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| Alex Young |
61:b9d3e7e5ba0c | 14 | * License for the specific language governing permissions and limitations |
| Alex Young |
61:b9d3e7e5ba0c | 15 | * under the License. |
| Alex Young |
40:b77a8c10c76d | 16 | */ |
| Alex Young |
40:b77a8c10c76d | 17 | |
| Alex Young |
40:b77a8c10c76d | 18 | #include "xsdeviceid.h" |
| Alex Young |
40:b77a8c10c76d | 19 | |
| Alex Young |
40:b77a8c10c76d | 20 | /*! |
| Alex Young |
40:b77a8c10c76d | 21 | * \brief Return true if device ID corresponds to a MTi-1 series device. |
| Alex Young |
40:b77a8c10c76d | 22 | */ |
| Alex Young |
40:b77a8c10c76d | 23 | bool XsDeviceId_isMtMk4_X(uint32_t deviceId) |
| Alex Young |
40:b77a8c10c76d | 24 | { |
| Alex Young |
40:b77a8c10c76d | 25 | uint8_t deviceSeries = (deviceId >> 20) & 0xF; |
| Alex Young |
40:b77a8c10c76d | 26 | return ((deviceSeries == 0x8) || (deviceSeries == 0xC)); |
| Alex Young |
40:b77a8c10c76d | 27 | } |
| Alex Young |
40:b77a8c10c76d | 28 | |
| Alex Young |
40:b77a8c10c76d | 29 | /*! |
| Alex Young |
40:b77a8c10c76d | 30 | * \brief Get a string describing the function of the MTi device. |
| Alex Young |
40:b77a8c10c76d | 31 | */ |
| Alex Young |
40:b77a8c10c76d | 32 | char const* XsDeviceId_functionDescription(enum DeviceFunction function) |
| Alex Young |
40:b77a8c10c76d | 33 | { |
| Alex Young |
40:b77a8c10c76d | 34 | switch (function) |
| Alex Young |
40:b77a8c10c76d | 35 | { |
| Alex Young |
40:b77a8c10c76d | 36 | case DF_IMU: |
| Alex Young |
40:b77a8c10c76d | 37 | return "Inertial Measurement Unit"; |
| Alex Young |
40:b77a8c10c76d | 38 | |
| Alex Young |
40:b77a8c10c76d | 39 | case DF_VRU: |
| Alex Young |
40:b77a8c10c76d | 40 | return "Vertical Reference Unit"; |
| Alex Young |
40:b77a8c10c76d | 41 | |
| Alex Young |
40:b77a8c10c76d | 42 | case DF_AHRS: |
| Alex Young |
40:b77a8c10c76d | 43 | return "Attitude Heading Reference System"; |
| Alex Young |
40:b77a8c10c76d | 44 | } |
| Alex Young |
40:b77a8c10c76d | 45 | |
| Alex Young |
40:b77a8c10c76d | 46 | return "Unknown device function"; |
| Alex Young |
40:b77a8c10c76d | 47 | } |
| Alex Young |
40:b77a8c10c76d | 48 |

Xsens MTi 1-series