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_spi_driver.h Source File

mtssp_spi_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_SPI_H
00018 #define MTSSP_SPI_H
00019 
00020 #include "mtinterface_mtssp.h "
00021 
00022 class MtsspSpiDriver : public MtsspDriver
00023 {
00024 public:
00025     MtsspSpiDriver();
00026     virtual ~MtsspSpiDriver();
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_Spi; }
00033 
00034 private:
00035     SPI* m_spi;
00036     DigitalOut *m_chipSelect;
00037 };
00038 
00039 
00040 #endif //MTSSP_SPI_H