-
Notifications
You must be signed in to change notification settings - Fork 5.3k
feat(gd32 driver) Add support for hardware i2c with gd32e230 #10601
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
Conversation
0ecffb2 to
059e0c5
Compare
df818ee to
c12f9d5
Compare
There was a problem hiding this 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.
ed441fb to
c12f9d5
Compare
拉取/合并请求描述:(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