Browse Source

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>
pull/15619/head
Phil Howard 4 months ago
committed by Damien George
parent
commit
6d39418f69
  1. 2
      ports/rp2/boards/make-pins.py
  2. 2
      ports/rp2/machine_pin.c
  3. 2
      ports/rp2/machine_pin.h
  4. 2
      ports/rp2/mphalport.h

2
ports/rp2/boards/make-pins.py

@ -9,7 +9,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../../tools"))
import boardgen
# This is NUM_BANK0_GPIOS. Pin indices are 0 to 29 (inclusive).
NUM_GPIOS = 30
NUM_GPIOS = 48
# Up to 32 additional extended pins (e.g. via the wifi chip or io expanders).
NUM_EXT_GPIOS = 32

2
ports/rp2/machine_pin.c

@ -89,7 +89,7 @@ static const mp_irq_methods_t machine_pin_irq_methods;
extern const machine_pin_obj_t machine_pin_obj_table[NUM_BANK0_GPIOS];
// Mask with "1" indicating that the corresponding pin is in simulated open-drain mode.
uint32_t machine_pin_open_drain_mask;
uint64_t machine_pin_open_drain_mask;
#if MICROPY_HW_PIN_EXT_COUNT
static inline bool is_ext_pin(__unused const machine_pin_obj_t *self) {

2
ports/rp2/machine_pin.h

@ -49,7 +49,7 @@ typedef struct _machine_pin_af_obj_t {
typedef struct _machine_pin_obj_t {
mp_obj_base_t base;
qstr name;
uint8_t id : 5;
uint8_t id : 6;
#if MICROPY_HW_PIN_EXT_COUNT
uint8_t is_ext : 1;
uint8_t is_output : 1;

2
ports/rp2/mphalport.h

@ -119,7 +119,7 @@ static inline mp_uint_t mp_hal_get_cpu_freq(void) {
#define MP_HAL_PIN_PULL_UP (1)
#define MP_HAL_PIN_PULL_DOWN (2)
extern uint32_t machine_pin_open_drain_mask;
extern uint64_t machine_pin_open_drain_mask;
mp_hal_pin_obj_t mp_hal_get_pin_obj(mp_obj_t pin_in);

Loading…
Cancel
Save