Skip to content

Commit

Permalink
RP2040: update i2c drivers to reflect peripheral number
Browse files Browse the repository at this point in the history
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 missmatch.
  • Loading branch information
KarlK90 committed Dec 9, 2022
1 parent aa12996 commit 04d4cc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions os/hal/ports/RP/LLD/I2Cv1/hal_i2c_lld.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
* @brief I2C1 driver identifier.
*/
#if (RP_I2C_USE_I2C0 == TRUE) || defined(__DOXYGEN__)
I2CDriver I2CD1;
I2CDriver I2CD0;
#endif

/**
* @brief I2C2 driver identifier.
*/
#if (RP_I2C_USE_I2C1 == TRUE) || defined(__DOXYGEN__)
I2CDriver I2CD2;
I2CDriver I2CD1;
#endif

/*===========================================================================*/
Expand Down
3 changes: 1 addition & 2 deletions testhal/RP/RP2040/RT-RP2040-PICO-I2C-24AA01/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#define I2C0_SDA_PIN 12U
#define I2C0_SCL_PIN 13U

// This is I2C0
#define I2CN I2CD1
#define I2CN I2CD0

/*
* Green LED blinker thread, times are in milliseconds.
Expand Down

0 comments on commit 04d4cc9

Please sign in to comment.