This approach works, passing in "driver" to (almost) every function call, but is kind of the opposite of object-oriented coding as it combines multiple programming approaches into one class (there are two "classes" of methods in this class)
You could instead have a container object that holds the drivers and resolves the bus state, and each BusWire object (there would now be one for each device on the bus) can reference and manipulate one of the drivers.
Originally posted by @humphrey-xmos in #62 (comment)
This approach works, passing in "driver" to (almost) every function call, but is kind of the opposite of object-oriented coding as it combines multiple programming approaches into one class (there are two "classes" of methods in this class)
You could instead have a container object that holds the drivers and resolves the bus state, and each BusWire object (there would now be one for each device on the bus) can reference and manipulate one of the drivers.
Originally posted by @humphrey-xmos in #62 (comment)