Coder Social home page Coder Social logo

Timeout parameter in HAL_I2C_Master_Receive/HAL_I2C_Mem_Read not used for I2C_WaitOnFlagUntilTimeout function about stm32g0xx_hal_driver HOT 3 CLOSED

Kedrel avatar Kedrel commented on September 27, 2024
Timeout parameter in HAL_I2C_Master_Receive/HAL_I2C_Mem_Read not used for I2C_WaitOnFlagUntilTimeout function

from stm32g0xx_hal_driver.

Comments (3)

KRASTM avatar KRASTM commented on September 27, 2024

Hello @Kedrel,

Thank you for the report.

The Timeout used in I2C_WaitOnFlagUntilTimeout for the 2 functions HAL_I2C_Master_Receive & HAL_I2C_Mem_Read is sufficient to check if the peripheral still busy.

Otherwise, can you share more details about your scenario or project?

With regards.

from stm32g0xx_hal_driver.

Kedrel avatar Kedrel commented on September 27, 2024

Hello @KRASTM,

The system i'm working on currently uses a tick of 10 ms to run the whole process. The aim is never to have a task that exceends 10ms so we can handle the "real-time" properly.

When i call "HAL_I2C_Mem_Read" using a Timeout parameter at 2 ms, inside of it we have the call of "I2C_WaitOnFlagUntilTimeout" which uses a parameter of I2C_TIMEOUT_BUSY, which is 25ms.

So if an I2C peripheral can't respond, instead of loosing 2ms of wait time like the setting i chose, i'll loose 25ms.

I can't afford to loose 25ms like that (as i have multiple I2C sensors), so i'll change the I2C_TIMEOUT_BUSY value to something acceptable for my application.

With regards.

from stm32g0xx_hal_driver.

KRASTM avatar KRASTM commented on September 27, 2024

Hello @Kedrel,

In this particular case, it is possible to modify the value of I2C_TIMEOUT_BUSY to suit your application.
Please allow me to close this issue. Thank you for your comprehension.

With regards.

from stm32g0xx_hal_driver.

Related Issues (6)

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.