boards/arm/rp2040/common: Add weak_function to SPI common logic #15894
+14
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Board logic change.
This PR adds weak_function attributes to the RP2040 common SPI board logic.
This allows board developers to override and extend the SPI board logic.
Impact
This allows board developers to add custom SPI logic such as adding additional chip select pins.
Adding new SPI devices such as displays or custom SPI devices like external boards is now possible.
External custom boards will have the biggest impact, as these are typically not pushed.
Testing
This has been tested by building the code on linux with raspberrypi-pico:nsh config.
I also tested it on a custom board and it works.
However, my knowledge is not very big about compiler compatibility when weak_function is used.
Please let me know if there are issues.