-
Notifications
You must be signed in to change notification settings - Fork 373
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
Feature Request: Non-Blocking I2C #1730
Comments
That library may use DMA, but it definitely is blocking on the caller (i.e. a call to i2c-read-write-dma takes exactly as many wall seconds to return as a i2c-read-write-polling call would). I guess in the case of FreeRTOS that lets you run another task instead of busy waiting, but here we don't have tasks (unless you use FreeRTOS...in which case the library may almost work as-is). I'm not sure what the API would be here, though, where there are no tasks. You'd need a callback function or something (called ar IRQ time) or a flag your app could poll to see if the I2C op is really done or not. |
I'd personally go with a callback, but a polled function/flag would be a solid choice, too. Maybe even preferably since some people might put too much code into the callback-handler... |
Fixes #1730 Uses DMA operations to avoid the need to bit-bang or busy wait for I2C operations that might be very slow. Optional, adds new API calls to enable. Simple example included.
If anyone looking at this request could take a look at #2167 and try their hand at using it in their application I'd much appreciate it. I have the TalkingToMyself test running in asynchronous mode stably, but don't seem to have any I2C gadgets to hoop up and try on external HW... |
Fixes #1730 Uses DMA operations to avoid the need to bit-bang or busy wait for I2C operations that might be very slow. Optional, adds new API calls to enable. Simple example included.
I don't know of a non-blocking or perhaps even DMA I2C-Library for the RP2040-Arduino-Core. There is a DMA-library for FreeRTOS under PICO-I2C-DMA, but it would be great to have something Arduino compatible...
The text was updated successfully, but these errors were encountered: