-
Notifications
You must be signed in to change notification settings - Fork 965
Fix DMA to SPI transmits on RP2350 #4903
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
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7a312ce
Fix DMA to SPI transfers on RP2350
hb9cwp 47c8993
Add definitions for DMA DREQ "handshake" lines
hb9cwp c207e51
Add definitions for DMA DREQ "handshake" lines
hb9cwp 970412c
Complete table
hb9cwp 00bf8e4
Complete table
hb9cwp 75cee78
Remove redundant DMA_ prefix
hb9cwp a3c7c16
Correct name of Datasheet
hb9cwp 0fd8fad
Correct name of Datasheet
hb9cwp c7ed461
Refactor
hb9cwp 52da289
Refactor
hb9cwp fde6365
Refactor
hb9cwp 2d1bd29
Refacture
hb9cwp d2045d3
Refacture
hb9cwp 27a15d2
Fix comments
hb9cwp 6568712
go fmt
hb9cwp 2d79fcf
rename new non-generated files
hb9cwp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Why export these? They're useful, sure, but do they belong in the
machine
package from the perspective of importing packages?Uh oh!
There was an error while loading. Please reload this page.
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.
Because the generated
src/device/rp/rp2040|rp2350.go
don't provide them, and they are global and specific for these processors as well.What alternatives do you propose which would be a better fit?
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.
See https://github.com/tinygo-org/tinygo/blob/release/src/device/sam/atsamd51x-bitfields.go for example of how to handle values that are not part of the files generated from the SVDs.
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.
For every exported API the question should be: what are the use cases for outside users? If there's no identifiable outside need, it's better to keep the API unexported and deal with isssues such as naming, other platforms etc. when the need arises.
If you or some other maintainer (@soypat?) decide to export anyway, I suggest package
device/rp
. Themachine
package is for abstractions across a wide range of hardware, and I know of no restriction that saydevice/rp
is for machine generated code only.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.
Agreed,
device/rp
would be a good place, similar todevice/tkey
ordevice/riscv
for example.Unfortunately, it is currently excluded by .gitignore. It would be helpful to have also generated *.go and *.s files in the repo that are versioned. This would facilitate searching and automatic cross-referencing, etc.
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.
Moved the additional global constants for DMA to
device/rp/rp2nnn0-plus.go
, see refactoring below.But I did not touch some other lines in
src/machine/machine_rp2_2nnn.go
that could be refactored as well, such as: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.
These constants are internal implementation details. Why should they be exported?