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

MtsspI2cDriver Class Reference

MtsspI2cDriver Class Reference

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

Inherits MtsspDriver.

Public Member Functions

 MtsspI2cDriver ()
 Constructor.
virtual ~MtsspI2cDriver ()
 Destructor.
virtual void write (uint8_t opcode, uint8_t const *data, int dataLength)
 Perform a blocking write transfer over I2C.
virtual void read (uint8_t opcode, uint8_t *dest, int destMax)
 Perform a blocking read transfer over I2C.
virtual void writeRaw (uint8_t const *data, int dataLength)
 Perform a blocking write transfer over I2C.
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 I2C.

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

Definition at line 22 of file mtssp_i2c_driver.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 35 of file mtssp_i2c_driver.cpp.

~MtsspI2cDriver (  ) [virtual]

Destructor.

Definition at line 46 of file mtssp_i2c_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_i2c_driver.h.

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

Perform a blocking read transfer over I2C.

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

Implements MtsspDriver.

Definition at line 72 of file mtssp_i2c_driver.cpp.

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

Perform a blocking write transfer over I2C.

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_i2c_driver.cpp.

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

Perform a blocking write transfer over I2C.

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

Implements MtsspDriver.

Definition at line 83 of file mtssp_i2c_driver.cpp.