Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upcoming SparkFun IoT RedBoard RP2350 #2836

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
* Solder Party RP2040 Stamp
* Solder Party RP2350 Stamp
* Solder Party RP2350 Stamp XL
* SparkFun IoT RedBoard RP2350
* SparkFun MicroMod RP2040
* SparkFun ProMicro RP2040
* SparkFun ProMicro RP2350
Expand Down
346 changes: 346 additions & 0 deletions boards.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package/package_pico_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@
{
"name": "Solder Party RP2350 Stamp XL"
},
{
"name": "SparkFun IoT RedBoard RP2350"
},
{
"name": "SparkFun MicroMod RP2040"
},
Expand Down
56 changes: 56 additions & 0 deletions tools/json/sparkfun_iotredboard_rp2350.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "none.S",
"usb_vid": "0x1B4F",
"usb_pid": "0x0047"
}
},
"core": "earlephilhower",
"cpu": "cortex-m33",
"extra_flags": "-DARDUINO_SPARKFUN_IOTREDBOARD_RP2350 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1",
"f_cpu": "150000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x1B4F",
"0x0047"
]
],
"mcu": "rp2350",
"variant": "sparkfun_iotredboard_rp2350"
},
"debug": {
"jlink_device": "RP2350_0",
"openocd_target": "rp2350.cfg",
"svd_path": "rp2350.svd"
},
"frameworks": [
"arduino"
],
"name": "IoT RedBoard RP2350",
"upload": {
"maximum_ram_size": 524288,
"maximum_size": 16777216,
"require_upload_port": true,
"native_usb": true,
"use_1200bps_touch": true,
"wait_for_upload_port": false,
"protocol": "picotool",
"protocols": [
"blackmagic",
"cmsis-dap",
"jlink",
"raspberrypi-swd",
"picotool",
"picoprobe"
],
"psram_length": 8388608
},
"url": "https://www.sparkfun.com/sparkfun-iot-redboard-rp2350.html",
"vendor": "SparkFun"
}
1 change: 1 addition & 0 deletions tools/makeboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ def MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddef
MakeBoard("solderparty_rp2350_stamp_xl", "rp2350", "Solder Party", "RP2350 Stamp XL", "0x1209", "0xa184", 500, "SOLDERPARTY_RP2350_STAMP_XL", 16, 0, "none", None, "https://www.solder.party/docs/rp2350-stamp-xl/")

# SparkFun
MakeBoard("sparkfun_iotredboard_rp2350", "rp2350", "SparkFun", "IoT RedBoard RP2350", "0x1b4f", "0x0047", 250, "SPARKFUN_IOTREDBOARD_RP2350", 16, 8, "none", ["PICO_CYW43_SUPPORTED=1", "CYW43_PIN_WL_DYNAMIC=1"], "https://www.sparkfun.com/sparkfun-iot-redboard-rp2350.html")
MakeBoard("sparkfun_micromodrp2040", "rp2040", "SparkFun", "MicroMod RP2040", "0x1b4f", "0x0026", 250, "SPARKFUN_MICROMOD_RP2040", 16, 0, "boot2_w25q080_2_padded_checksum")
MakeBoard("sparkfun_promicrorp2040", "rp2040", "SparkFun", "ProMicro RP2040", "0x1b4f", "0x0026", 250, "SPARKFUN_PROMICRO_RP2040", 16, 0, "boot2_generic_03h_4_padded_checksum")
MakeBoard("sparkfun_promicrorp2350", "rp2350", "SparkFun", "ProMicro RP2350", "0x1b4f", "0x0026", 250, "SPARKFUN_PROMICRO_RP2350", 16, 8, "none")
Expand Down
33 changes: 33 additions & 0 deletions variants/sparkfun_iotredboard_rp2350/digital.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
pinMode and digitalRead/Write for the Raspberry Pi Pico W RP2040
Copyright (c) 2022 Earle F. Philhower, III <[email protected]>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "Arduino.h"
#include <cyw43_wrappers.h>

extern "C" void pinMode(pin_size_t pin, PinMode mode) {
cyw43_pinMode(pin, mode);
}

extern "C" void digitalWrite(pin_size_t pin, PinStatus val) {
cyw43_digitalWrite(pin, val);
}

extern "C" PinStatus digitalRead(pin_size_t pin) {
return cyw43_digitalRead(pin);
}
28 changes: 28 additions & 0 deletions variants/sparkfun_iotredboard_rp2350/init.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Initialize the Pico W WiFi driver

Copyright (c) 2022 Earle F. Philhower, III <[email protected]>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <cyw43_wrappers.h>
#include "pico/cyw43_driver.h"

extern "C" void initVariant() {
static uint cyw43_pin_array[CYW43_PIN_INDEX_WL_COUNT] = {24, 38, 38, 38, 37, 36};
cyw43_set_pins_wl(cyw43_pin_array);
init_cyw43_wifi();
}
169 changes: 169 additions & 0 deletions variants/sparkfun_iotredboard_rp2350/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
#pragma once

#include <stdint.h>
#include <cyw43_wrappers.h>

#define PICO_RP2350B 1
#define PICO_RP2350A 0

#define PINS_COUNT (48u)
#define NUM_DIGITAL_PINS (48u)
#define NUM_ANALOG_INPUTS (7u)
#define NUM_ANALOG_OUTPUTS (0u)
#define ADC_RESOLUTION (12u)

