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>
This commit is contained in:
Phil Howard 2024-07-01 15:29:57 +01:00 committed by Damien George
parent d2c85c74da
commit 6d39418f69
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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;

View File

@ -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);