|
|
@@ -88,6 +88,17 @@ void gd32_i2c_deinit(uint32_t i2c_index){
|
|
|
i2c_disable(device);
|
|
|
_i2c_deinit(device);
|
|
|
rcu_periph_clock_disable(RCU_I2C0);
|
|
|
+ if (device == I2C0) {
|
|
|
+ gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_8|GPIO_PIN_9);
|
|
|
+ gpio_output_options_set(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_8|GPIO_PIN_9);
|
|
|
+ gpio_bit_set(GPIOB, GPIO_PIN_8);
|
|
|
+ gpio_bit_set(GPIOB, GPIO_PIN_9);
|
|
|
+ } else {
|
|
|
+ gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_10|GPIO_PIN_11);
|
|
|
+ gpio_output_options_set(GPIOB, GPIO_OTYPE_OD, GPIO_OSPEED_50MHZ, GPIO_PIN_10|GPIO_PIN_11);
|
|
|
+ gpio_bit_set(GPIOB, GPIO_PIN_10);
|
|
|
+ gpio_bit_set(GPIOB, GPIO_PIN_11);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|