File tree Expand file tree Collapse file tree 10 files changed +716
-11
lines changed Expand file tree Collapse file tree 10 files changed +716
-11
lines changed Original file line number Diff line number Diff line change @@ -22,4 +22,9 @@ hw_drv_onchip.i2c0:
22
22
kconfig :
23
23
- CONFIG_BSP_USING_I2C0=y
24
24
- CONFIG_BSP_I2C0_SCL_PIN=22
25
- - CONFIG_BSP_I2C0_SDA_PIN=23
25
+ - CONFIG_BSP_I2C0_SDA_PIN=23
26
+ hw_drv_onchip.i2c1 :
27
+ kconfig :
28
+ - CONFIG_BSP_USING_HW_I2C=y
29
+ - CONFIG_BSP_USING_HW_I2C1=y
30
+ - CONFIG_BSP_HW_I2C1_CLOCK_SPEED=400000
Original file line number Diff line number Diff line change 108
108
# CONFIG_RT_UTEST_TC_USING_KLIBC is not set
109
109
# end of klibc options
110
110
111
- CONFIG_RT_NAME_MAX=8
111
+ CONFIG_RT_NAME_MAX=20
112
112
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
113
113
# CONFIG_RT_USING_NANO is not set
114
114
# CONFIG_RT_USING_SMART is not set
Original file line number Diff line number Diff line change 36
36
| :--- | :---: | :--- |
37
37
| GPIO | 支持 | PAx, PBx... |
38
38
| UART | 支持 | USART0, USART1 |
39
+ | I2C | 支持 | I2C0, I2C1 硬件I2C |
39
40
| ** 扩展模块** | ** 支持情况** | ** 备注** |
40
41
| 暂无 | 暂不支持 | 暂不支持 |
41
42
43
+ ### 补充说明
44
+
45
+ I2C 引脚分配:
46
+ - ** I2C0** : SCL(PB6), SDA(PB7)
47
+ - ** I2C1** : SCL(PB10), SDA(PB11)
48
+ 默认速率400KHz,可以配置调整。
49
+
50
+
42
51
## 使用说明
43
52
44
53
使用说明分为如下两个章节:
@@ -95,7 +104,7 @@ pyocd flash -t gd32e230c8t6 rtthread.bin
95
104
4 . 输入 ` scons -j12 ` 编译。
96
105
97
106
## 注意事项
98
- 1 . GD32E230资源受限,虽然通过调整参数极限运行msh ,但是意义不大,建议关闭。
107
+ 1 . GD32E230资源受限,虽然通过调整参数可以运行msh ,但是意义不大,建议关闭。
99
108
2 . ** GPIOA-13** 和 ** GPIOA-14** 默认用于 SWD 调试下载功能,建议不要配置为其它功能,否则将可能导致无法正常下载和调试。
100
109
101
110
## 联系人信息
Original file line number Diff line number Diff line change @@ -146,13 +146,35 @@ menu "On-chip Peripheral Drivers"
146
146
select RT_USING_I2C
147
147
default n
148
148
if BSP_USING_HW_I2C
149
- config BSP_USING_I2C0
149
+ config BSP_USING_HW_I2C0
150
150
bool "Enable I2C0"
151
151
default y
152
152
153
- config BSP_USING_I2C1
153
+ config BSP_HW_I2C0_CLOCK_SPEED
154
+ int "I2C0 Clock Speed (Hz)"
155
+ depends on BSP_USING_HW_I2C0
156
+ range 100000 1000000
157
+ default 400000
158
+ help
159
+ Set the I2C0 clock speed in Hz.
160
+ Standard mode: 100000 (100KHz)
161
+ Fast mode: 400000 (400KHz)
162
+ Fast mode plus: 1000000 (1MHz)
163
+
164
+ config BSP_USING_HW_I2C1
154
165
bool "Enable I2C1"
155
166
default n
167
+
168
+ config BSP_HW_I2C1_CLOCK_SPEED
169
+ int "I2C1 Clock Speed (Hz)"
170
+ depends on BSP_USING_HW_I2C1
171
+ range 100000 1000000
172
+ default 400000
173
+ help
174
+ Set the I2C1 clock speed in Hz.
175
+ Standard mode: 100000 (100KHz)
176
+ Fast mode: 400000 (400KHz)
177
+ Fast mode plus: 1000000 (1MHz)
156
178
endif
157
179
menuconfig BSP_USING_I2C0
158
180
bool "Enable I2C0 BUS (software simulation)"
Original file line number Diff line number Diff line change @@ -129,10 +129,6 @@ SECTIONS
129
129
130
130
/* Discard all debugging and comment sections using the correct wildcard syntax */
131
131
*(.comment)
132
- *(.debug*)
133
- *(.line)
134
- *(.stab)
135
- *(.stabstr)
136
132
*(.note.gnu.build-id)
137
133
*(.ARM.attributes)
138
134
}
Original file line number Diff line number Diff line change 61
61
62
62
/* end of rt_strnlen options */
63
63
/* end of klibc options */
64
- #define RT_NAME_MAX 8
64
+ #define RT_NAME_MAX 20
65
65
#define RT_CPUS_NR 1
66
66
#define RT_ALIGN_SIZE 8
67
67
#define RT_THREAD_PRIORITY_32
Original file line number Diff line number Diff line change 28
28
if os .getenv ('RTT_EXEC_PATH' ):
29
29
EXEC_PATH = os .getenv ('RTT_EXEC_PATH' )
30
30
31
- BUILD = 'release '
31
+ BUILD = 'debug '
32
32
33
33
if PLATFORM == 'gcc' :
34
34
# toolchains
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ if GetDepend(['RT_USING_SERIAL']):
23
23
if GetDepend (['RT_USING_I2C' , 'RT_USING_I2C_BITOPS' ]):
24
24
if GetDepend ('BSP_USING_I2C0' ) or GetDepend ('BSP_USING_I2C1' ) or GetDepend ('BSP_USING_I2C2' ) or GetDepend ('BSP_USING_I2C3' ):
25
25
src += ['drv_soft_i2c.c' ]
26
+
27
+ # add i2c hard drivers.
28
+ if GetDepend (['RT_USING_I2C' ]):
29
+ if GetDepend ('BSP_USING_HW_I2C0' ) or GetDepend ('BSP_USING_HW_I2C1' ):
30
+ src += ['drv_hw_i2c.c' ]
26
31
27
32
# add spi drivers.
28
33
if GetDepend ('RT_USING_SPI' ):
You can’t perform that action at this time.
0 commit comments