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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers xsdeviceid.h Source File

xsdeviceid.h

Go to the documentation of this file.
00001 /*!
00002  * \file
00003  * \copyright Copyright (C) Xsens Technologies B.V., 2015.
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
00006  * use this file except in compliance with the License. You may obtain a copy
00007  * of the License at
00008  *
00009  * http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00013  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
00014  * License for the specific language governing permissions and limitations
00015  * under the License.
00016  */
00017 
00018 #ifndef __XSDEVICEID_H
00019 #define __XSDEVICEID_H
00020 
00021 #include <stdint.h>
00022 #include <stdbool.h>
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 bool XsDeviceId_isMtMk4_X(uint32_t deviceId);
00029 
00030 enum DeviceFunction 
00031 {
00032     /*! \brief Inertial Measurement Unit. */
00033     DF_IMU  = 1,
00034     /*! \brief Vertical Reference Unit. */
00035     DF_VRU  = 2,
00036     /*! \brief Attitude Heading Reference System. */
00037     DF_AHRS = 3
00038 };
00039 
00040 /*!
00041  * \brief Get the function of the MTi device.
00042  */
00043 static inline enum DeviceFunction  XsDeviceId_getFunction(uint32_t deviceId)
00044 {
00045     return (enum DeviceFunction )((deviceId >> 24) & 0xF);
00046 }
00047 
00048 char const* XsDeviceId_functionDescription(enum DeviceFunction  function);
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif // extern "C"
00053 
00054 #endif // __XSDEVICEID_H