aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGravatar yiancar <yiangosyiangou@cytanet.com.cy>2018-11-10 12:26:39 -0800
committerGravatar Jack Humbert <jack.humb@gmail.com>2018-11-10 15:26:39 -0500
commit408361402385ea938575956e9368b5f373edc629 (patch)
tree2ce9bc847d66296848bdfe39b15de549058d966d /drivers
parent3ba242cc3f5db93b14f0939f056e9aa759a43efe (diff)
downloadqmk_firmware-408361402385ea938575956e9368b5f373edc629.tar.gz
I2C driver docs (#4298)
* I2C driver docs - Added I2C driver docs. - Changed arm master i2c driver to have a weak i2c_init as it is impossible to account for all possible port configuration in the STM32 world. * Update docs/i2c_driver.md Co-Authored-By: yiancar <yiangosyiangou@cytanet.com.cy> * Update docs/i2c_driver.md Co-Authored-By: yiancar <yiangosyiangou@cytanet.com.cy> * Update docs/i2c_driver.md Co-Authored-By: yiancar <yiangosyiangou@cytanet.com.cy> * Update docs/i2c_driver.md Co-Authored-By: yiancar <yiangosyiangou@cytanet.com.cy> * GPIO release fix
Diffstat (limited to 'drivers')
-rw-r--r--drivers/arm/i2c_master.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c
index 2a7badd35..de5843839 100644
--- a/drivers/arm/i2c_master.c
+++ b/drivers/arm/i2c_master.c
@@ -26,6 +26,7 @@
*/
#include "i2c_master.h"
+#include "quantum.h"
#include <string.h>
#include <hal.h>
@@ -41,9 +42,11 @@ static const I2CConfig i2cconfig = {
0
};
+__attribute__ ((weak))
void i2c_init(void)
{
- palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time
+ setPinInput(B6); // Try releasing special pins for a short time
+ setPinInput(B7);
chThdSleepMilliseconds(10);
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);