circuitpython/ports/stm/common-hal/busio
Jeff Epler 57ab4f1329 stm: SPI: revamp pin search code
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.
2020-07-07 14:37:50 -05:00
..
I2C.c Revert I2C timing overrides, reduce scope to module only 2020-06-15 13:51:09 -04:00
I2C.h Add F7 and H7 Support to the STM32 port 2020-03-26 18:01:17 -04:00
OneWire.h Add F7 and H7 Support to the STM32 port 2020-03-26 18:01:17 -04:00
SPI.c stm: SPI: revamp pin search code 2020-07-07 14:37:50 -05:00
SPI.h Add F7 and H7 Support to the STM32 port 2020-03-26 18:01:17 -04:00
UART.c Add UART support 2020-06-24 12:47:58 -07:00
UART.h Enable showing the console on a debug uart 2020-05-19 02:02:52 +02:00
__init__.c create copy 2020-03-11 18:13:06 -04:00