-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cpu/msp430: rework MSP430 x1xx periph drivers #19835
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benpicco
approved these changes
Jan 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, static-tests
has some nits though
- Move common code for USART (shared SPI / UART peripheral) to its own file and allow sharing the USART peripheral to provide both UART and SPI in round-robin fashion. - Configure both UART and SPI bus via a `struct` in the board's `periph_conf.h` - this allows allocating the two UARTs as needed by the use case - since both USARTs signals have a fixed connection to a single GPIO, most configuration is moved to the CPU - the board now only needs to decide which bus is provided by which USART Note: Sharing an USART used as UART requires cooperation from the app: - If the UART is used in TX-only mode (no RX callback), the driver will release the USART while not sending - If the UART is used to also receive, the application needs to power the UART down while not expecting something to send. An `spi_acquire()` will be blocked while the UART is powered up.
Thx :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: boards
Area: Board ports
Area: cpu
Area: CPU/MCU ports
Area: tests
Area: tests and testing framework
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: MSP
Platform: This PR/issue effects MSP-based platforms
Type: cleanup
The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
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.
Contribution description
struct
in the board'speriph_conf.h
Note: Sharing an USART used as UART requires cooperation from the app:
spi_acquire()
will be blocked while the UART is powered up.Testing procedure
UART and SPI should still work
tests/periph/spi
Issues/PRs references
Depends on and includes: