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.

Committer:
tjerkhofmeijer
Date:
Fri Oct 02 16:22:33 2015 +0200
Revision:
1:c24f69a2eff4
Parent:
0:eb25b1785ee4
Xbus library is updated to support MTi 1-series' I2C and SPI interfaces

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tjerkhofmeijer 1:c24f69a2eff4 1 /*!
tjerkhofmeijer 1:c24f69a2eff4 2 * \file
tjerkhofmeijer 1:c24f69a2eff4 3 * \copyright Copyright (C) Xsens Technologies B.V., 2015.
tjerkhofmeijer 1:c24f69a2eff4 4 *
tjerkhofmeijer 1:c24f69a2eff4 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
tjerkhofmeijer 1:c24f69a2eff4 6 * use this file except in compliance with the License. You may obtain a copy
tjerkhofmeijer 1:c24f69a2eff4 7 * of the License at
tjerkhofmeijer 1:c24f69a2eff4 8 *
tjerkhofmeijer 1:c24f69a2eff4 9 * http://www.apache.org/licenses/LICENSE-2.0
tjerkhofmeijer 1:c24f69a2eff4 10 *
tjerkhofmeijer 1:c24f69a2eff4 11 * Unless required by applicable law or agreed to in writing, software
tjerkhofmeijer 1:c24f69a2eff4 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
tjerkhofmeijer 1:c24f69a2eff4 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
tjerkhofmeijer 1:c24f69a2eff4 14 * License for the specific language governing permissions and limitations
tjerkhofmeijer 1:c24f69a2eff4 15 * under the License.
tjerkhofmeijer 1:c24f69a2eff4 16 */
tjerkhofmeijer 1:c24f69a2eff4 17
tjerkhofmeijer 1:c24f69a2eff4 18 #ifndef __XBUSDEF_H
tjerkhofmeijer 1:c24f69a2eff4 19 #define __XBUSDEF_H
tjerkhofmeijer 1:c24f69a2eff4 20
tjerkhofmeijer 1:c24f69a2eff4 21 /*! \brief Xbus message preamble byte. */
tjerkhofmeijer 1:c24f69a2eff4 22 #define XBUS_PREAMBLE (0xFA)
tjerkhofmeijer 1:c24f69a2eff4 23 /*! \brief Xbus message bus ID for master devices. */
tjerkhofmeijer 1:c24f69a2eff4 24 #define XBUS_MASTERDEVICE (0xFF)
tjerkhofmeijer 1:c24f69a2eff4 25 /*! \brief Xbus length byte for messages without payload. */
tjerkhofmeijer 1:c24f69a2eff4 26 #define XBUS_NO_PAYLOAD (0x00)
tjerkhofmeijer 1:c24f69a2eff4 27 /*! \brief Xbus length byte for message with an extended payload. */
tjerkhofmeijer 1:c24f69a2eff4 28 #define XBUS_EXTENDED_LENGTH (0xFF)
tjerkhofmeijer 1:c24f69a2eff4 29
tjerkhofmeijer 1:c24f69a2eff4 30 /*! \brief Opcode to write to control pipe in I2C/SPI mode */
tjerkhofmeijer 1:c24f69a2eff4 31 #define XBUS_CONTROL_PIPE (0x03)
tjerkhofmeijer 1:c24f69a2eff4 32 #define XBUS_PIPE_STATUS (0x04)
tjerkhofmeijer 1:c24f69a2eff4 33 #define XBUS_NOTIFICATION_PIPE (0x05)
tjerkhofmeijer 1:c24f69a2eff4 34 #define XBUS_MEASUREMENT_PIPE (0x06)
tjerkhofmeijer 1:c24f69a2eff4 35
tjerkhofmeijer 1:c24f69a2eff4 36 #endif // __XBUSDEF_H