Activity 10.3.5. What Five Things Does the Library Have to Do?
Work individually first, then compare your list with your table group. Think about what a transaction consists of and what a program has to be able to do with a device.
(a)
Open your own
helloDisplay.c. Three of the operations needed of an I2C library can be seen in this program. Name them from the calls you can see, and for each one say what the program had to pass to the function in order to call it.
(b)
Recall your own capture on the AD2 yesterday. Which of those three calls produced the START, the address, the ACK, the data byte and the STOP you captured? Looking only at the trace, could you tell a one-byte write from a multi-byte one?
(c)
Two operations needed of an I2C library are still missing. Your capture from yesterday shows one acknowledge per byte and never a byte coming back to you. What I2C operations cannot be built out of the three calls we have seen in
helloDisplay.c?
(d)
One of the five things needed of an I2C library has nothing to do with any particular device. What is it and what does it have to set up?
