A practical walkthrough of building a C++ I/O abstraction for the HC595 shift register on an LPC1114 microcontroller. The author creates an `output_pin_595` class that inherits from `output_pin`, allowing individual HC595 outputs to be used interchangeably with native MCU pins. Key C++ concepts covered include forward declarations to resolve circular class dependencies, out-of-class method definitions, and the `this` pointer. The pattern is then generalized to MCU port objects and demonstrated with daisy-chained HC595 chips, where outputs of one chip drive the control lines of the next.
3 Impressions