Git Product home page Git Product logo

Comments (6)

rasendubi avatar rasendubi commented on May 24, 2024

We should also switch to using I2C_GetLastEvent instead of I2C_GetFlagStatus because the former allows checking for errors.

from thecore.

forGGe avatar forGGe commented on May 24, 2024

@rasendubi Makes sense.

from thecore.

forGGe avatar forGGe commented on May 24, 2024

@Dubland : check #19 (comment)

from thecore.

forGGe avatar forGGe commented on May 24, 2024

Function usage is described in stm32 i2c source.

Checks like these https://github.com/forGGe/theCore/blob/develop/platform/stm32/export/aux/i2c_bus.hpp#L586 must be re-implemented using I2C_GetFlagStatus.

Error can be reported using bus event:
https://github.com/forGGe/theCore/blob/develop/platform/common/export/common/bus.hpp#L26

After that, soft_reset can try to repeat xfer if necessary:
https://github.com/forGGe/theCore/blob/develop/dev/sensor/htu21d/export/dev/sensor/htu21d.hpp#L177

Talk to @vadimol for more details of how i2c driver works if something unclear.

from thecore.

rasendubi avatar rasendubi commented on May 24, 2024

A small correction: checks must be re-implemented using I2C_GetLastEvent.

I2C_GetFlagStatus resets some status flags so is not appropriate to call multiple times in a row.

from thecore.

forGGe avatar forGGe commented on May 24, 2024

Implemented as a part of #279 Thanks to @Dubland !

from thecore.

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.