57ab4f1329
I discussed with Hierophect on Discord about how to "de-nest" the code for configuring SPI objects on STM, because the problems with one nesting level per pin becomes unmanageable with the up to 10 pins of SDIO. This code (which is only compile-tested so far) demonstrates the concept we discussed. The SCK pin is always required. Loop over all possibilities of the SCK pin. When we are considering a particular item in the mcu_spi_sck_list we have now become committed to using a particular periph_index. If all the other pins can be satisfied by that periph_index, then we have a working combination. Once we have a working combination that is not reserved, we can return that combination. On reaching the end, we have checked all the possible possibilities and can give the same errors as before: One if there was a possibility that worked but was reserved; and another if no possibility worked. |
||
---|---|---|
.. | ||
__init__.c | ||
I2C.c | ||
I2C.h | ||
OneWire.h | ||
SPI.c | ||
SPI.h | ||
UART.c | ||
UART.h |