What does I2C comprise of in terms of conceptual software objects?
Would it be proper to model masters and slaves using object sub-classes? Does a sub-class hierarchy exist for I2C devices? Something like Figure 1.3 perhaps?
Actually, it would not be proper! Master and slave relates to behaviour and behaviour changes over time. Class determines fixed behaviour and attributes. You cannot dynamically alter an object’s class, not in most object-oriented languages anyway. Instead, master-slave designation corresponds to an association, a link between master, slave and some particular transmission; for each transmission, one master, one slave. Both master and slave are arbitrary I2C Devices. See Figure 1.4. I2C uses 7-bit addresses therefore supports up to 27 = 128 devices attached to a bus.