8000 Merge pull request #9826 from eightycc/issue-9808 · adafruit/circuitpython@5a74d91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a74d91

Browse files
authored
Merge pull request #9826 from eightycc/issue-9808
Support Pimoroni Pico Plus 2W
2 parents 72f6deb + 616962d commit 5a74d91

File tree

6 files changed

+144
-0
lines changed

6 files changed

+144
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Bob Abeles
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "supervisor/board.h"
8+
9+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
firmware_size = 1532k;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Bob Abeles
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#define MICROPY_HW_BOARD_NAME "Pimoroni Pico Plus 2 W"
8+
#define MICROPY_HW_MCU_NAME "rp2350b"
9+
10+
#define CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL (1)
11+
#define CIRCUITPY_DIGITALIO_HAVE_INVALID_DRIVE_MODE (1)
12+
13+
#define MICROPY_HW_LED_STATUS (&pin_CYW0)
14+
15+
#define CIRCUITPY_BOARD_I2C (1)
16+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}
17+
18+
#define CIRCUITPY_PSRAM_CHIP_SELECT (&pin_GPIO47)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
USB_VID = 0x2E8A
2+
USB_PID = 0x10BD
3+
USB_PRODUCT = "Pico Plus 2 W"
4+
USB_MANUFACTURER = "Pimoroni"
5+
6+
CHIP_VARIANT = RP2350
7+
CHIP_PACKAGE = B
8+
CHIP_FAMILY = rp2
9+
10+
EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ"
11+
12+
CIRCUITPY__EVE = 1
13+
14+
CIRCUITPY_CYW43 = 1
15+
CIRCUITPY_SSL = 1
16+
CIRCUITPY_HASHLIB = 1
17+
CIRCUITPY_WEB_WORKFLOW = 1
18+
CIRCUITPY_MDNS = 1
19+
CIRCUITPY_SOCKETPOOL = 1
20+
CIRCUITPY_WIFI = 1
21+
22+
# PIO clock divider set to 2 (default), consider changing if TM2 gSPI
23+
# becomes unreliable.
24+
CFLAGS += -DCYW43_PIN_WL_HOST_WAKE=24 \
25+
-DCYW43_PIN_WL_REG_ON=23 \
26+
-DCYW43_WL_GPIO_COUNT=3 \
27+
-DCYW43_WL_GPIO_LED_PIN=0 \
28+
-DCYW43_PIO_CLOCK_DIV_INT=2 \
29+
-DCYW43_PIO_CLOCK_DIV_FRAC=0
30+
# Must be accompanied by a linker script change
31+
CFLAGS += -DCIRCUITPY_FIRMWARE_SIZE='(1536 * 1024)'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Bob Abeles
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#pragma once
8+
9+
// Put board-specific pico-sdk definitions here. This file must exist.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Bob Abeles
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "shared-bindings/board/__init__.h"
8+
9+
static const mp_rom_map_elem_t board_module_globals_table[] = {
10+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
11+
12+
{ MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) },
13+
{ MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) },
14+
{ MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) },
15+
{ MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) },
16+
{ MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) },
17+
{ MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) },
18+
{ MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) },
19+
{ MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) },
20+
{ MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) },
21+
{ MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) },
22+
{ MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) },
23+
{ MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) },
24+
{ MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) },
25+
{ MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) },
26+
{ MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) },
27+
{ MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) },
28+
{ MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) },
29+
{ MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) },
30+
{ MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) },
31+
{ MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) },
32+
{ MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) },
33+
{ MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) },
34+
{ MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) },
35+
36+
// GP23, GP24, GP25, and GP29 are reserved for RM2 gSPI
37+
38+
{ MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) },
39+
{ MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) },
40+
{ MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) },
41+
42+
// GP30 through GP39 are unconnected
43+
44+
// GP40 through GP47 have analog input capability
45+
{ MP_ROM_QSTR(MP_QSTR_GP40_A0), MP_ROM_PTR(&pin_GPIO40) },
46+
{ MP_ROM_QSTR(MP_QSTR_GP40), MP_ROM_PTR(&pin_GPIO40) },
47+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO40) },
48+
49+
{ MP_ROM_QSTR(MP_QSTR_GP41_A1), MP_ROM_PTR(&pin_GPIO41) },
50+
{ MP_ROM_QSTR(MP_QSTR_GP41), MP_ROM_PTR(&pin_GPIO41) },
51+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO41) },
52+
53+
{ MP_ROM_QSTR(MP_QSTR_GP42_A2), MP_ROM_PTR(&pin_GPIO42) },
54+
{ MP_ROM_QSTR(MP_QSTR_GP42), MP_ROM_PTR(&pin_GPIO42) },
55+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO42) },
56+
57+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO43) },
58+
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO43) },
59+
60+
// GP44 is unconnected
61+
62+
{ MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO45) },
63+
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO45) },
64+
65+
// GP46 is unconnected
66+
// GP47 is reserved for PSRAM chip select
67+
68+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
69+
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
70+
71+
// Pins accessed though the RM2 module (CYW43439)
72+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_CYW0) },
73+
// CYW1 is unconnected
74+
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_CYW2) },
75+
};
76+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)
0