From 3afdd961b8d2d7a4099ff7283b2148ccdbbf1798 Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Fri, 9 Dec 2022 11:08:45 +0100 Subject: [PATCH] RP2040: update i2c drivers to reflect peripheral number RP2040 i2c peripherals are numbered starting from zero, therefore the drivers shall follow the same numbering e.g. I2C0 uses the driver I2CD0. This commit fixes the current miss match. --- docs/platformdev_rp2040.md | 6 +++--- keyboards/1upkeyboards/pi40/config.h | 4 ++-- keyboards/anavi/knob1/config.h | 2 +- keyboards/boardsource/lulu/rp2040/config.h | 2 +- keyboards/controllerworks/mini36/config.h | 2 +- keyboards/controllerworks/mini42/config.h | 2 +- keyboards/handwired/onekey/kb2040/config.h | 2 +- keyboards/keebio/sinc/rev3/config.h | 2 +- lib/chibios-contrib | 2 +- .../chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h | 2 +- platforms/chibios/boards/QMK_PM2040/configs/config.h | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/platformdev_rp2040.md b/docs/platformdev_rp2040.md index 3a6f1a16834d..11a93edd8913 100644 --- a/docs/platformdev_rp2040.md +++ b/docs/platformdev_rp2040.md @@ -38,8 +38,8 @@ QMK RP2040 support builds upon ChibiOS and thus follows their convention for act | RP2040 Peripheral | `mcuconf.h` values | `I2C_DRIVER` | | ----------------- | ------------------ | ------------ | -| `I2C0` | `RP_I2C_USE_I2C0` | `I2CD1` | -| `I2C1` | `RP_I2C_USE_I2C1` | `I2CD2` | +| `I2C0` | `RP_I2C_USE_I2C0` | `I2CD0` | +| `I2C1` | `RP_I2C_USE_I2C1` | `I2CD1` | To configure the I2C driver please read the [ChibiOS/ARM](i2c_driver.md#arm-configuration) section. @@ -74,7 +74,7 @@ This is the default board that is chosen, unless any other RP2040 board is selec | Driver configuration define | Value | | -------------------------------------------------------------------------- | ------------------------------------ | | **I2C driver** | | -| `I2C_DRIVER` | `I2CD2` | +| `I2C_DRIVER` | `I2CD1` | | `I2C1_SDA_PIN` | `GP2` | | `I2C1_SCL_PIN` | `GP3` | | **SPI driver** | | diff --git a/keyboards/1upkeyboards/pi40/config.h b/keyboards/1upkeyboards/pi40/config.h index 5e0d0e12ae41..ce632932698e 100644 --- a/keyboards/1upkeyboards/pi40/config.h +++ b/keyboards/1upkeyboards/pi40/config.h @@ -11,7 +11,7 @@ # define OLED_DISPLAY_128X32 #define I2C1_SCL_PIN GP17 #define I2C1_SDA_PIN GP16 -#define I2C_DRIVER I2CD1 +#define I2C_DRIVER I2CD0 #define OLED_BRIGHTNESS 128 #define OLED_FONT_H "keyboards/1upkeyboards/pi40/lib/glcdfont.c" #endif @@ -96,4 +96,4 @@ /* Bootmagic Lite key configuration */ #define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 0 \ No newline at end of file +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/anavi/knob1/config.h b/keyboards/anavi/knob1/config.h index f677aa9b2331..178e0f45ca7a 100644 --- a/keyboards/anavi/knob1/config.h +++ b/keyboards/anavi/knob1/config.h @@ -23,7 +23,7 @@ #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U -#define I2C_DRIVER I2CD2 +#define I2C_DRIVER I2CD1 #define I2C1_SDA_PIN GP6 #define I2C1_SCL_PIN GP7 diff --git a/keyboards/boardsource/lulu/rp2040/config.h b/keyboards/boardsource/lulu/rp2040/config.h index 2e02e0350084..2c86e48e6f28 100644 --- a/keyboards/boardsource/lulu/rp2040/config.h +++ b/keyboards/boardsource/lulu/rp2040/config.h @@ -6,6 +6,6 @@ #define SERIAL_USART_FULL_DUPLEX #define SERIAL_USART_TX_PIN GP0 #define SERIAL_USART_RX_PIN GP1 -#define I2C_DRIVER I2CD2 +#define I2C_DRIVER I2CD1 #define I2C1_SDA_PIN GP22 #define I2C1_SCL_PIN GP23 diff --git a/keyboards/controllerworks/mini36/config.h b/keyboards/controllerworks/mini36/config.h index 090353483854..c4f428d36667 100644 --- a/keyboards/controllerworks/mini36/config.h +++ b/keyboards/controllerworks/mini36/config.h @@ -33,6 +33,6 @@ #define SPLIT_LED_STATE_ENABLE #define SPLIT_MODS_ENABLE -#define I2C_DRIVER I2CD1 +#define I2C_DRIVER I2CD0 #define I2C1_SCL_PIN GP25 #define I2C1_SDA_PIN GP24 diff --git a/keyboards/controllerworks/mini42/config.h b/keyboards/controllerworks/mini42/config.h index 420e616ad29e..ad01588e559b 100644 --- a/keyboards/controllerworks/mini42/config.h +++ b/keyboards/controllerworks/mini42/config.h @@ -27,7 +27,7 @@ #define SPLIT_MODS_ENABLE #undef I2C_DRIVER -#define I2C_DRIVER I2CD1 +#define I2C_DRIVER I2CD0 #undef I2C1_SCL_PIN #define I2C1_SCL_PIN GP25 #undef I2C1_SDA_PIN diff --git a/keyboards/handwired/onekey/kb2040/config.h b/keyboards/handwired/onekey/kb2040/config.h index c6c6dbe2cf80..20a41b162424 100644 --- a/keyboards/handwired/onekey/kb2040/config.h +++ b/keyboards/handwired/onekey/kb2040/config.h @@ -16,7 +16,7 @@ // settings for the oled keyboard demo with Adafruit 0.91" OLED display on the Stemma QT port #define OLED_DISPLAY_128X32 -#define I2C_DRIVER I2CD1 +#define I2C_DRIVER I2CD0 #define I2C1_SDA_PIN GP12 #define I2C1_SCL_PIN GP13 diff --git a/keyboards/keebio/sinc/rev3/config.h b/keyboards/keebio/sinc/rev3/config.h index 14ce6d29f1c2..9b27501d3c02 100644 --- a/keyboards/keebio/sinc/rev3/config.h +++ b/keyboards/keebio/sinc/rev3/config.h @@ -23,7 +23,7 @@ along with this program. If not, see . #define SERIAL_USART_PIN_SWAP #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U -#define I2C_DRIVER I2CD2 +#define I2C_DRIVER I2CD1 #define I2C1_SCL_PIN GP22 #define I2C1_SDA_PIN GP23 diff --git a/lib/chibios-contrib b/lib/chibios-contrib index bb8356fb5a3a..1130173eae6b 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit bb8356fb5a3a9bbc1561826f174a9a631c614546 +Subproject commit 1130173eae6b7402443aff18ad68228acbe25cc4 diff --git a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h index 7fe9b654e1b1..9209e99e760c 100644 --- a/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h +++ b/platforms/chibios/boards/GENERIC_PROMICRO_RP2040/configs/config.h @@ -8,7 +8,7 @@ *========================**/ #if !defined(I2C_DRIVER) -# define I2C_DRIVER I2CD2 +# define I2C_DRIVER I2CD1 #endif #if !defined(I2C1_SDA_PIN) diff --git a/platforms/chibios/boards/QMK_PM2040/configs/config.h b/platforms/chibios/boards/QMK_PM2040/configs/config.h index 8c773f8b1932..ec85ae0cf403 100644 --- a/platforms/chibios/boards/QMK_PM2040/configs/config.h +++ b/platforms/chibios/boards/QMK_PM2040/configs/config.h @@ -4,7 +4,7 @@ #pragma once #ifndef I2C_DRIVER -# define I2C_DRIVER I2CD2 +# define I2C_DRIVER I2CD1 #endif #ifndef I2C1_SDA_PIN # define I2C1_SDA_PIN D1