aboutsummaryrefslogtreecommitdiff
path: root/docs/drivers/i2c.md
diff options
context:
space:
mode:
authorQMK Bot <[email protected]>2024-11-14 18:00:36 +0000
committerQMK Bot <[email protected]>2024-11-14 18:00:36 +0000
commit79a661fe61f28e2df76b94f36f0cc3366f088f70 (patch)
tree640dfe2af0b851fa4c303e48be8ee9771ae4847a /docs/drivers/i2c.md
parent0bda0f47754d01aa904f9831ff58ef760807ab16 (diff)
parent46236ce3de8385f27e3f13a9921abee7e1e0fa57 (diff)
downloadqmk_firmware-79a661fe61f28e2df76b94f36f0cc3366f088f70.tar.gz
qmk_firmware-79a661fe61f28e2df76b94f36f0cc3366f088f70.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'docs/drivers/i2c.md')
-rw-r--r--docs/drivers/i2c.md21
1 files changed, 14 insertions, 7 deletions
diff --git a/docs/drivers/i2c.md b/docs/drivers/i2c.md
index 10949ed59e..c806a090c5 100644
--- a/docs/drivers/i2c.md
+++ b/docs/drivers/i2c.md
@@ -54,18 +54,25 @@ The ATmega16/32U2 does not possess I2C functionality, and so cannot use this dri
You'll need to determine which pins can be used for I2C -- a an example, STM32 parts generally have multiple I2C peripherals, labeled I2C1, I2C2, I2C3 etc.
-To enable I2C, modify your board's `halconf.h` to enable I2C:
+To enable I2C, modify your board's `halconf.h` to enable I2C, then modify your board's `mcuconf.h` to enable the peripheral you've chosen:
-```c
-#define HAL_USE_I2C TRUE
+::: code-group
+```c [halconf.h]
+#pragma once
+
+#define HAL_USE_I2C TRUE // [!code focus]
+
+#include_next <halconf.h>
```
+```c [mcuconf.h]
+#pragma once
-Then, modify your board's `mcuconf.h` to enable the peripheral you've chosen, for example:
+#include_next <mcuconf.h>
-```c
-#undef STM32_I2C_USE_I2C2
-#define STM32_I2C_USE_I2C2 TRUE
+#undef STM32_I2C_USE_I2C2 // [!code focus]
+#define STM32_I2C_USE_I2C2 TRUE // [!code focus]
```
+:::
|`mcuconf.h` Setting |Description |Default|
|----------------------------|----------------------------------------------------------------------------------|-------|