aboutsummaryrefslogtreecommitdiff
path: root/drivers/arm/i2c_master.c
diff options
context:
space:
mode:
authorishtob <ishtob@gmail.com>2018-12-04 11:04:57 -0500
committerDrashna Jaelre <drashna@live.com>2018-12-04 08:04:57 -0800
commit4099536c0e7a099b181a80e483b4b95f389b5a7e (patch)
tree311c8a15013cce5ee9275fe8654c9b52dc9ca1e2 /drivers/arm/i2c_master.c
parent4bb28d2df092408a7a0e32a8d8ab47b7f4008fcd (diff)
downloadqmk_firmware-4099536c0e7a099b181a80e483b4b95f389b5a7e.tar.gz
qmk_firmware-4099536c0e7a099b181a80e483b4b95f389b5a7e.zip
adding Hadron v3 keyboard, QWIIC devices support, haptic feedback support (#4462)
* add initial support for hadron ver3 * add initial support for hadron ver3 * pull qwiic support for micro_led to be modified for use in hadron's 64x24 ssd1306 oled display * initial work on OLED using qwiic driver * early work to get 128x32 oled working by redefining qwiic micro oled parameters. Currently working, but would affect qwiic's micro oled functionality * moved oled defines to config.h and added ifndef to micro_oled driver * WORKING :D - note, still work in progress to get the start location correct on the 128x32 display. * added equation to automatically calculate display offset based on screen width * adding time-out timer to oled display * changed read lock staus via read_led_state * lock indications fixes * Added scroll lock indication to oled * add support for DRV2605 haptic driver * Improve readabiity of DRV2605 driver. -added typedef for waveform library -added unions for registers * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Fixes for PR * PR fixes * fix old persistent layer function to use new set_single_persistent_default_layer * fix issues with changing makefile defines that broken per-key haptic pulse * Comment fixes * Add definable parameter and auto-calibration based on motor choice
Diffstat (limited to 'drivers/arm/i2c_master.c')
-rw-r--r--drivers/arm/i2c_master.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c
index de5843839..ab962ea95 100644
--- a/drivers/arm/i2c_master.c
+++ b/drivers/arm/i2c_master.c
@@ -32,7 +32,7 @@
32 32
33static uint8_t i2c_address; 33static uint8_t i2c_address;
34 34
35// This configures the I2C clock to 400Mhz assuming a 72Mhz clock 35// This configures the I2C clock to 400khz assuming a 72Mhz clock
36// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html 36// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html
37static const I2CConfig i2cconfig = { 37static const I2CConfig i2cconfig = {
38 STM32_TIMINGR_PRESC(15U) | 38 STM32_TIMINGR_PRESC(15U) |
@@ -45,10 +45,14 @@ static const I2CConfig i2cconfig = {
45__attribute__ ((weak)) 45__attribute__ ((weak))
46void i2c_init(void) 46void i2c_init(void)
47{ 47{
48 setPinInput(B6); // Try releasing special pins for a short time 48 //palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT);
49 setPinInput(B7); 49
50 chThdSleepMilliseconds(10); 50 // Try releasing special pins for a short time
51 palSetPadMode(GPIOB, 6, PAL_MODE_INPUT);
52 palSetPadMode(GPIOB, 7, PAL_MODE_INPUT);
51 53
54 chThdSleepMilliseconds(10);
55
52 palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); 56 palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
53 palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); 57 palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
54 58