Khepera III Toolbox/The Toolbox/Modules/i2c stream

< Khepera III Toolbox < The Toolbox < Modules

The i2c_stream module implements a simple I2C data streaming protocol. The device from which data is streamed must implement that same protocol as well.

Synopsis

Check out the source code of the i2c_stream_read program for an example.

Description

This module uses the i2cal module to transfer data blocks from the external device (chip) to the program. It basically consists of two functions:

The following four settings need to be provided to the module

Streaming Protocol

The protocol used for data streaming is very simple: To reset the stream, the module first sends the register followed by a 1. To read a chunk, the module sends the register and then reads a multiple of (block_size + 1) bytes from the device. The first byte of a block is a status byte which can take one of the following values:

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.