feat(gd32 driver) Add support for hardware i2c with gd32e230#10601
Merged
Rbb666 merged 2 commits intoRT-Thread:masterfrom Aug 15, 2025
Merged
feat(gd32 driver) Add support for hardware i2c with gd32e230#10601Rbb666 merged 2 commits intoRT-Thread:masterfrom
Rbb666 merged 2 commits intoRT-Thread:masterfrom
Conversation
0ecffb2 to
059e0c5
Compare
Contributor
Author
df818ee to
c12f9d5
Compare
Contributor
There was a problem hiding this comment.
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.
ed441fb to
c12f9d5
Compare
Rbb666
approved these changes
Aug 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
拉取/合并请求描述:(PR description)
为什么提交这份PR (why to submit this PR)
添加硬件I2C支持
你的解决方案是什么 (what is your solution)
参考官方示例,添加I2C 中断模式读写能力
请提供验证的bsp和config (provide the config and bsp)
BSP: bsp/gd32/arm/gd32e230-lckfb
.config:
hw_drv_onchip.i2c1:
kconfig:
action: https://github.com/htynkn/rt-thread/actions/runs/16899693873/job/47876339914
当前拉取/合并请求的状态 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