-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[gd32][i2c] Add hardware I2C driver for GD32VW553xx #11151
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,9 @@ if GetDepend(['RT_USING_SERIAL']): | |||||||||||||||||||||||||||
| if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']): | ||||||||||||||||||||||||||||
| if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3'): | ||||||||||||||||||||||||||||
| src += ['drv_soft_i2c.c'] | ||||||||||||||||||||||||||||
| if GetDepend(['RT_USING_I2C', 'BSP_USING_HW_I2C']): | ||||||||||||||||||||||||||||
| if GetDepend('BSP_USING_HW_I2C0') or GetDepend('BSP_USING_HW_I2C1'): | ||||||||||||||||||||||||||||
| src += ['drv_i2c.c'] | ||||||||||||||||||||||||||||
|
Comment on lines
20
to
+25
|
||||||||||||||||||||||||||||
| if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']): | |
| if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3'): | |
| src += ['drv_soft_i2c.c'] | |
| if GetDepend(['RT_USING_I2C', 'BSP_USING_HW_I2C']): | |
| if GetDepend('BSP_USING_HW_I2C0') or GetDepend('BSP_USING_HW_I2C1'): | |
| src += ['drv_i2c.c'] | |
| if GetDepend('RT_USING_I2C'): | |
| if GetDepend('RT_USING_I2C_BITOPS'): | |
| if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3'): | |
| src += ['drv_soft_i2c.c'] | |
| if GetDepend('BSP_USING_HW_I2C'): | |
| if GetDepend('BSP_USING_HW_I2C0') or GetDepend('BSP_USING_HW_I2C1'): | |
| src += ['drv_i2c.c'] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright (c) 2006-2026, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2026-01-25 yefeng first version | ||
| */ | ||
|
|
||
| #ifndef __DRV_CONFIG_H__ | ||
| #define __DRV_CONFIG_H__ | ||
|
|
||
| #include <board.h> | ||
| #include <rtthread.h> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif |
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.
I2C clock frequency range may be too restrictive.
English: The I2C clock frequency is limited to 50-400 KHz range (lines 108, 135). While this covers standard (100 KHz) and fast mode (400 KHz), it excludes low-speed mode (10 KHz) which might be useful for some devices. Also, some modern I2C devices support Fast Mode Plus (1 MHz). Consider if these additional modes should be supported, or if the current range is intentionally restrictive for hardware limitations.
中文:I2C 时钟频率限制在 50-400 KHz 范围内(第 108、135 行)。虽然这涵盖了标准模式(100 KHz)和快速模式(400 KHz),但排除了可能对某些设备有用的低速模式(10 KHz)。此外,一些现代 I2C 设备支持快速模式增强型(1 MHz)。考虑是否应支持这些附加模式,或者当前范围是否因硬件限制而有意限制。