Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from Jun 3, 2021

Conversation

caternuson
Copy link
Contributor

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:

  • Includes pin mappings for several Adafruit RP2040 based boards
  • Change to including pico-sdk as a submodule
  • Minor code fixes that help when building firmware with newer gcc versions

@execuc execuc merged commit 45978e8 into execuc:main Jun 3, 2021
@execuc
Copy link
Owner

execuc commented Jun 3, 2021

Thank you very much !

@caternuson
Copy link
Contributor Author

np. thank you!

usamabashir82 pushed a commit to usamabashir82/u2if that referenced this pull request Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants