Coder Social home page Coder Social logo

Comments (5)

jfpoilpret avatar jfpoilpret commented on June 19, 2024

Ideally it should be possible to implement support for a device through only one device class that could work in both sync and async mode. But it is not clear at all how that could be done.
In the worst case, we would have to provide 2 classes per device (but they should be located in the same source file, then).

from fast-arduino-lib.

jfpoilpret avatar jfpoilpret commented on June 19, 2024

Main idea to support asynchronous I2C API is to first introduce the concept of futures (aka promises) in FastArduino.

from fast-arduino-lib.

jfpoilpret avatar jfpoilpret commented on June 19, 2024

Unfortunately, after several trials, asynchronous I2C mode will be reserved to ATmega family and will not work on ATtiny (USI is not good enough to work as master in a proper async way).
On the bright side, after several proofs of concept, I start to get very positive results and support should be ready soon (end of June hopefully).

The latest PoC already allows:

  • target-agnostic I2C device implementation (asynchronous mode is simulated for ATtiny MCU)
  • combining sync and async API in one I2C device class (sync API calls async API and awaits)

Next steps will consist in:

  • fine-tuning PoC code
  • rework all I2C devices to use new async API
  • add API doc to new I2C Handler
  • update tutorial on implementing new I2C devices
  • remove old API
  • merge all to master branch

from fast-arduino-lib.

jfpoilpret avatar jfpoilpret commented on June 19, 2024

Quick status (on specific Git branch, not on master):

  • PoC code for async I2C finalized
  • all I2C devices have been ported to new async I2C library, and tested on UNO

However, I have an issue with generated code size (partly due to Async I2C implementation itself, and also Future implementation). Of course, using asynchronous I2C, you shall accept the extra cost for it.

But this extra cost is also present for I2C devices sync API (which uses async API). I would like to remove this extra cost for programs that exclusively use sync API. But this is not obvious unfortunately. I need to study possible options for that.

What all this means is that, unfortunately, I will have to postpone milestone 1.6 at least one month.

from fast-arduino-lib.

jfpoilpret avatar jfpoilpret commented on June 19, 2024

Implemented on master branch at commit 8e39e6d
Will be released in v1.6

from fast-arduino-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.