Conversation
📌 Code Review Assignment🏷️ Tag: componentsReviewers: Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_i2cReviewers: wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-12-02 11:06 CST)
📝 Review Instructions
|
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
There was a problem hiding this comment.
Pull request overview
This PR enhances the I2C driver framework to support RT-Thread's Device Manager (DM) infrastructure by adding a helper API for retrieving device ID match data, ensuring device names are set before registration, and enabling BSP-specific Kconfig integration for DM-enabled I2C drivers.
Key Changes:
- Added
rt_i2c_client_id_data()inline helper function to retrieve driver-specific match data from I2C client devices - Device name is now set before registering I2C client devices to the bus
- Kconfig support added for BSP-specific DM I2C driver configuration
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
components/drivers/include/drivers/dev_i2c.h |
Added new inline helper rt_i2c_client_id_data() to retrieve ID match data from I2C client devices (follows SPI driver pattern) |
components/drivers/i2c/dev_i2c_bus.c |
Set device name using rt_dm_dev_set_name() before calling rt_i2c_device_register() to ensure proper device naming in DM framework |
components/drivers/i2c/Kconfig |
Changed to menuconfig and added conditional osource directive to include BSP-specific DM I2C Kconfig files (consistent with SPI driver pattern) |
1. Add get id match data API. 2. Set I2C device name default before adding to bus. 3. Add Kconfig import for DM. Signed-off-by: GuEe-GUI <2991707448@qq.com>
|
@Rbb666 除 AI 不合理修改外均修改 |
拉取/合并请求描述:(PR description)
[
]
当前拉取/合并请求的状态 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