Example of using Xbus library to communicate with an MTi-1 series device using a full-duplex UART connection.

Dependencies:   mbed-rtos mbed Xbus

Fork of MTi-1_example by Alex Young

Important Information

This example is deprecated and no longer maintained. There are new embedded examples available in the MT SDK folder of the MT Software Suite. For more information please visit: https://xsenstechnologies.force.com/knowledgebase/s/article/Introduction-to-the-MT-SDK-programming-examples-for-MTi-devices

Overview

The example program demonstrates connecting to an MTi-1 series device, restoring communications settings to default if necessary, and configuring the MTi to send data. For an MTi-1 the device is configured to send inertial sensor data, while MTi-2 and MTi-3 devices are configured to output orientation data using the onboard XKF3i filter.

Communication with the MTi-1 series device is implemented using a either a full-duplex UART, I2C or SPI bus. A reset line is used to reset the MTi during initialization. Data is output to a host PC terminal using a second UART.

For more information on the MTi-1 series communication protocol please refer to the datasheet: https://www.xsens.com/download/pdf/documentation/mti-1/mti-1-series_datasheet.pdf

Supported Platforms

The program has been tested on the following mbed platforms:

Using the Example

  1. To use the example program connect one of the supported mbed boards to the host PC and download the application from the mbed online compiler to the target device.
  2. With the mbed board unpowered (USB disconnected) wire the mbed board to the MTi-1 development board. The following connections are required:
    • In all cases:
      • 5V (or 3V3) main supply to VDD (P300-1)
      • MCU IO voltage (IORef) to VDDIO (P300-2)
      • GND to GND (P300-3)
      • MT_NRESET to nRST (P300-5)
    • For I2C communication:
      • MT_SCL to I2C_SCL (P300-9)
      • MT_SDA to I2C_SDA (P300-11)
      • MT_DRDY to DRDY (P300-15)
      • MT_ADD0 to ADD0 (P300-17)
      • MT_ADD1 to ADD1 (P300-19)
      • MT_ADD2 to ADD2 (P300-21)
    • For SPI communication:
      • MT_DRDY to DRDY (P300-15)
      • MT_SCLK to SPI_SCK (P300-17)
      • MT_MISO to SPI_MISO (P300-19)
      • MT_MOSI to SPI_MOSI (P300-21)
      • MT_nCS to SPI_nCS (P300-23)
    • For UART communication:
      • MT_RX to UART_TX (P300-9)
      • MT_TX to UART_RX (P300-11)

For more information on the MTi-1 development board please refer to the MTi-1 series user manual: https://www.xsens.com/download/pdf/documentation/mti-1/mti-1-series_dk_user_manual.pdf

Information

Check the defines at the top of main.cpp to determine which IO pins are used for the MT_xxx connections on each mbed platform.

Information

The active peripheral (I2C, SPI or UART) is selected on the MTi-1 development board through the PSEL0 and PSEL1 switches. Look on the bottom of the development board for the correct settings.

  1. Connect to the target using a serial terminal. The application is configured for:
    • Baudrate = 921600
    • Stop bits = 1
    • No parity bits
    • No flow control
  2. Reset the mbed board.
  3. You should be presented with a simple user interface as shown below:
MTi-1 series embedded example firmware.
Device ready for operation.
Found device with ID: 03880011.
Device is an MTi-3: Attitude Heading Reference System.
Output configuration set to:
        Packet counter: 65535 Hz
        Sample time fine: 65535 Hz
        Quaternion: 100 Hz
        Status word: 65535 Hz

