-
Notifications
You must be signed in to change notification settings - Fork 476
Add SparkFun XRP Controller #2847
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
Merged
earlephilhower
merged 1 commit into
earlephilhower:master
from
sparkfun:add_sparkfun_xrp_controller
Mar 11, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "0x0046" | ||
} | ||
}, | ||
"core": "earlephilhower", | ||
"cpu": "cortex-m33", | ||
"extra_flags": "-DARDUINO_SPARKFUN_XRP_CONTROLLER -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1", | ||
"f_cpu": "150000000L", | ||
"hwids": [ | ||
[ | ||
"0x2E8A", | ||
"0x00C0" | ||
], | ||
[ | ||
"0x1B4F", | ||
"0x0046" | ||
] | ||
], | ||
"mcu": "rp2350", | ||
"variant": "sparkfun_xrp_controller" | ||
}, | ||
"debug": { | ||
"jlink_device": "RP2350_0", | ||
"openocd_target": "rp2350.cfg", | ||
"svd_path": "rp2350.svd" | ||
}, | ||
"frameworks": [ | ||
"arduino" | ||
], | ||
"name": "XRP Controller", | ||
"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.raspberrypi.org/products/raspberry-pi-pico/", | ||
"vendor": "SparkFun" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <earlephilhower@yahoo.com> | ||
|
||
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); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
Initialize the Pico W WiFi driver | ||
|
||
Copyright (c) 2022 Earle F. Philhower, III <earlephilhower@yahoo.com> | ||
|
||
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> | ||
|
||
extern "C" void initVariant() { | ||
static uint cyw43_pin_array[CYW43_PIN_INDEX_WL_COUNT] = { | ||
26, // CYW43_PIN_INDEX_WL_REG_ON | ||
29, // CYW43_PIN_INDEX_WL_DATA_OUT | ||
29, // CYW43_PIN_INDEX_WL_DATA_IN | ||
29, // CYW43_PIN_INDEX_WL_HOST_WAKE | ||
28, // CYW43_PIN_INDEX_WL_CLOCK | ||
27 // CYW43_PIN_INDEX_WL_CS | ||
}; | ||
cyw43_set_pins_wl(cyw43_pin_array); | ||
init_cyw43_wifi(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#pragma once | ||
|
||
#define PICO_RP2350A 0 | ||
|
||
#include <cyw43_wrappers.h> | ||
|
||
// XRP default pin names | ||
#define MOTOR_L_IN_1 (34u) | ||
#define MOTOR_L_IN_2 (35u) | ||
#define MOTOR_R_IN_1 (32u) | ||
#define MOTOR_R_IN_2 (33u) | ||
#define MOTOR_3_IN_1 (20u) | ||
#define MOTOR_3_IN_2 (21u) | ||
#define MOTOR_4_IN_1 (10u) | ||
#define MOTOR_4_IN_2 (11u) | ||
#define MOTOR_L_ENCODER_A (30u) | ||
#define MOTOR_L_ENCODER_B (31u) | ||
#define MOTOR_R_ENCODER_A (24u) | ||
#define MOTOR_R_ENCODER_B (25u) | ||
#define MOTOR_3_ENCODER_A (22u) | ||
#define MOTOR_3_ENCODER_B (23u) | ||
#define MOTOR_4_ENCODER_A (2u) | ||
#define MOTOR_4_ENCODER_B (3u) | ||
#define MOTOR_L_CURRENT (40u) | ||
#define MOTOR_R_CURRENT (43u) | ||
#define MOTOR_3_CURRENT (41u) | ||
#define MOTOR_4_CURRENT (42u) | ||
#define SERVO_1 (6u) | ||
#define SERVO_2 (9u) | ||
#define SERVO_3 (7u) | ||
#define SERVO_4 (8u) | ||
#define I2C_SDA_0 (4u) | ||
#define I2C_SCL_0 (5u) | ||
#define I2C_SDA_1 (38u) | ||
#define I2C_SCL_1 (39u) | ||
#define DISTANCE_TRIGGER (0u) | ||
#define DISTANCE_ECHO (1u) | ||
#define LINE_L (44u) | ||
#define LINE_R (45u) | ||
#define BOARD_VIN_MEASURE (46u) | ||
#define BOARD_USER_BUTTON (36u) | ||
#define BOARD_NEOPIXEL (37u) | ||
#define BOARD_LED (PIN_LED) | ||
|
||
// XRP alternate pin names | ||
#define ML_IN_1 (34u) | ||
#define ML_IN_2 (35u) | ||
#define MR_IN_1 (32u) | ||
#define MR_IN_2 (33u) | ||
#define M3_IN_1 (20u) | ||
#define M3_IN_2 (21u) | ||
#define M4_IN_1 (10u) | ||
#define M4_IN_2 (11u) | ||
#define ML_ENC_A (30u) | ||
#define ML_ENC_B (31u) | ||
#define MR_ENC_A (24u) | ||
#define MR_ENC_B (25u) | ||
#define M3_ENC_A (22u) | ||
#define M3_ENC_B (23u) | ||
#define M4_ENC_A (2u) | ||
#define M4_ENC_B (3u) | ||
#define ML_CUR (40u) | ||
#define MR_CUR (43u) | ||
#define M3_CUR (41u) | ||
#define M4_CUR (42u) | ||
#define S1 (6u) | ||
#define S2 (9u) | ||
#define S3 (7u) | ||
#define S4 (8u) | ||
#define SDA_0 (4u) | ||
#define SCL_0 (5u) | ||
#define SDA_1 (38u) | ||
#define SCL_1 (39u) | ||
#define RANGE_TRIGGER (0u) | ||
#define RANGE_ECHO (1u) | ||
#define REFLECTANCE_L (44u) | ||
#define REFLECTANCE_R (45u) | ||
#define BRD_VIN (46u) | ||
#define BRD_USR_BTN (36u) | ||
#define BRD_RGB_LED (37u) | ||
#define BRD_LED (PIN_LED) | ||
|
||
// LEDs | ||
#define PIN_LED (64u) | ||
|
||
#define PIN_NEOPIXEL (37) | ||
#define NUM_NEOPIXEL (1) | ||
|
||
// Serial | ||
#define PIN_SERIAL1_TX (12u) | ||
#define PIN_SERIAL1_RX (13u) | ||
|
||
#define PIN_SERIAL2_TX (8u) | ||
#define PIN_SERIAL2_RX (9u) | ||
|
||
// SPI | ||
#define PIN_SPI0_MISO (16u) | ||
#define PIN_SPI0_MOSI (19u) | ||
#define PIN_SPI0_SCK (18u) | ||
#define PIN_SPI0_SS (17u) | ||
|
||
#define PIN_SPI1_MISO (12u) | ||
#define PIN_SPI1_MOSI (15u) | ||
#define PIN_SPI1_SCK (14u) | ||
#define PIN_SPI1_SS (13u) | ||
|
||
// Wire | ||
#define PIN_WIRE0_SDA (4u) | ||
#define PIN_WIRE0_SCL (5u) | ||
|
||
#define PIN_WIRE1_SDA (38u) | ||
#define PIN_WIRE1_SCL (39u) | ||
|
||
#define SERIAL_HOWMANY (3u) | ||
#define SPI_HOWMANY (2u) | ||
#define WIRE_HOWMANY (2u) | ||
|
||
// PSRAM | ||
#define RP2350_PSRAM_CS (47u) | ||
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000) | ||
|
||
#include "../generic/common.h" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.