You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add spi listen callback and stop listen callback function - #1124
Add two functions for SPI slave mode for listen SPI data without disable dma channel. Please help to check the code quality and coding style, I am not familiar with python internal code like gc and others.
The spi.listen method that you added is essentially the same as spi.recv except that it returns before the receive finishes (if it's a DMA transfer). And then a callback gets called when the receive is actually done.
I think this functionality should be part of spi.recv, enabled with a keyword something like block=False. This would scale to the send method, and also the I2C peripheral.
But the way to handle callbacks in general is still blocked pending discussion in #1118.
Given that this PR is so old I'm going to close it.
The idea is good -- to support asynchronous SPI transfers with callbacks -- but the overall machine API is not there yet. When it is hopefully a variant of this PR will be implemented.
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
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.
Add two functions for SPI slave mode for listen SPI data without disable dma channel. Please help to check the code quality and coding style, I am not familiar with python internal code like gc and others.