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

MtsspSpiDriver Class Reference

MtsspSpiDriver Class Reference

Implementation of MtsspDriver for communicating over SPI. More...

Inherits MtsspDriver.

Public Member Functions

 MtsspSpiDriver ()
 Constructor.
virtual ~MtsspSpiDriver ()
 Destructor.
virtual void write (uint8_t opcode, uint8_t const *data, int dataLength)
 Perform a blocking write transfer over SPI.
virtual void read (uint8_t opcode, uint8_t *dest, int destMax)
 Perform a blocking read transfer over SPI.
virtual void writeRaw (uint8_t const *data, int dataLength)
 Perform a blocking write transfer over SPI.
virtual XbusBusFormat busFormat () const
 Returns the low level bus format that must be used for tranmitting messages over this hardware bus.

Detailed Description

Implementation of MtsspDriver for communicating over SPI.

The low level SPI driver is provided by the mbed platform.

Definition at line 22 of file mtssp_spi_driver.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 31 of file mtssp_spi_driver.cpp.

~MtsspSpiDriver (  ) [virtual]

Destructor.

Definition at line 45 of file mtssp_spi_driver.cpp.


Member Function Documentation

virtual XbusBusFormat busFormat (  ) const [virtual]

Returns the low level bus format that must be used for tranmitting messages over this hardware bus.

Implements MtsspDriver.

Definition at line 32 of file mtssp_spi_driver.h.

void read ( uint8_t  opcode,
uint8_t *  data,
int  dataLength 
) [virtual]

Perform a blocking read transfer over SPI.

Parameters:
opcodeOpcode to use
dataPointer to result buffer
dataLengthNumber of data bytes to read

Implements MtsspDriver.

Definition at line 79 of file mtssp_spi_driver.cpp.

void write ( uint8_t  opcode,
uint8_t const *  data,
int  dataLength 
) [virtual]

Perform a blocking write transfer over SPI.

Parameters:
opcodeOpcode to use
dataPointer to data to be written
dataLengthNumber of data bytes to write

Implements MtsspDriver.

Definition at line 57 of file mtssp_spi_driver.cpp.

void writeRaw ( uint8_t const *  data,
int  dataLength 
) [virtual]

Perform a blocking write transfer over SPI.

Parameters:
dataPointer to data to be written
dataLengthNumber of data bytes to write

Implements MtsspDriver.

Definition at line 100 of file mtssp_spi_driver.cpp.