@@ -56,26 +56,6 @@ menu "On-chip Peripheral Drivers"
5656 depends on BSP_USING_UART2
5757 select RT_SERIAL_USING_DMA
5858 default n
59-
60- config BSP_USING_UART3
61- bool "Enable UART3"
62- default n
63-
64- config BSP_UART3_RX_USING_DMA
65- bool "Enable UART3 RX DMA"
66- depends on BSP_USING_UART3
67- select RT_SERIAL_USING_DMA
68- default n
69-
70- config BSP_USING_UART4
71- bool "Enable UART4"
72- default n
73-
74- config BSP_UART4_RX_USING_DMA
75- bool "Enable UART4 RX DMA"
76- depends on BSP_USING_UART4
77- select RT_SERIAL_USING_DMA
78- default n
7959 endif
8060
8161 menuconfig BSP_USING_PWM
@@ -99,8 +79,63 @@ menu "On-chip Peripheral Drivers"
9979 bool "Enable PWM16"
10080 default n
10181 endif
82+ menuconfig BSP_USING_HW_I2C
83+ bool "Enable Hardware I2C"
84+ default n
85+ select RT_USING_I2C
86+ if BSP_USING_HW_I2C
87+ config BSP_USING_HW_I2C0
88+ bool "Enable Hardware I2C0"
89+ default n
10290
91+ # config i2c0 pins
92+ choice
93+ prompt "Select I2C0 pins"
94+ depends on BSP_USING_HW_I2C0
95+ config BSP_HW_I2C0_PIN_PA2_PA3
96+ bool "SCL=PA2, SDA=PA3"
97+ config BSP_HW_I2C0_PIN_PA15_PC8
98+ bool "SCL=PA15, SDA=PC8"
99+ config BSP_HW_I2C0_PIN_PB0_PB1
100+ bool "SCL=PB0, SDA=PB1"
101+ config BSP_HW_I2C0_PIN_PB15_PA8
102+ bool "SCL=PB15, SDA=PA8"
103+ endchoice
104+
105+ # config i2c0 clock
106+ config BSP_HW_I2C0_CLK
107+ int "I2C0 clock frequency(KHz)"
108+ default 100
109+ depends on BSP_USING_HW_I2C0
110+ range 10 1000
111+
112+ config BSP_USING_HW_I2C1
113+ bool "Enable Hardware I2C1"
114+ default n
103115
116+ # config i2c1 pins
117+ choice
118+ prompt "Select I2C1 pins"
119+ depends on BSP_USING_HW_I2C1
120+ config BSP_HW_I2C1_PIN_PA6_PA7
121+ bool "SCL=PA6, SDA=PA7"
122+ config BSP_HW_I2C1_PIN_PA13_PA14
123+ bool "SCL=PA13, SDA=PA14"
124+ config BSP_HW_I2C1_PIN_PA15_PC8
125+ bool "SCL=PA15, SDA=PC8"
126+ config BSP_HW_I2C1_PIN_PB12_PB13
127+ bool "SCL=PB12, SDA=PB13"
128+ config BSP_HW_I2C1_PIN_PB15_PA8
129+ bool "SCL=PB15, SDA=PA8"
130+ endchoice
131+
132+ # config i2c1 clock
133+ config BSP_HW_I2C1_CLK
134+ int "I2C1 clock frequency(KHz)"
135+ default 100
136+ depends on BSP_USING_HW_I2C1
137+ range 10 1000
138+ endif
104139
105140 source "$(BSP_DIR)/../libraries/gd32_drivers/Kconfig"
106141
0 commit comments