-
Notifications
You must be signed in to change notification settings - Fork 0
SUBLIBinal offers an easy solution to one of the more complicated communication protocols available. I2C communication is simplified by creating nodes of I2C transactions that occur with devices. These nodes are then completed as steps of the I2C process are completed by the I2C peripheral on the microcontroller. This means that multiple I2C transactions can be occurring asynchronously. Please note that the library only supports I2C in single-master multiple-slave configuration. The I2C documentation has been split into three subsections including enumeration definitions, structure declarations, and available functions. Please refer to the following list to be redirected to the proper documentation.
To view code examples of I2C functionality utilizing the SUBLIBinal I2C peripheral library, please refer to I2C Example.
I2C is one of the more complicated communication protocols available for communication between two devices, but is often preferred by sensor packages. The reason that I2C is useful is because it only requires two data lines for any number of devices. That means that different sensors can be daisy-chained along the same wire and the microcontroller can choose which device it wishes to communicate with. I2C has many modes of operation including multi-master and multi-slave configurations, where a slave is a device that only waits for other devices to talk to it and a master is a device that queries others. SUBLIBinal only supports single-master and multi-slave. To select a slave, an address and subaddress must be used within an I2C node. The master queries a specific slave by sending the address along the line and waiting for a response. If a response is received, a query for information is made and communication continues. I2C must continually check for proper transmission, and can interrupt a transaction if a device is not responding. In this case, the transaction will be cancelled to clear up the I2C line.
SUBLIBinal was created by the Palouse Robosub Club.