Skip to content
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

mcu/stm32: Calculate I2C timing register #3112

Merged
merged 1 commit into from
Dec 4, 2023

Commits on Nov 22, 2023

  1. mcu/stm32: Calculate I2C timing register

    STM32 F1,F4,L1 do have ClockSpeed filed in I2C initialization API,
    so it easy to specify requested clock speed for I2C.
    For all other devices ST HAL does not provide such field and
    expect that TIMINGR register value is precomputed.
    This value is specified in each BSP and is likely incorrect
    for some of them.
    
    This change introduces hic_speed to MCUs that has timing register and
    function that computes timing register base on requested speed and system
    clock.
    
    If timing register is specified in settings it is still being used to
    to configure I2C. If timing register setting is 0 hic_speed is used.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
    kasjer committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    71efe0e View commit details
    Browse the repository at this point in the history