arduino-pico/variants/sparkfun_iotnode_lorawanrp2350/pins_arduino.h
Earle F. Philhower, III e05dd50d62
Convert to SDK RP2350A/B determination (#2898)
* Convert to SDK RP2350A/B determination

Fixes #2878

The SDK uses `defined(PICO_RP2350) && !PICO_RP2350A` to indicate an RP2350B
chip, not the define PICO_RP2350B.

Match the SDK's usage by converting from `defined(PICO_RP2350B)` to
`defined(PICO_RP2350) && !PICO_RP2350A` and update the chip variants
accordingly.

* Need to explicitly override PICO_RP2350A for all

The *SDK*'s board definition file hardcodes a PICO_RP2350A value for
all boards, but we use the same board file for both A and B variants.
Override the SDK board definition in the variant definition file.

* Generic RP2350 needs 2-stage PICO_RP2350A setting

Also ensure SDK board definition included before pins_arduino.h for
clearing up redefinition errors.

* Factor out undef PICO_RP2350A

* Update Arduino.h
2025-04-08 16:02:54 -07:00

49 lines
984 B
C

#pragma once
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (25u)
#define PIN_NEOPIXEL (25)
#define NUM_NEOPIXEL (1)
// UARTs
#define PIN_SERIAL1_TX (18u)
#define PIN_SERIAL1_RX (19u)
#define PIN_SERIAL2_TX (8u)
#define PIN_SERIAL2_RX (9u)
// SPI
#define PIN_SPI0_MISO (12u)
#define PIN_SPI0_MOSI (15u)
#define PIN_SPI0_SCK (14u)
#define PIN_SPI0_SS (13u)
#define PIN_SPI1_MISO (31u)
#define PIN_SPI1_MOSI (31u)
#define PIN_SPI1_SCK (31u)
#define PIN_SPI1_SS (31u) // not pinned out
// The board uses SPI1 for uSD card, make that the default
#ifndef __SPI0_DEVICE
#define __SPI0_DEVICE spi1
#endif
#ifndef __SPI1_DEVICE
#define __SPI1_DEVICE spi0
#endif
// Wire
#define PIN_WIRE0_SDA (20u)
#define PIN_WIRE0_SCL (21u)
#define PIN_WIRE1_SDA (31u)
#define PIN_WIRE1_SCL (31u)
#define SERIAL_HOWMANY (3u)
#define SPI_HOWMANY (1u)
#define WIRE_HOWMANY (1u)
// PSRAM
#define RP2350_PSRAM_CS (0u)
#define RP2350_PSRAM_MAX_SCK_HZ (109 * 1000 * 1000)
#include "../generic/common.h"