// LEDs
#define PIN_LED (25u)
#define LED_BUILTIN PIN_LED

#define PIN_WL_LED (64u)

#define PIN_NEOPIXEL (3u)
#define NUM_NEOPIXEL (1u)

// Serial
#define PIN_SERIAL1_TX (0u)
#define PIN_SERIAL1_RX (1u)

#define PIN_SERIAL2_TX (40u)
#define PIN_SERIAL2_RX (41u)

// External SPI
#define PIN_SPI0_MISO (20u)
#define PIN_SPI0_MOSI (23u)
#define PIN_SPI0_SCK (22u)
#define PIN_SPI0_SS (21u) // CS pin for External SPI.

#define PIN_SPI0_POCI PIN_SPI0_MISO
#define PIN_SPI0_PICO PIN_SPI0_MOSI
#define PIN_SPI0_CS PIN_SPI0_SS

// SD Card SPI
#define PIN_SPI1_MISO (8u)
#define PIN_SPI1_MOSI (11u)
#define PIN_SPI1_SCK (10u)
#define PIN_SPI1_SS (9u) // CS pin for SD card.

#define PIN_SPI1_POCI PIN_SPI1_MISO
#define PIN_SPI1_PICO PIN_SPI1_MOSI
#define PIN_SPI1_CS PIN_SPI1_SS

// Wire
#define PIN_WIRE0_SDA (4u)
#define PIN_WIRE0_SCL (5u)

#define PIN_WIRE1_SDA (30u)
#define PIN_WIRE1_SCL (31u)

#define SERIAL_HOWMANY (3u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (2u)
#define WIRE_INTERFACES_COUNT (WIRE_HOWMANY)

// PSRAM
#define RP2350_PSRAM_CS (47u)
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000)

/* Pin mappings for marked pins on the board */
// UART0
static const uint8_t D0 = (0u);
static const uint8_t D1 = (1u);

// I2C0
static const uint8_t D4 = (4u);
static const uint8_t D5 = (5u);

// SD Card/SPI1
static const uint8_t D8 = (8u);
static const uint8_t D9 = (9u);
static const uint8_t D10 = (10u);
static const uint8_t D11 = (11u);

// HSTX GPIO
static const uint8_t D12 = (12u);
static const uint8_t D13 = (13u);
static const uint8_t D14 = (14u);
static const uint8_t D15 = (15u);
static const uint8_t D16 = (16u);
static const uint8_t D17 = (17u);
static const uint8_t D18 = (18u);
static const uint8_t D19 = (19u);

// SPI0
static const uint8_t D20 = (20u);
static const uint8_t D21 = (21u);
static const uint8_t D22 = (22u);
static const uint8_t D23 = (23u);

// External GPIO
static const uint8_t D28 = (28u);
static const uint8_t D29 = (29u);
static const uint8_t D30 = (30u);
static const uint8_t D31 = (31u);
static const uint8_t D32 = (32u);
static const uint8_t D33 = (33u);
static const uint8_t D34 = (34u);
static const uint8_t D35 = (35u);

// Analog Inputs are also digital capable.
static const uint8_t D40 = (40u);
static const uint8_t D41 = (41u);
static const uint8_t D42 = (42u);
static const uint8_t D43 = (43u);
static const uint8_t D44 = (44u);
static const uint8_t D45 = (45u);

static const uint8_t A0 = (40u);
static const uint8_t A1 = (41u);
static const uint8_t A2 = (42u);
static const uint8_t A3 = (43u);
static const uint8_t A4 = (44u);
static const uint8_t A5 = (45u);

// SD Card detect - Active Low
static const uint8_t SD_DET_N = (2u);

// RGB LED data pin
static const uint8_t RGB_LED = (3u);

// Low battery alert - Active Low
static const uint8_t BATT_ALRT_N = (6u);

// Power enable for peripherals - qwiic, sd, rgb. Default HIGH via HW jumper.
static const uint8_t PERIPHERAL_POWER_ENABLE = (7u);

// WiFi power GPIO
static const uint8_t WRL_ON = (24u);

// aka STAT LED
static const uint8_t D25 = (25u);

// Power status inputs
static const uint8_t POWER_SRC_5V = (26u);
static const uint8_t BATT_POWER = (27u);

// User button
static const uint8_t USER_SW = (39u);

// Input voltage measurement
static const uint8_t VIN_MEAS = (46u);

static const uint8_t SS = PIN_SPI0_SS;
static const uint8_t CS = PIN_SPI0_CS;

static const uint8_t MOSI = PIN_SPI0_MOSI;
static const uint8_t PICO = PIN_SPI0_PICO;

static const uint8_t MISO = PIN_SPI0_MISO;
static const uint8_t POCI = PIN_SPI0_POCI;

static const uint8_t SCK = PIN_SPI0_SCK;

static const uint8_t SDA = PIN_WIRE0_SDA;
static const uint8_t SCL = PIN_WIRE0_SCL;

static const uint8_t SDA1 = PIN_WIRE1_SDA;
static const uint8_t SCL1 = PIN_WIRE1_SCL;

static const uint8_t RX = PIN_SERIAL1_RX;
static const uint8_t TX = PIN_SERIAL1_TX;