Async implementation for both I2C and SPI #26
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 is a first version of Async, surely needs some fine tuning, but it's working.
Was tested on ESP32S3. The I2C has been working for quite some time w/o any issues. SPI is newer.
Some notes:
maybe_async
to avoid code duplications, ~~therefore at this time default is async and need to set featuredefault isis_sync
to make it sync (the default formaybe_async
). Might want to revisit this for backwards compatibility and make sync the default.is_sync
and need to usedefault-features=false
for async.Countdown
Error type was lately removed and replaced by a specific error type (nb), I used embassy-timeTimeoutError
instead of an error type supplied by the user which I think would have been more elegant, not sure if it's good approach. For embedded probably yes since embassy is the de-facto standard and it makes life easier.Currently async doesn't support IRQ mode. Will probably want to add as a next step.(added)wake_up
to get SPI to work (for both sync and async).