Nota Bene: This describes a reference implementation of a feature not yet implemented in the PETI firmware. The SPI expansion system may not be included in the final toy design.
The PETI Development Kit Rear Expansion Board provides a second position to attach a customized peripheral to PETI which would communicate to PETI via SPI. This places a requirement to have the main PETI firmware be able to distinguish between the EXP_SPI connection and the SPI connection to the LCD, which is achieved through the following considerations:
- PETI does not use, nor does the LCD actually provide functionality to support, MISO for the LCD.
- Both devices will have unique Chip Select pins defined in the GPIO initialization code.
During HW initialization, PETI should lower the chip select for the EXP_SPI bus and send an interrogation message to MOSI. If a device is present, it should respond with a unique identifier. Thereafter, the firmware should enact whatever special handling is needed for that accessory.
This is a stretch goal on top of a toy project. It's the lowest current priority item for implementation. Likely, this will need to be developed and implemented throughout every scene in the firmware and is more intended to be available as an additional level of hackability for the end user than it is intended to allow us to create a series of officially-supported peripherals.