]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - drivers/arm/i2c_master.c
adding Hadron v3 keyboard, QWIIC devices support, haptic feedback support (#4462)
[qmk_firmware.git] / drivers / arm / i2c_master.c
index de584383922a46610540cc9c421420e1bfa144a9..ab962ea9599016351067d9078d42b9665c510089 100644 (file)
@@ -32,7 +32,7 @@
 
 static uint8_t i2c_address;
 
-// This configures the I2C clock to 400Mhz assuming a 72Mhz clock
+// This configures the I2C clock to 400khz assuming a 72Mhz clock
 // For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html
 static const I2CConfig i2cconfig = {
   STM32_TIMINGR_PRESC(15U) |
@@ -45,10 +45,14 @@ static const I2CConfig i2cconfig = {
 __attribute__ ((weak))
 void i2c_init(void)
 {
-  setPinInput(B6); // Try releasing special pins for a short time
-  setPinInput(B7);
-  chThdSleepMilliseconds(10);
+  //palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT);
+
+  // Try releasing special pins for a short time
+  palSetPadMode(GPIOB, 6, PAL_MODE_INPUT);
+  palSetPadMode(GPIOB, 7, PAL_MODE_INPUT);
 
+  chThdSleepMilliseconds(10);
   palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
   palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);