Repository navigation
Conversation
- Implement RT-Thread Input Capture devices using STM32 HAL TIM1-TIM4, with configurable channels, filters and initial capture polarity. - Add STM32F1 and STM32H7 configuration headers and integrate the driver into Kconfig and SConscript. - Handle APB timer clock multipliers, TIMPRE and 32-bit counter capabilities using HAL feature macros. - Clear pending capture and overcapture flags before restarting a capture channel.
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: @Liang1795 @hamburger-os @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-11-02 17:40 CST)
📝 Review Instructions
|
|
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
为 STM32 HAL BSP 增加 RT-Thread Input Capture 设备驱动支持,使应用能够通过统一的 Input Capture 设备接口获取定时器捕获的脉冲宽度。
本次优先适配 STM32F1 和 STM32H7 系列,支持通过 Kconfig 选择定时器、捕获通道及相关参数,减少不同 BSP 重复实现 Input Capture 驱动的工作。
你的解决方案是什么 (what is your solution)
drv_inputcapture.c和drv_inputcapture.h,基于 STM32 HAL TIM Input Capture 实现 RT-Thread 设备操作及捕获中断回调。Kconfig、SConscript和drv_config.h,接入驱动编译与系列配置。使用约束:
当前验证情况:
已完成三轮本地全范围静态代码审查,未发现尚未解决的必修问题。尚未执行 STM32F1/H7 BSP 编译、目标板实测或 CI 构建,因此不将静态审查结果视为硬件验证通过。
请提供验证的bsp和config (provide the config and bsp)
.config。建议启用RT_USING_INPUT_CAPTURE、BSP_USING_INPUT_CAPTURE,并至少选择一个BSP_USING_INPUT_CAPTURE_TIM1~BSP_USING_INPUT_CAPTURE_TIM4;可按需设置BSP_INPUT_CAPTURE_COUNTER_HZ。]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up