Replace raw slice with dma_accessible::DmaBuffer#1
Open
Dicklessgreat wants to merge 6 commits intomainfrom
Open
Replace raw slice with dma_accessible::DmaBuffer#1Dicklessgreat wants to merge 6 commits intomainfrom
Dicklessgreat wants to merge 6 commits intomainfrom
Conversation
…t bound from Fhx struct
…slice for tx_buffer
Author
|
maybe const generics is better because it can preserve |
… to explicitly specify its length
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces support for DMA-accessible SPI communication buffers by integrating the
dma-accessiblecrate and refactoring theFhxstruct and related methods.DmaBufferstruct is just a wrapper type for the slice, but it ensures that it uses DMA-accessible memory region(unfortunately, it does not check safety at compile-time, but just check and panics if it is invalid at run-time).DMA integration and buffer handling:
dma-accessiblecrate as a dependency inCargo.tomlto enable DMA-safe buffer management.Fhxstruct to use a genericDmaActype parameter and replaced the SPI transmit buffer with adma_accessible::DmaBuffer, ensuring the buffer is DMA-accessible. [1] [2]Fhx::newconstructor to wrap the transmit buffer in aDmaBufferand require a'static mutreference for DMA compatibility. [1] [2]writemethod to use the new buffer API, copying data into the DMA buffer and passing the correct slice type to the SPI bus.Note
Not yet tested on real hardware because I don't have one, but it has been logically tested.