Skip to content

Commit 6d39418

Browse files
Gadgetoiddpgeorge
authored andcommitted
rp2: Add support for 48-pin RP2350 variant.
Update NUM_GPIOS to match NUM_BANK0_GPIOS, and increase bit-width of variables that store pin numbers. Signed-off-by: Phil Howard <phil@gadgetoid.com>
1 parent d2c85c7 commit 6d39418

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

ports/rp2/boards/make-pins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import boardgen
1010

1111
# This is NUM_BANK0_GPIOS. Pin indices are 0 to 29 (inclusive).
12-
NUM_GPIOS = 30
12+
NUM_GPIOS = 48
1313
# Up to 32 additional extended pins (e.g. via the wifi chip or io expanders).
1414
NUM_EXT_GPIOS = 32
1515

ports/rp2/machine_pin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static const mp_irq_methods_t machine_pin_irq_methods;
8989
extern const machine_pin_obj_t machine_pin_obj_table[NUM_BANK0_GPIOS];
9090

9191
// Mask with "1" indicating that the corresponding pin is in simulated open-drain mode.
92-
uint32_t machine_pin_open_drain_mask;
92+
uint64_t machine_pin_open_drain_mask;
9393

9494
#if MICROPY_HW_PIN_EXT_COUNT
9595
static inline bool is_ext_pin(__unused const machine_pin_obj_t *self) {

ports/rp2/machine_pin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct _machine_pin_af_obj_t {
4949
typedef struct _machine_pin_obj_t {
5050
mp_obj_base_t base;
5151
qstr name;
52-
uint8_t id : 5;
52+
uint8_t id : 6;
5353
#if MICROPY_HW_PIN_EXT_COUNT
5454
uint8_t is_ext : 1;
5555
uint8_t is_output : 1;

ports/rp2/mphalport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static inline mp_uint_t mp_hal_get_cpu_freq(void) {
119119
#define MP_HAL_PIN_PULL_UP (1)
120120
#define MP_HAL_PIN_PULL_DOWN (2)
121121

122-
extern uint32_t machine_pin_open_drain_mask;
122+
extern uint64_t machine_pin_open_drain_mask;
123123

124124
mp_hal_pin_obj_t mp_hal_get_pin_obj(mp_obj_t pin_in);
125125

0 commit comments

Comments
 (0)