Example for updating the MTi-1's firmware. Uses a platform independent, retargetable pure C implementation of the firmware updater protocol.

Dependencies:   mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mtssp_i2c_driver.h Source File

mtssp_i2c_driver.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 #ifndef MTSSP_I2C_DRIVER_H
00018 #define MTSSP_I2C_DRIVER_H
00019 
00020 #include "mtinterface_mtssp.h "
00021 
00022 class MtsspI2cDriver : public MtsspDriver
00023 {
00024 public:
00025     MtsspI2cDriver();
00026     virtual ~MtsspI2cDriver();
00027 
00028     virtual void write(uint8_t opcode, uint8_t const* data, int dataLength);
00029     virtual void read(uint8_t opcode, uint8_t* dest, int destMax);
00030     virtual void writeRaw(uint8_t const* data, int dataLength);
00031 
00032     virtual XbusBusFormat busFormat() const { return XBF_I2c; }
00033 
00034 private:
00035     I2C* m_i2c;
00036     BusOut* m_slaveAddress; 
00037 };
00038 
00039 
00040 #endif //MTSSP_I2C_DRIVER_H