Press 'm' to start measuring and 'c' to return to config mode.
Committer:
Alex Young
Date:
Fri Jun 12 13:23:26 2015 +0200
Revision:
61:b9d3e7e5ba0c
Parent:
49:38ecfbff5391
Change to Apache license

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Alex Young 3:abc451d82b88 1 /*!
Alex Young 3:abc451d82b88 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 3:abc451d82b88 8 *
Alex Young 61:b9d3e7e5ba0c 9 * http://www.apache.org/licenses/LICENSE-2.0
Alex Young 3:abc451d82b88 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 3:abc451d82b88 16 */
Alex Young 3:abc451d82b88 17
Alex Young 3:abc451d82b88 18 #include "xbusparser.h"
Alex Young 10:18a6661b7e59 19 #include "xbusdef.h"
Alex Young 19:46e88d37ecef 20 #include "xbusutility.h"
Alex Young 3:abc451d82b88 21 #include <stdlib.h>
Alex Young 19:46e88d37ecef 22 #include <string.h>
Alex Young 3:abc451d82b88 23
Alex Young 46:f652d199d27e 24 /*! \brief XbusParser states. */
Alex Young 3:abc451d82b88 25 enum XbusParserState
Alex Young 3:abc451d82b88 26 {
Alex Young 3:abc451d82b88 27 XBPS_Preamble, /*!< \brief Looking for preamble. */
Alex Young 3:abc451d82b88 28 XBPS_BusId, /*!< \brief Waiting for bus ID. */
Alex Young 3:abc451d82b88 29 XBPS_MessageId, /*!< \brief Waiting for message ID. */
Alex Young 3:abc451d82b88 30 XBPS_Length, /*!< \brief Waiting for length. */
Alex Young 3:abc451d82b88 31 XBPS_ExtendedLengthMsb, /*!< \brief Waiting for extended length MSB*/
Alex Young 3:abc451d82b88 32 XBPS_ExtendedLengthLsb, /*!< \brief Waiting for extended length LSB*/
Alex Young 3:abc451d82b88 33 XBPS_Payload, /*!< \brief Reading payload. */
Alex Young 3:abc451d82b88 34 XBPS_Checksum /*!< \brief Waiting for checksum. */
Alex Young 3:abc451d82b88 35 };
Alex Young 3:abc451d82b88 36
Alex Young 46:f652d199d27e 37 /*!
Alex Young 46:f652d199d27e 38 * \brief Xbus Parser state structure.
Alex Young 46:f652d199d27e 39 */
Alex Young 3:abc451d82b88 40 struct XbusParser
Alex Young 3:abc451d82b88 41 {
Alex Young 46:f652d199d27e 42 /*! \brief Callbacks for memory management, and message handling. */
Alex Young 3:abc451d82b88 43 struct XbusParserCallback callbacks;
Alex Young 46:f652d199d27e 44 /*! \brief Storage for the current message being received. */
Alex Young 14:155f9a55ec51 45 struct XbusMessage currentMessage;
Alex Young 46:f652d199d27e 46 /*! \brief The number of bytes of payload received for the current message. */
Alex Young 3:abc451d82b88 47 uint16_t payloadReceived;
Alex Young 46:f652d199d27e 48 /*! \brief The calculated checksum for the current message. */
Alex Young 3:abc451d82b88 49 uint8_t checksum;
Alex Young 46:f652d199d27e 50 /*! \brief The state of the parser. */
Alex Young 3:abc451d82b88 51 enum XbusParserState state;
Alex Young 3:abc451d82b88 52 };
Alex Young 3:abc451d82b88 53
Alex Young 46:f652d199d27e 54 /*!
Alex Young 46:f652d199d27e 55 * \brief Get the amount of memory needed for the XbusParser structure.
Alex Young 46:f652d199d27e 56 */
Alex Young 3:abc451d82b88 57 size_t XbusParser_mem(void)
Alex Young 3:abc451d82b88 58 {
Alex Young 3:abc451d82b88 59 return sizeof(struct XbusParser);
Alex Young 3:abc451d82b88 60 }
Alex Young 3:abc451d82b88 61
Alex Young 46:f652d199d27e 62 /*!
Alex Young 46:f652d199d27e 63 * \brief Create a new XbusParser object.
Alex Young 46:f652d199d27e 64 * \param callback Pointer to callback structure containing callback functions
Alex Young 46:f652d199d27e 65 * for memory management and handling received messages.
Alex Young 46:f652d199d27e 66 * \returns Pointer the new XbusParser structure.
Alex Young 46:f652d199d27e 67 *
Alex Young 46:f652d199d27e 68 * Uses malloc to allocate the memory required for the parser.
Alex Young 46:f652d199d27e 69 */
Alex Young 3:abc451d82b88 70 struct XbusParser* XbusParser_create(struct XbusParserCallback const* callback)
Alex Young 3:abc451d82b88 71 {
Alex Young 3:abc451d82b88 72 void* mem = malloc(XbusParser_mem());
Alex Young 3:abc451d82b88 73 if (mem)
Alex Young 3:abc451d82b88 74 {
Alex Young 3:abc451d82b88 75 return XbusParser_init(mem, callback);
Alex Young 3:abc451d82b88 76 }
Alex Young 3:abc451d82b88 77 return NULL;
Alex Young 3:abc451d82b88 78 }
Alex Young 3:abc451d82b88 79
Alex Young 46:f652d199d27e 80 /*!
Alex Young 46:f652d199d27e 81 * \brief Frees an XbusParser structure allocated by XbusParser_create().
Alex Young 46:f652d199d27e 82 */
Alex Young 3:abc451d82b88 83 void XbusParser_destroy(struct XbusParser* parser)
Alex Young 3:abc451d82b88 84 {
Alex Young 3:abc451d82b88 85 free(parser);
Alex Young 3:abc451d82b88 86 }
Alex Young 3:abc451d82b88 87
Alex Young 46:f652d199d27e 88 /*!
Alex Young 46:f652d199d27e 89 * \brief Initializes an XbusParser in the passed memory location.
Alex Young 46:f652d199d27e 90 * \param parserMem Pointer to memory to use for storing parser state. Should
Alex Young 46:f652d199d27e 91 * be at least as big as the value returned by XbusParser_mem().
Alex Young 46:f652d199d27e 92 * \param callback Pointer to callback structure containing callback functions
Alex Young 46:f652d199d27e 93 * for memory management and handling received messages.
Alex Young 46:f652d199d27e 94 * \returns Initialized XbusParser structure.
Alex Young 46:f652d199d27e 95 */
Alex Young 3:abc451d82b88 96 struct XbusParser* XbusParser_init(void* parserMem, struct XbusParserCallback const* callback)
Alex Young 3:abc451d82b88 97 {
Alex Young 3:abc451d82b88 98 struct XbusParser* parser = (struct XbusParser*)parserMem;
Alex Young 3:abc451d82b88 99 parser->state = XBPS_Preamble;
Alex Young 3:abc451d82b88 100 parser->callbacks.allocateBuffer = callback->allocateBuffer;
Alex Young 25:01356fb59467 101 parser->callbacks.deallocateBuffer = callback->deallocateBuffer;
Alex Young 3:abc451d82b88 102 parser->callbacks.handleMessage = callback->handleMessage;
Alex Young 3:abc451d82b88 103 return parser;
Alex Young 3:abc451d82b88 104 }
Alex Young 3:abc451d82b88 105
Alex Young 46:f652d199d27e 106 /*!
Alex Young 49:38ecfbff5391 107 * \brief Parse an XMID_DeviceId message to extract the device ID value.
Alex Young 46:f652d199d27e 108
Alex Young 46:f652d199d27e 109 * Replaces the raw Xbus message data with the device ID.
Alex Young 46:f652d199d27e 110 */
Alex Young 25:01356fb59467 111 static void parseDeviceId(struct XbusParser* parser, uint8_t const* rawData)
Alex Young 23:8171449f0dc3 112 {
Alex Young 23:8171449f0dc3 113 uint32_t* deviceId = parser->callbacks.allocateBuffer(sizeof(uint32_t));
Alex Young 23:8171449f0dc3 114 if (deviceId)
Alex Young 23:8171449f0dc3 115 {
Alex Young 25:01356fb59467 116 XbusUtility_readU32(deviceId, rawData);
Alex Young 23:8171449f0dc3 117 parser->currentMessage.data = deviceId;
Alex Young 23:8171449f0dc3 118 parser->currentMessage.length = 1;
Alex Young 23:8171449f0dc3 119 }
Alex Young 23:8171449f0dc3 120 else
Alex Young 23:8171449f0dc3 121 {
Alex Young 23:8171449f0dc3 122 parser->currentMessage.data = NULL;
Alex Young 23:8171449f0dc3 123 }
Alex Young 23:8171449f0dc3 124 }
Alex Young 23:8171449f0dc3 125
Alex Young 46:f652d199d27e 126 /*!
Alex Young 49:38ecfbff5391 127 * \brief Parse an XMID_OutputConfig message.
Alex Young 46:f652d199d27e 128 *
Alex Young 46:f652d199d27e 129 * Replaces the raw Xbus message data with an array of OutputConfiguration
Alex Young 46:f652d199d27e 130 * structures.
Alex Young 46:f652d199d27e 131 */
Alex Young 25:01356fb59467 132 static void parseOutputConfig(struct XbusParser* parser, uint8_t const* rawData)
Alex Young 23:8171449f0dc3 133 {
Alex Young 23:8171449f0dc3 134 uint8_t fields = parser->currentMessage.length / 4;
Alex Young 23:8171449f0dc3 135 struct OutputConfiguration* conf = parser->callbacks.allocateBuffer(fields * sizeof(struct OutputConfiguration));
Alex Young 23:8171449f0dc3 136 if (conf)
Alex Young 23:8171449f0dc3 137 {
Alex Young 23:8171449f0dc3 138 parser->currentMessage.data = conf;
Alex Young 23:8171449f0dc3 139 parser->currentMessage.length = fields;
Alex Young 23:8171449f0dc3 140
Alex Young 23:8171449f0dc3 141 for (int i = 0; i < fields; ++i)
Alex Young 23:8171449f0dc3 142 {
Alex Young 25:01356fb59467 143 rawData = XbusUtility_readU16((uint16_t*)&conf->dtype, rawData);
Alex Young 25:01356fb59467 144 rawData = XbusUtility_readU16(&conf->freq, rawData);
Alex Young 23:8171449f0dc3 145 ++conf;
Alex Young 23:8171449f0dc3 146 }
Alex Young 23:8171449f0dc3 147 }
Alex Young 23:8171449f0dc3 148 else
Alex Young 23:8171449f0dc3 149 {
Alex Young 23:8171449f0dc3 150 parser->currentMessage.data = NULL;
Alex Young 23:8171449f0dc3 151 }
Alex Young 23:8171449f0dc3 152 }
Alex Young 23:8171449f0dc3 153
Alex Young 46:f652d199d27e 154 /*!
Alex Young 46:f652d199d27e 155 * \brief Converts raw Xbus payload data to native structures if possible.
Alex Young 46:f652d199d27e 156 *
Alex Young 46:f652d199d27e 157 * Raw data payloads are converted to native data structures and the
Alex Young 46:f652d199d27e 158 * message data pointer is changed to point to the native structure.
Alex Young 46:f652d199d27e 159 * The raw data is automatically deallocated.
Alex Young 46:f652d199d27e 160 */
Alex Young 19:46e88d37ecef 161 static void parseMessagePayload(struct XbusParser* parser)
Alex Young 3:abc451d82b88 162 {
Alex Young 25:01356fb59467 163 uint8_t const* const rawData = parser->currentMessage.data;
Alex Young 19:46e88d37ecef 164 switch (parser->currentMessage.mid)
Alex Young 19:46e88d37ecef 165 {
Alex Young 25:01356fb59467 166 default:
Alex Young 25:01356fb59467 167 // Leave parsing and memory management to user code
Alex Young 25:01356fb59467 168 return;
Alex Young 25:01356fb59467 169
Alex Young 19:46e88d37ecef 170 case XMID_DeviceId:
Alex Young 25:01356fb59467 171 parseDeviceId(parser, rawData);
Alex Young 19:46e88d37ecef 172 break;
Alex Young 19:46e88d37ecef 173
Alex Young 22:3eab999c5076 174 case XMID_OutputConfig:
Alex Young 25:01356fb59467 175 parseOutputConfig(parser, rawData);
Alex Young 19:46e88d37ecef 176 break;
Alex Young 19:46e88d37ecef 177 }
Alex Young 25:01356fb59467 178
Alex Young 25:01356fb59467 179 if (rawData)
Alex Young 25:01356fb59467 180 parser->callbacks.deallocateBuffer(rawData);
Alex Young 19:46e88d37ecef 181 }
Alex Young 19:46e88d37ecef 182
Alex Young 46:f652d199d27e 183 /*!
Alex Young 46:f652d199d27e 184 * \brief Prepare for receiving a message payload.
Alex Young 46:f652d199d27e 185 *
Alex Young 46:f652d199d27e 186 * Requests a memory area to store the received data to using the
Alex Young 46:f652d199d27e 187 * registered callbacks.
Alex Young 46:f652d199d27e 188 */
Alex Young 19:46e88d37ecef 189 void prepareForPayload(struct XbusParser* parser)
Alex Young 19:46e88d37ecef 190 {
Alex Young 3:abc451d82b88 191 parser->payloadReceived = 0;
Alex Young 25:01356fb59467 192 parser->currentMessage.data = parser->callbacks.allocateBuffer(parser->currentMessage.length);
Alex Young 3:abc451d82b88 193 }
Alex Young 3:abc451d82b88 194
Alex Young 46:f652d199d27e 195 /*!
Alex Young 46:f652d199d27e 196 * \brief Parse a byte of data from a motion tracker.
Alex Young 46:f652d199d27e 197 *
Alex Young 46:f652d199d27e 198 * When a complete message is received the user will be notified by a call
Alex Young 46:f652d199d27e 199 * to the handleMessage() callback function.
Alex Young 46:f652d199d27e 200 */
Alex Young 3:abc451d82b88 201 void XbusParser_parseByte(struct XbusParser* parser, const uint8_t byte)
Alex Young 3:abc451d82b88 202 {
Alex Young 3:abc451d82b88 203 switch (parser->state)
Alex Young 3:abc451d82b88 204 {
Alex Young 3:abc451d82b88 205 case XBPS_Preamble:
Alex Young 3:abc451d82b88 206 if (byte == XBUS_PREAMBLE)
Alex Young 3:abc451d82b88 207 {
Alex Young 3:abc451d82b88 208 parser->checksum = 0;
Alex Young 3:abc451d82b88 209 parser->state = XBPS_BusId;
Alex Young 3:abc451d82b88 210 }
Alex Young 3:abc451d82b88 211 break;
Alex Young 3:abc451d82b88 212
Alex Young 3:abc451d82b88 213 case XBPS_BusId:
Alex Young 3:abc451d82b88 214 parser->checksum += byte;
Alex Young 3:abc451d82b88 215 parser->state = XBPS_MessageId;
Alex Young 3:abc451d82b88 216 break;
Alex Young 3:abc451d82b88 217
Alex Young 3:abc451d82b88 218 case XBPS_MessageId:
Alex Young 3:abc451d82b88 219 parser->checksum += byte;
Alex Young 14:155f9a55ec51 220 parser->currentMessage.mid = (enum XsMessageId)byte;
Alex Young 3:abc451d82b88 221 parser->state = XBPS_Length;
Alex Young 3:abc451d82b88 222 break;
Alex Young 3:abc451d82b88 223
Alex Young 3:abc451d82b88 224 case XBPS_Length:
Alex Young 3:abc451d82b88 225 parser->checksum += byte;
Alex Young 3:abc451d82b88 226 if (byte == XBUS_NO_PAYLOAD)
Alex Young 3:abc451d82b88 227 {
Alex Young 14:155f9a55ec51 228 parser->currentMessage.length = byte;
Alex Young 17:680f28e00d17 229 parser->currentMessage.data = NULL;
Alex Young 3:abc451d82b88 230 parser->state = XBPS_Checksum;
Alex Young 3:abc451d82b88 231 }
Alex Young 3:abc451d82b88 232 else if (byte < XBUS_EXTENDED_LENGTH)
Alex Young 3:abc451d82b88 233 {
Alex Young 14:155f9a55ec51 234 parser->currentMessage.length = byte;
Alex Young 3:abc451d82b88 235 prepareForPayload(parser);
Alex Young 3:abc451d82b88 236 parser->state = XBPS_Payload;
Alex Young 3:abc451d82b88 237 }
Alex Young 3:abc451d82b88 238 else
Alex Young 3:abc451d82b88 239 {
Alex Young 3:abc451d82b88 240 parser->state = XBPS_ExtendedLengthMsb;
Alex Young 3:abc451d82b88 241 }
Alex Young 3:abc451d82b88 242 break;
Alex Young 3:abc451d82b88 243
Alex Young 3:abc451d82b88 244 case XBPS_ExtendedLengthMsb:
Alex Young 3:abc451d82b88 245 parser->checksum += byte;
Alex Young 14:155f9a55ec51 246 parser->currentMessage.length = ((uint16_t)byte) << 8;
Alex Young 3:abc451d82b88 247 parser->state = XBPS_ExtendedLengthLsb;
Alex Young 3:abc451d82b88 248 break;
Alex Young 3:abc451d82b88 249
Alex Young 3:abc451d82b88 250 case XBPS_ExtendedLengthLsb:
Alex Young 3:abc451d82b88 251 parser->checksum += byte;
Alex Young 14:155f9a55ec51 252 parser->currentMessage.length |= byte;
Alex Young 3:abc451d82b88 253 prepareForPayload(parser);
Alex Young 3:abc451d82b88 254 parser->state = XBPS_Payload;
Alex Young 3:abc451d82b88 255 break;
Alex Young 3:abc451d82b88 256
Alex Young 3:abc451d82b88 257 case XBPS_Payload:
Alex Young 3:abc451d82b88 258 parser->checksum += byte;
Alex Young 14:155f9a55ec51 259 if (parser->currentMessage.data)
Alex Young 3:abc451d82b88 260 {
Alex Young 19:46e88d37ecef 261 ((uint8_t*)parser->currentMessage.data)[parser->payloadReceived] = byte;
Alex Young 3:abc451d82b88 262 }
Alex Young 14:155f9a55ec51 263 if (++parser->payloadReceived == parser->currentMessage.length)
Alex Young 3:abc451d82b88 264 {
Alex Young 3:abc451d82b88 265 parser->state = XBPS_Checksum;
Alex Young 3:abc451d82b88 266 }
Alex Young 3:abc451d82b88 267 break;
Alex Young 3:abc451d82b88 268
Alex Young 3:abc451d82b88 269 case XBPS_Checksum:
Alex Young 3:abc451d82b88 270 parser->checksum += byte;
Alex Young 17:680f28e00d17 271 if ((parser->checksum == 0) &&
Alex Young 17:680f28e00d17 272 ((parser->currentMessage.length == 0) ||
Alex Young 17:680f28e00d17 273 parser->currentMessage.data))
Alex Young 3:abc451d82b88 274 {
Alex Young 19:46e88d37ecef 275 parseMessagePayload(parser);
Alex Young 14:155f9a55ec51 276 parser->callbacks.handleMessage(&parser->currentMessage);
Alex Young 3:abc451d82b88 277 }
Alex Young 25:01356fb59467 278 else if (parser->currentMessage.data)
Alex Young 25:01356fb59467 279 {
Alex Young 25:01356fb59467 280 parser->callbacks.deallocateBuffer(parser->currentMessage.data);
Alex Young 25:01356fb59467 281 }
Alex Young 3:abc451d82b88 282 parser->state = XBPS_Preamble;
Alex Young 3:abc451d82b88 283 break;
Alex Young 3:abc451d82b88 284 }
Alex Young 3:abc451d82b88 285 }
Alex Young 3:abc451d82b88 286
Alex Young 46:f652d199d27e 287 /*!
Alex Young 46:f652d199d27e 288 * \brief Parse a buffer of data received from a motion tracker.
Alex Young 46:f652d199d27e 289 */
Alex Young 3:abc451d82b88 290 void XbusParser_parseBuffer(struct XbusParser* parser, uint8_t const* buf, size_t bufSize)
Alex Young 3:abc451d82b88 291 {
Alex Young 3:abc451d82b88 292 for (size_t i = 0; i < bufSize; ++i)
Alex Young 3:abc451d82b88 293 {
Alex Young 3:abc451d82b88 294 XbusParser_parseByte(parser, buf[i]);
Alex Young 3:abc451d82b88 295 }
Alex Young 3:abc451d82b88 296 }
Alex Young 3:abc451d82b88 297