execuc / u2if

USB to interfaces implementing MicroPython "machine" module functionalities on a computer.
Other
160 stars 29 forks source link

Allow for custom pin mappings and some other tweaks. #3

Closed caternuson closed 3 years ago

caternuson commented 3 years ago

These are changes to just the firmware aspect of the code repository. As discussed in #2 .

The main change here is a simple pin mapping capability driven by pre-processor logic. This allows creating u2if firmware builds for other RP2040 based boards that route different pins out. The pins are defined in pins.h and then mapped to u2if in PicoInterfacesBoard.h. Then in CMakeLists.txt, set the target board before building. I'm super unfamiliar with cmake, so there may be a better "cmake way" of doing this?

The original variable names in PicoInterfacesBoard.h were left in place. For example:

        GP18_SPI0_CK = U2IF_SPI0_CK,

may not have anything to do with GP18. It's just "pin to use for index 0 SPI clock". This was done to simply allow changing as little code as possible.

Also, currently all interfaces are defined and left enabled. For boards that don't route out all of these, unused pins are specified. Might make sense to have the interfaces be enabled conditionally also. But deferring that work for now.

Additional changes are:

execuc commented 3 years ago

Thank you very much !

caternuson commented 3 years ago

np. thank you!