8000 rp2: Allow boards to configure I2C/SPI pins using new macros. by mcauser · Pull Request #7513 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

rp2: Allow boards to configure I2C/SPI pins using new macros. #7513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

mcauser
Copy link
Contributor
@mcauser mcauser commented Jul 9, 2021

Next steps, update each mpconfigboard.h in /ports/rp2/boards/* with the board's preferred pins. eg.

#define MICROPY_HW_I2C0_SCL (5)
#define MICROPY_HW_I2C0_SDA (4)

#define MICROPY_HW_I2C1_SCL (7)
#define MICROPY_HW_I2C1_SDA (6)
#define MICROPY_HW_SPI0_SCK     (6)
#define MICROPY_HW_SPI0_MOSI    (7)
#define MICROPY_HW_SPI0_MISO    (4)

#define MICROPY_HW_SPI1_SCK     (10)
#define MICROPY_HW_SPI1_MOSI    (11)
#define MICROPY_HW_SPI1_MISO    (8)

As mentioned in #7476 UART1 is currently defaulting to 4,5 which conflicts with the latest PICO pinout diagrams preferred pins.

Theres a PR which allows changing the default UART pins: #7503
Once that's merged, boards can put UART1 on 8,9 and give 4,5 to I2C0 and 19,16,18,17 to SPI0.

By having all UART, I2C and SPI default pins configurable, boards now have the freedom to pick and choose their favourites.

#define MICROPY_HW_UART0_TX  (0)
#define MICROPY_HW_UART0_RX  (1)
#define MICROPY_HW_UART0_CTS (2)
#define MICROPY_HW_UART0_RTS (3)

#define MICROPY_HW_UART0_TX  (8)
#define MICROPY_HW_UART0_RX  (9)

@mcauser mcauser changed the title rp2: Allow boards to configure I2C pins using new macros. rp2: Allow boards to configure I2C/SPI pins using new macros. Jul 9, 2021
@dpgeorge
Copy link
Member

Thank you!

Merged in 79da775 and cc77b30

@dpgeorge dpgeorge closed this Jul 19, 2021
@mcauser mcauser deleted the rp2-macros branch July 19, 2021 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0