Skip to content
Discussion options

You must be logged in to vote

No. The SPI and I2C classes are synchronous. In my display drivers I make the large SPI transfers more asyncio-friendly by sending part of the data and yielding to the scheduler so that the maximum blocking time is limited (see code).

A nonblocking SPI interface would be difficult because the data rates are so high (typically 40MHz). Task switching in asyncio applications typically happens in tens of ms. The UART driver does clever things with buffers and interrupts so data is not lost - but data rates are much lower.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by saraverbeecke
Comment options

andrewleech
Nov 23, 2023
Collaborator Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@andrewleech
Comment options

andrewleech Nov 24, 2023
Collaborator Sponsor

@andrewleech
Comment options

andrewleech Nov 30, 2023
Collaborator Sponsor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants