Skip to content

add spi listen callback and stop listen callback function - #1124

Closed
myrual wants to merge 6 commits into
micropython:masterfrom
myrual:master
Closed

myrual wants to merge 6 commits into
micropython:masterfrom
myrual:master

Conversation

@myrual

@myrual myrual commented Feb 17, 2015

Copy link
Copy Markdown
Contributor

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.

@dpgeorge

Copy link
Copy Markdown
Member

Thanks for this. I will review it soon.

@dpgeorge

Copy link
Copy Markdown
Member

Sorry for the long wait to review this...

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.

@dpgeorge

dpgeorge commented May 2, 2018

Copy link
Copy Markdown
Member

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.

@dpgeorge dpgeorge closed this May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants