Skip to content

Conversation

@htynkn
Copy link
Contributor

@htynkn htynkn commented Aug 12, 2025

拉取/合并请求描述:(PR description)

为什么提交这份PR (why to submit this PR)

添加硬件I2C支持

你的解决方案是什么 (what is your solution)

参考官方示例,添加I2C 中断模式读写能力

请提供验证的bsp和config (provide the config and bsp)

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@github-actions github-actions bot added BSP BSP: GD32 BSP related with GD32 labels Aug 12, 2025
@htynkn htynkn force-pushed the feature/add-gd32-i2c-hard branch from 0ecffb2 to 059e0c5 Compare August 12, 2025 05:17
@htynkn htynkn marked this pull request as ready for review August 12, 2025 05:35
@htynkn
Copy link
Contributor Author

htynkn commented Aug 14, 2025

我看action没有自动分配审核人,@Rbb666 @kurisaW 有劳两位帮忙review下

@Rbb666 Rbb666 requested review from Rbb666 and Copilot August 14, 2025 03:43

This comment was marked as outdated.

@htynkn htynkn force-pushed the feature/add-gd32-i2c-hard branch from df818ee to c12f9d5 Compare August 14, 2025 04:26
@htynkn htynkn requested a review from Copilot August 14, 2025 06:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds hardware I2C support for the GD32E230 microcontroller, implementing interrupt-driven I2C communication based on official examples. The implementation provides support for both I2C0 and I2C1 peripherals with configurable clock speeds.

Key changes:

  • Implementation of hardware I2C driver with interrupt-based read/write capabilities
  • Configuration support for I2C0 and I2C1 with customizable clock speeds
  • Integration with RT-Thread I2C framework and proper error handling

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
drv_hw_i2c.h Header file defining I2C hardware configuration structures and function prototypes
drv_hw_i2c.c Complete I2C driver implementation with interrupt handlers and RT-Thread integration
SConscript Build system integration for the new hardware I2C driver
rtconfig.py Debug build configuration change
rtconfig.h Increased RT_NAME_MAX to accommodate longer device names
link.ld Removed debug section discarding to support debug builds
Kconfig Added hardware I2C configuration options with clock speed settings
README.md Updated documentation with I2C pin assignments and feature support
.config Configuration file reflecting the RT_NAME_MAX change
ci.attachconfig.yml CI configuration for testing hardware I2C functionality
Comments suppressed due to low confidence (1)

bsp/gd32/arm/libraries/gd32_drivers/drv_hw_i2c.c:52

  • The field name 'dev_config' is ambiguous. It's unclear what configuration this field represents or if it's even used in the code.
    i2c_interrupt_disable(i2c_periph, I2C_INT_EV);

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@htynkn htynkn force-pushed the feature/add-gd32-i2c-hard branch from ed441fb to c12f9d5 Compare August 14, 2025 06:43
@Rbb666 Rbb666 merged commit 235bbef into RT-Thread:master Aug 15, 2025
71 checks passed
@htynkn htynkn deleted the feature/add-gd32-i2c-hard branch August 15, 2025 00:58
@Rbb666 Rbb666 added this to the v5.2.2 milestone Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: GD32 BSP related with GD32 BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants