-
Notifications
You must be signed in to change notification settings - Fork 40
LPSPI: embedded-hal 1.0 rework #145
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
Draft
Finomnis
wants to merge
74
commits into
imxrt-rs:main
Choose a base branch
from
Finomnis:embedded_hal_1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 31 commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
7724d42
Initial ideas
Finomnis 42422ef
More ideas
Finomnis 854f727
More work
Finomnis 9a65d36
Dummy implement SPI traits
Finomnis d7bc1b5
Minor comment
Finomnis 47ff70a
More work; remove device, as it seems to be best practices to leave t…
Finomnis c4d938d
Add some comments
Finomnis 07a8343
Bla
Finomnis b2619de
Make DMA compile time configurable
Finomnis bfc7619
Small fixes
Finomnis 9fa738b
Refactor dma stuff int lpspi/dma.rs
Finomnis 95109a9
More work
Finomnis a74fc69
Add word_types
Finomnis e6ae197
Bla.
Finomnis c91cfb3
Add error handling to SPI bus
Finomnis b27d56e
Add data buffer tests
Finomnis 8711814
Implement blocking transfer
Finomnis ddef8d8
Refactoring to enable in-place transfer
Finomnis 210e86f
Remove unused variable
Finomnis af51c0a
First time compiling! Not working yet, though.
Finomnis 5275bdc
More rework; split data into dma and non-dma parts. To be determined …
Finomnis 6f54cc9
Make dma config a member again
Finomnis 26482d4
Fix example and board
Finomnis ae6ee7d
Remove rtic-sync dependency
Finomnis ef4d4bc
Fix lpspi clock config
Finomnis fd90b71
Add comment to set_clock_hz
Finomnis 844d1c4
Partial rewrite
Finomnis c426668
Remove obsolete bat script
Finomnis e828ca2
Remove obsolete use statements
Finomnis 5fdd6b2
Fix warning
Finomnis 595b154
More work
Finomnis 11bb131
Rework error handling
Finomnis 4b3e391
Add start_frame, add write iter
Finomnis 2aca984
Update cargo.toml
Finomnis 6d5c823
Merge branch 'main' into embedded_hal_1
Finomnis be75933
Update cargo.toml
Finomnis 857076a
Update cargo
Finomnis 343d555
Attempt to fix CI
Finomnis 5686f83
Another attempt to fix CI
Finomnis 5b4ecc6
Another attempt to fix CI
Finomnis b068ef6
Add actions_write_test
Finomnis 7fb65a5
More write impls
Finomnis a3c3838
Fix tests
Finomnis 3eae4e9
Fix rust-toolchain.toml
Finomnis 69fc170
First bus activity!
Finomnis fe98166
Fix order of single word transfer
Finomnis e2c357c
Prepare status_watcher for interrupt enable/disable
Finomnis 9242413
Minor fix
Finomnis 7f58e7e
Add wait-for-watermark
Finomnis 2a32c57
First working larger transmission!
Finomnis 43ddf45
Remove comment
Finomnis 95ecfcf
Add TODO
Finomnis ea86c45
More optimization on write
Finomnis 01995ff
Make ownership non-exclusive for most internal bus functions
Finomnis fea46a2
Split LPSPI into read and write part, for async ownership problems
Finomnis fd8a533
Add explanatory comment
Finomnis 84a502b
Refactoring; add ReadActionIter
Finomnis 7c40563
Update cargo.toml
Finomnis fe44f27
Fix tests
Finomnis 88a5d60
Refactor transfer_actions
Finomnis 64ff0c9
Attempt to add read_single_word
Finomnis 3027e05
Fix read
Finomnis 9e5a427
Add u32 stream; finish read part
Finomnis 1a2caab
Redistribute unsafe tags
Finomnis 2ffab65
Fix cleanup procedure
Finomnis 86ef4ed
Remove finished TODO
Finomnis 8bf18b3
Remove lpspi_old driver
Finomnis 7492ba2
Remove unnecessary pubs
Finomnis b75ede3
Add TODO comments
Finomnis 9cbd05e
Simplify read part
Finomnis c70ea1a
Prepare write DMA
Finomnis 0c5dcae
Add TODO
Finomnis 0cfe3a7
Adjust visibility of DMA mappings
Finomnis 649748d
Check in latest example version, does not work yet.
Finomnis 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,17 @@ | ||
| [package] | ||
| name = "imxrt-hal" | ||
| authors = ["Tom Burdick <[email protected]>", "Ian McIntyre <[email protected]>"] | ||
| authors = [ | ||
| "Tom Burdick <[email protected]>", | ||
| "Ian McIntyre <[email protected]>", | ||
| ] | ||
| description = """ | ||
| Hardware abstraction layer for NXP i.MX RT microcontrollers. | ||
| """ | ||
| readme = "README.md" | ||
| repository = { workspace = true } | ||
| keywords = { workspace = true } | ||
| categories = { workspace = true } | ||
| license = { workspace = true } | ||
| repository = { workspace = true } | ||
| keywords = { workspace = true } | ||
| categories = { workspace = true } | ||
| license = { workspace = true } | ||
| edition = { workspace = true } | ||
| version = "0.5.3" | ||
|
|
||
|
|
@@ -33,11 +36,26 @@ version = "1" | |
| package = "embedded-hal" | ||
| version = "0.2" | ||
|
|
||
| [dependencies.eh1] | ||
| package = "embedded-hal" | ||
| version = "1.0.0-rc.1" | ||
|
|
||
| [dependencies.eh1-async] | ||
| package = "embedded-hal-async" | ||
| version = "1.0.0-rc.1" | ||
| optional = true | ||
|
|
||
| [dependencies.rand_core] | ||
| version = "0.5" | ||
| version = "0.6" | ||
| default-features = false | ||
| optional = true | ||
|
|
||
| [dependencies.cortex-m] | ||
| version = "0.7" | ||
|
|
||
| [dependencies.cassette] | ||
| version = "0.2.3" | ||
|
|
||
| ####################### | ||
| # imxrt-rs dependencies | ||
| ####################### | ||
|
|
@@ -70,6 +88,7 @@ imxrt1020 = ["imxrt-iomuxc/imxrt1020"] | |
| imxrt1060 = ["imxrt-iomuxc/imxrt1060"] | ||
| imxrt1064 = ["imxrt-iomuxc/imxrt1060"] | ||
| imxrt1170 = ["imxrt-iomuxc/imxrt1170"] | ||
| async = ["dep:eh1-async"] | ||
|
|
||
| ################ | ||
| # Extra features | ||
|
|
@@ -80,16 +99,17 @@ imxrt1170 = ["imxrt-iomuxc/imxrt1170"] | |
| eh02-unproven = [] | ||
|
|
||
| [workspace] | ||
| members = [ | ||
| "board", | ||
| "logging", | ||
| ] | ||
| members = ["board", "logging"] | ||
|
|
||
| [workspace.dependencies] | ||
| imxrt-dma = "0.1" | ||
| imxrt-iomuxc = "0.2.1" | ||
| imxrt-hal = { version = "0.5", path = "." } | ||
| imxrt-log = { path = "logging", default-features = false, features = ["log", "lpuart", "usbd"] } | ||
| imxrt-log = { path = "logging", default-features = false, features = [ | ||
| "log", | ||
| "lpuart", | ||
| "usbd", | ||
| ] } | ||
| imxrt-ral = "0.5" | ||
| imxrt-rt = "0.1" | ||
| imxrt-usbd = "0.2" | ||
|
|
@@ -124,16 +144,20 @@ codegen-units = 256 | |
| ###################################### | ||
|
|
||
| [dev-dependencies] | ||
| cortex-m = "0.7" | ||
| imxrt-rt = { workspace = true } | ||
| menu = "0.3.2" | ||
| cortex-m-rtic = "1.0" | ||
| menu = "0.4.0" | ||
| rtic = { version = "2.0.1", features = ["thumbv7-backend"] } | ||
| rtic-monotonics = { version = "1.2.0", features = [ | ||
| "cortex-m-systick", | ||
| "embedded-hal-async", | ||
| ] } | ||
| log = "0.4" | ||
| defmt = "0.3" | ||
| pin-utils = "0.1" | ||
| usb-device = { version = "0.2", features = ["test-class-high-speed"] } | ||
| usbd-serial = "0.1" | ||
| usbd-hid = "0.6" | ||
| embedded-hal-bus = { version = "0.1.0-rc.1", features = ["async"] } | ||
|
|
||
| [target.'cfg(all(target_arch = "arm", target_os = "none"))'.dev-dependencies] | ||
| board = { path = "board" } | ||
|
|
@@ -148,7 +172,7 @@ required-features = ["board/spi"] | |
|
|
||
| [[example]] | ||
| name = "rtic_spi" | ||
| required-features = ["board/spi"] | ||
| #required-features = ["board/spi"] | ||
|
|
||
| [[example]] | ||
| name = "hal_logging" | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [toolchain] | ||
| channel = "nightly" | ||
| # components = ["rustfmt", "llvm-tools"] | ||
| targets = ["thumbv7em-none-eabihf"] |
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.