Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e60858c327 | ||
|
|
bebd1dff50 | ||
|
|
14145e4469 | ||
|
|
d9d556bcd0 | ||
|
|
5bd1a3a0f6 | ||
|
|
5bfc35caf5 | ||
|
|
8e1e709ab1 | ||
|
|
46a58fb4b5 | ||
|
|
8deb6b9724 | ||
|
|
6236d1f7c5 | ||
|
|
91ce323a68 | ||
|
|
2f82bfd22a | ||
|
|
1689c75ef1 | ||
|
|
935eb64a8e |
@@ -69,6 +69,8 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
|
||||
* Melopero Cookie RP2040
|
||||
* Melopero Shake RP2040
|
||||
* METE HOCA Akana R1
|
||||
* Makerbase MKSTHR36
|
||||
* Makerbase MKSTHR42
|
||||
* MyMakers RP2040
|
||||
* Neko Systems BL2040 Mini
|
||||
* Newsan Archi
|
||||
@@ -93,11 +95,13 @@ 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
|
||||
* SparkFun Thing Plus RP2040
|
||||
* SparkFun Thing Plus RP2350
|
||||
* SparkFun XRP Controller
|
||||
* uPesy RP2040 DevKit
|
||||
* VCC-GND YD-RP2040
|
||||
* Viyalab Mizu RP2040
|
||||
|
||||
+1957
-564
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#define ARDUINO_PICO_MAJOR 4
|
||||
#define ARDUINO_PICO_MINOR 4
|
||||
#define ARDUINO_PICO_REVISION 4
|
||||
#define ARDUINO_PICO_VERSION_STR "4.4.4"
|
||||
#define ARDUINO_PICO_MINOR 5
|
||||
#define ARDUINO_PICO_REVISION 0
|
||||
#define ARDUINO_PICO_VERSION_STR "4.5.0"
|
||||
|
||||
@@ -32,15 +32,20 @@ extern void serialEvent1() __attribute__((weak));
|
||||
extern void serialEvent2() __attribute__((weak));
|
||||
|
||||
bool SerialUART::setRX(pin_size_t pin) {
|
||||
#ifdef PICO_RP2350B
|
||||
constexpr uint64_t valid[2] = { __bitset({1, 13, 17, 29, 33, 45}) /* UART0 */,
|
||||
__bitset({5, 9, 21, 25, 37, 41}) /* UART1 */
|
||||
#if defined(PICO_RP2350B)
|
||||
constexpr uint64_t valid[2] = { __bitset({1, 3, 13, 15, 17, 19, 29, 31, 33, 35, 45, 47}) /* UART0 */,
|
||||
__bitset({5, 7, 9, 11, 21, 23, 25, 27, 37, 39, 41, 43}) /* UART1 */
|
||||
};
|
||||
#elif defined(PICO_RP2350)
|
||||
constexpr uint64_t valid[2] = { __bitset({1, 3, 13, 15, 17, 19, 29}) /* UART0 */,
|
||||
__bitset({5, 7, 9, 11, 21, 23, 25, 27}) /* UART1 */
|
||||
};
|
||||
#else
|
||||
constexpr uint64_t valid[2] = { __bitset({1, 13, 17, 29}) /* UART0 */,
|
||||
__bitset({5, 9, 21, 25}) /* UART1 */
|
||||
};
|
||||
#endif
|
||||
|
||||
if ((!_running) && ((1LL << pin) & valid[uart_get_index(_uart)])) {
|
||||
_rx = pin;
|
||||
return true;
|
||||
@@ -59,9 +64,13 @@ bool SerialUART::setRX(pin_size_t pin) {
|
||||
}
|
||||
|
||||
bool SerialUART::setTX(pin_size_t pin) {
|
||||
#ifdef PICO_RP2350B
|
||||
constexpr uint64_t valid[2] = { __bitset({0, 12, 16, 28, 32, 44}) /* UART0 */,
|
||||
__bitset({4, 8, 20, 24, 36, 40}) /* UART1 */
|
||||
#if defined(PICO_RP2350B)
|
||||
constexpr uint64_t valid[2] = { __bitset({0, 2, 12, 14, 16, 18, 28, 30, 32, 34, 44, 46}) /* UART0 */,
|
||||
__bitset({4, 6, 8, 10, 20, 22, 24, 26, 36, 38, 40, 42}) /* UART1 */
|
||||
};
|
||||
#elif defined(PICO_RP2350)
|
||||
constexpr uint64_t valid[2] = { __bitset({0, 2, 12, 14, 16, 18, 28}) /* UART0 */,
|
||||
__bitset({4, 6, 8, 10, 20, 22, 24, 26}) /* UART1 */
|
||||
};
|
||||
#else
|
||||
constexpr uint64_t valid[2] = { __bitset({0, 12, 16, 28}) /* UART0 */,
|
||||
@@ -170,6 +179,41 @@ SerialUART::SerialUART(uart_inst_t *uart, pin_size_t tx, pin_size_t rx, pin_size
|
||||
static void _uart0IRQ();
|
||||
static void _uart1IRQ();
|
||||
|
||||
// Does the selected TX/RX need UART_AUX function (rp2350)
|
||||
static gpio_function_t __gpioFunction(int pin) {
|
||||
switch (pin) {
|
||||
#if defined(PICO_RP2350) || defined(PICO_RP2350B)
|
||||
case 2:
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
case 10:
|
||||
case 11:
|
||||
case 14:
|
||||
case 15:
|
||||
case 18:
|
||||
case 19:
|
||||
case 22:
|
||||
case 23:
|
||||
case 26:
|
||||
case 27:
|
||||
case 30:
|
||||
case 31:
|
||||
case 34:
|
||||
case 35:
|
||||
case 38:
|
||||
case 39:
|
||||
case 42:
|
||||
case 43:
|
||||
case 46:
|
||||
case 47:
|
||||
return GPIO_FUNC_UART_AUX;
|
||||
#endif
|
||||
default:
|
||||
return GPIO_FUNC_UART;
|
||||
}
|
||||
}
|
||||
|
||||
void SerialUART::begin(unsigned long baud, uint16_t config) {
|
||||
if (_running) {
|
||||
end();
|
||||
@@ -180,9 +224,9 @@ void SerialUART::begin(unsigned long baud, uint16_t config) {
|
||||
|
||||
_fcnTx = gpio_get_function(_tx);
|
||||
_fcnRx = gpio_get_function(_rx);
|
||||
gpio_set_function(_tx, GPIO_FUNC_UART);
|
||||
gpio_set_function(_tx, __gpioFunction(_tx));
|
||||
gpio_set_outover(_tx, _invertTX ? 1 : 0);
|
||||
gpio_set_function(_rx, GPIO_FUNC_UART);
|
||||
gpio_set_function(_rx, __gpioFunction(_rx));
|
||||
gpio_set_inover(_rx, _invertRX ? 1 : 0);
|
||||
if (_rts != UART_PIN_NOT_DEFINED) {
|
||||
_fcnRts = gpio_get_function(_rts);
|
||||
|
||||
+37
-1
@@ -22,7 +22,11 @@
|
||||
#include "RP2040USB.h"
|
||||
#include <pico/stdlib.h>
|
||||
#include <pico/multicore.h>
|
||||
#include <hardware/vreg.h>
|
||||
#include <reent.h>
|
||||
#ifdef RP2350_PSRAM_CS
|
||||
#include "psram.h"
|
||||
#endif
|
||||
|
||||
RP2040 rp2040;
|
||||
extern "C" {
|
||||
@@ -80,9 +84,41 @@ static struct _reent *_impure_ptr1 = nullptr;
|
||||
|
||||
extern "C" int main() {
|
||||
#if (defined(PICO_RP2040) && (F_CPU != 125000000)) || (defined(PICO_RP2350) && (F_CPU != 150000000))
|
||||
set_sys_clock_khz(F_CPU / 1000, true);
|
||||
|
||||
#if defined(PICO_RP2040)
|
||||
// From runtime_init_clocks() to bump up RP2040 V for 200Mhz+ operation
|
||||
if ((F_CPU > 133000000) && (vreg_get_voltage() < VREG_VOLTAGE_1_15)) {
|
||||
vreg_set_voltage(VREG_VOLTAGE_1_15);
|
||||
// wait for voltage to settle; must use CPU cycles as TIMER is not yet clocked correctly
|
||||
busy_wait_at_least_cycles((uint32_t)((SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_US * (uint64_t)XOSC_HZ) / 1000000));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RP2350_PSRAM_CS) && (F_CPU > 150000000)
|
||||
// Need to increase the qmi divider before upping sysclk to ensure we keep the output sck w/in legal bounds
|
||||
psram_reinit_timing(F_CPU);
|
||||
// Per datasheet, need to do a dummy access and memory barrier before it takes effect
|
||||
extern uint8_t __psram_start__;
|
||||
volatile uint8_t *x = &__psram_start__;
|
||||
*x ^= 0xff;
|
||||
*x ^= 0xff;
|
||||
asm volatile("" ::: "memory");
|
||||
#endif
|
||||
|
||||
set_sys_clock_khz(F_CPU / 1000, true);
|
||||
|
||||
#if defined(RP2350_PSRAM_CS) && (F_CPU < 150000000)
|
||||
psram_reinit_timing();
|
||||
// Per datasheet, need to do a dummy access and memory barrier before it takes effect
|
||||
extern uint8_t __psram_start__;
|
||||
volatile uint8_t *x = &__psram_start__;
|
||||
*x ^= 0xff;
|
||||
*x ^= 0xff;
|
||||
asm volatile("" ::: "memory");
|
||||
#endif
|
||||
|
||||
#endif // over/underclock
|
||||
|
||||
// Let rest of core know if we're using FreeRTOS
|
||||
__isFreeRTOS = initFreeRTOS ? true : false;
|
||||
|
||||
|
||||
@@ -195,10 +195,7 @@ static size_t __no_inline_not_in_flash_func(get_psram_size)(void) {
|
||||
///
|
||||
/// @note This function expects interrupts to be enabled on entry
|
||||
|
||||
static void __no_inline_not_in_flash_func(set_psram_timing)(void) {
|
||||
// Get secs / cycle for the system clock - get before disabling interrupts.
|
||||
uint32_t sysHz = (uint32_t)clock_get_hz(clk_sys);
|
||||
|
||||
static void __no_inline_not_in_flash_func(set_psram_timing)(uint32_t sysHz) {
|
||||
// Calculate the clock divider - goal to get clock used for PSRAM <= what
|
||||
// the PSRAM IC can handle - which is defined in SFE_PSRAM_MAX_SCK_HZ
|
||||
volatile uint8_t clockDivider = (sysHz + SFE_PSRAM_MAX_SCK_HZ - 1) / SFE_PSRAM_MAX_SCK_HZ;
|
||||
@@ -283,7 +280,7 @@ static void __no_inline_not_in_flash_func(runtime_init_setup_psram)(/*uint32_t p
|
||||
|
||||
// check our interrupts and setup the timing
|
||||
restore_interrupts(intr_stash);
|
||||
set_psram_timing();
|
||||
set_psram_timing((uint32_t)clock_get_hz(clk_sys));
|
||||
|
||||
// and now stash interrupts again
|
||||
intr_stash = save_and_disable_interrupts();
|
||||
@@ -323,8 +320,11 @@ static void __no_inline_not_in_flash_func(runtime_init_setup_psram)(/*uint32_t p
|
||||
PICO_RUNTIME_INIT_FUNC_RUNTIME(runtime_init_setup_psram, PICO_RUNTIME_INIT_PSRAM);
|
||||
|
||||
// update timing -- used if the system clock/timing was changed.
|
||||
void psram_reinit_timing() {
|
||||
set_psram_timing();
|
||||
void psram_reinit_timing(uint32_t hz) {
|
||||
if (!hz) {
|
||||
hz = (uint32_t)clock_get_hz(clk_sys);
|
||||
}
|
||||
set_psram_timing(hz);
|
||||
}
|
||||
|
||||
static bool __psram_heap_init() {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
void psram_reinit_timing();
|
||||
void psram_reinit_timing(uint32_t hz = 0);
|
||||
void *__psram_malloc(size_t size);
|
||||
void __psram_free(void *ptr);
|
||||
void *__psram_realloc(void *ptr, size_t size);
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'4.4.4'
|
||||
version = u'4.5.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'4.4.4'
|
||||
release = u'4.5.0'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#define PICO_SDK_VERSION_MAJOR 2
|
||||
#define PICO_SDK_VERSION_MINOR 1
|
||||
#define PICO_SDK_VERSION_REVISION 0
|
||||
#define PICO_SDK_VERSION_STRING "2.1.0"
|
||||
#define PICO_SDK_VERSION_REVISION 2
|
||||
#define PICO_SDK_VERSION_STRING "2.1.2-develop"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#define PICO_SDK_VERSION_MAJOR 2
|
||||
#define PICO_SDK_VERSION_MINOR 1
|
||||
#define PICO_SDK_VERSION_REVISION 0
|
||||
#define PICO_SDK_VERSION_STRING "2.1.0"
|
||||
#define PICO_SDK_VERSION_REVISION 2
|
||||
#define PICO_SDK_VERSION_STRING "2.1.2-develop"
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,5 +10,6 @@
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/src
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/decoder/include
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/encoder/include
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/yxml
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/platform/embedded
|
||||
-iwithprefixbefore/pico-sdk/src/rp2_common/cmsis/stub/CMSIS/Device/RP2040/Include
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,4 +15,5 @@
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/src
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/decoder/include
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/encoder/include
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/yxml
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/platform/embedded
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,4 +13,5 @@
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/src
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/decoder/include
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/bluedroid/encoder/include
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/3rd-party/yxml
|
||||
-iwithprefixbefore/pico-sdk/lib/btstack/platform/embedded
|
||||
|
||||
@@ -223,7 +223,7 @@ size_t A2DPSource::write(const uint8_t *buffer, size_t size) {
|
||||
size = std::min((size_t)availableForWrite(), size);
|
||||
|
||||
size_t count = 0;
|
||||
size /= 2;
|
||||
size /= sizeof(int16_t); // Convert size to samples
|
||||
|
||||
// First copy from writer to either end of
|
||||
uint32_t start = _pcmWriter;
|
||||
@@ -262,7 +262,7 @@ int A2DPSource::availableForWrite() {
|
||||
} else {
|
||||
avail = _pcmBufferSize - _pcmWriter + _pcmReader - 1;
|
||||
}
|
||||
avail /= sizeof(uint32_t); // availableForWrite always 32b sample pairs in this core...
|
||||
avail *= sizeof(int16_t); // Convert samples to bytes
|
||||
return avail;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,14 @@ public:
|
||||
return _hci.scan(mask, scanTimeSec, async);
|
||||
}
|
||||
|
||||
bool scanAsyncDone() {
|
||||
return _hci.scanAsyncDone();
|
||||
}
|
||||
|
||||
std::vector<BTDeviceInfo> scanAsyncResult() {
|
||||
return _hci.scanAsyncResult();
|
||||
}
|
||||
|
||||
bool connect(const uint8_t *addr = nullptr);
|
||||
|
||||
bool connected() {
|
||||
@@ -151,6 +159,7 @@ public:
|
||||
}
|
||||
|
||||
// from Print (see notes on write() methods below)
|
||||
// Writes only full samples (size must be divisible by sample size in bytes)
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) override;
|
||||
virtual int availableForWrite() override;
|
||||
|
||||
|
||||
@@ -108,6 +108,9 @@ public:
|
||||
@brief Disables any GPIO interrupts registered before an SPI transaction begins
|
||||
*/
|
||||
void maskInterrupts() {
|
||||
if (_usingIRQs.empty()) {
|
||||
return;
|
||||
}
|
||||
noInterrupts(); // Avoid possible race conditions if IRQ comes in while main app is in middle of this
|
||||
// Disable any IRQs that are being used for SPI
|
||||
io_bank0_irq_ctrl_hw_t *irq_ctrl_base = get_core_num() ? &iobank0_hw->proc1_irq_ctrl : &iobank0_hw->proc0_irq_ctrl;
|
||||
@@ -134,6 +137,9 @@ public:
|
||||
@brief Restores GPIO interrupts masks after an SPI transaction completes
|
||||
*/
|
||||
void unmaskInterrupts() {
|
||||
if (_usingIRQs.empty()) {
|
||||
return;
|
||||
}
|
||||
noInterrupts(); // Avoid race condition so the GPIO IRQs won't come back until all state is restored
|
||||
DEBUGSPI("SPI::endTransaction()\n");
|
||||
// Re-enable IRQs
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#if USE_WIFI
|
||||
#include <WiFi.h>
|
||||
#elif USE_WIRED
|
||||
#include <W5500lwIP.h> // Or W5100lwIP.h or ENC28J60lwIP.h
|
||||
Wiznet5500lwIP eth(1 /* chip select */); // or Wiznet5100lwIP or ENC28J60lwIP
|
||||
#include <W5500lwIP.h> // or W6100lwIP.h or W5100lwIP.h or ENC28J60lwIP.h
|
||||
Wiznet5500lwIP eth(1 /* SPI chip select */); // or Wiznet6100lwIP or Wiznet5100lwIP or ENC28J60lwIP
|
||||
#endif
|
||||
|
||||
#include <WiFiClient.h>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "framework-arduinopico",
|
||||
"version": "1.40404.0",
|
||||
"version": "1.40500.0",
|
||||
"description": "Arduino Wiring-based Framework (RPi Pico RP2040, RP2350)",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
||||
@@ -209,6 +209,12 @@
|
||||
{
|
||||
"name": "iLabs Challenger 2350 BConnect"
|
||||
},
|
||||
{
|
||||
"name": "Makerbase MKS THR36"
|
||||
},
|
||||
{
|
||||
"name": "Makerbase MKS THR42"
|
||||
},
|
||||
{
|
||||
"name": "Melopero Cookie RP2040"
|
||||
},
|
||||
@@ -287,6 +293,9 @@
|
||||
{
|
||||
"name": "Solder Party RP2350 Stamp XL"
|
||||
},
|
||||
{
|
||||
"name": "SparkFun IoT RedBoard RP2350"
|
||||
},
|
||||
{
|
||||
"name": "SparkFun MicroMod RP2040"
|
||||
},
|
||||
@@ -305,6 +314,12 @@
|
||||
{
|
||||
"name": "SparkFun IoT Node LoRaWAN"
|
||||
},
|
||||
{
|
||||
"name": "SparkFun XRP Controller (Beta)"
|
||||
},
|
||||
{
|
||||
"name": "SparkFun XRP Controller"
|
||||
},
|
||||
{
|
||||
"name": "Seeed INDICATOR RP2040"
|
||||
},
|
||||
|
||||
+1
-1
Submodule pico-sdk updated: 95ea6acad1...b1676c18a3
+1
-1
@@ -20,7 +20,7 @@
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=Raspberry Pi RP2040/RP2350 Boards
|
||||
version=4.4.4
|
||||
version=4.5.0
|
||||
|
||||
# Required discoveries and monitors
|
||||
# ---------------------------------
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2E8A",
|
||||
"usb_pid": "0x000A"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-DARDUINO_MAKERBASE_MKSTHR36 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 ",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x000A"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "mksthr36"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "MKS THR36",
|
||||
"upload": {
|
||||
"maximum_ram_size": 262144,
|
||||
"maximum_size": 1048576,
|
||||
"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"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Makerbase"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2E8A",
|
||||
"usb_pid": "0x000A"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-DARDUINO_MAKERBASE_MKSTHR42 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 ",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x000A"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "mksthr42"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "MKS THR42",
|
||||
"upload": {
|
||||
"maximum_ram_size": 262144,
|
||||
"maximum_size": 1048576,
|
||||
"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"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Makerbase"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x1B4F",
|
||||
"usb_pid": "0x0045"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-DARDUINO_SPARKFUN_XRP_CONTROLLER_BETA -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x1B4F",
|
||||
"0x0045"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "sparkfun_xrp_controller_beta"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "XRP Controller (Beta)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 262144,
|
||||
"maximum_size": 2097152,
|
||||
"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"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "SparkFun"
|
||||
}
|
||||
+8
-1
@@ -363,7 +363,7 @@ def MakeBoard(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine,
|
||||
# Optional, user needs to solder themselves
|
||||
BuildPSRAM(name)
|
||||
else:
|
||||
BuildFreq(name, 133)
|
||||
BuildFreq(name, 200)
|
||||
BuildOptimize(name)
|
||||
BuildProfile(name)
|
||||
BuildRTTI(name)
|
||||
@@ -591,6 +591,10 @@ MakeBoard("ilabs_rpico32", "rp2040", "iLabs", "RPICO32", "0x2e8a", "0x1010", 250
|
||||
MakeBoard("challenger_2350_wifi6_ble5", "rp2350", "iLabs", "Challenger 2350 WiFi/BLE", "0x2e8a", "0x109a", 500, "CHALLENGER_2350_WIFI_BLE_RP2350", 8, 8, "none")
|
||||
MakeBoard("challenger_2350_bconnect", "rp2350", "iLabs", "Challenger 2350 BConnect", "0x2e8a", "0x109b", 500, "CHALLENGER_2350_BCONNECT_RP2350", 8, 8, "none")
|
||||
|
||||
# Makerbase
|
||||
MakeBoard("mksthr36", "rp2040", "Makerbase", "MKS THR36", "0x2e8a", "0x000a", 250, "MAKERBASE_MKSTHR36", 1, 0, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("mksthr42", "rp2040", "Makerbase", "MKS THR42", "0x2e8a", "0x000a", 250, "MAKERBASE_MKSTHR42", 1, 0, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
# Melopero
|
||||
MakeBoard("melopero_cookie_rp2040", "rp2040", "Melopero", "Cookie RP2040", "0x2e8a", "0x1011", 250, "MELOPERO_COOKIE_RP2040", 8, 0, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("melopero_shake_rp2040", "rp2040", "Melopero", "Shake RP2040", "0x2e8a", "0x1005", 250, "MELOPERO_SHAKE_RP2040", 16, 0, "boot2_w25q080_2_padded_checksum")
|
||||
@@ -646,12 +650,15 @@ MakeBoard("solderparty_rp2350_stamp", "rp2350", "Solder Party", "RP2350 Stamp",
|
||||
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")
|
||||
MakeBoard("sparkfun_thingplusrp2040", "rp2040", "SparkFun", "Thing Plus RP2040", "0x1b4f", "0x0026", 250, "SPARKFUN_THINGPLUS_RP2040", 16, 0, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("sparkfun_thingplusrp2350", "rp2350", "SparkFun", "Thing Plus RP2350", "0x1b4f", "0x0038", 250, "SPARKFUN_THINGPLUS_RP2350", 16, 8, "none", ["PICO_CYW43_SUPPORTED=1", "CYW43_PIN_WL_DYNAMIC=1"])
|
||||
MakeBoard("sparkfun_iotnode_lorawanrp2350", "rp2350", "SparkFun", "IoT Node LoRaWAN", "0x1b4f", "0x0044", 250, "SPARKFUN_IOTNODE_LORAWAN_RP2350", 16, 8, "none")
|
||||
MakeBoard("sparkfun_xrp_controller_beta", "rp2040", "SparkFun", "XRP Controller (Beta)", "0x1b4f", "0x0045", 250, "SPARKFUN_XRP_CONTROLLER_BETA", 2, 0, "boot2_w25q080_2_padded_checksum", ["PICO_CYW43_SUPPORTED=1", "CYW43_PIN_WL_DYNAMIC=1"])
|
||||
MakeBoard("sparkfun_xrp_controller", "rp2350", "SparkFun", "XRP Controller", "0x1b4f", "0x0046", 250, "SPARKFUN_XRP_CONTROLLER", 16, 8, "none", ["PICO_CYW43_SUPPORTED=1", "CYW43_PIN_WL_DYNAMIC=1"])
|
||||
|
||||
# Seeed
|
||||
MakeBoard("seeed_indicator_rp2040", "rp2040", "Seeed", "INDICATOR RP2040", "0x2886", "0x0050", 250, "SEEED_INDICATOR_RP2040", 2, 0, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
@@ -39,4 +39,14 @@
|
||||
#define RP2350_PSRAM_CS (8u)
|
||||
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000)
|
||||
|
||||
// DVI connector
|
||||
#define PIN_CKN (15u)
|
||||
#define PIN_CKP (14u)
|
||||
#define PIN_D0N (19u)
|
||||
#define PIN_D0P (18u)
|
||||
#define PIN_D1N (17u)
|
||||
#define PIN_D1P (16u)
|
||||
#define PIN_D2N (13u)
|
||||
#define PIN_D2P (12u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
|
||||
@@ -68,4 +68,15 @@
|
||||
#define RP2350_PSRAM_CS (47u)
|
||||
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000)
|
||||
|
||||
// DVI connector
|
||||
#define PIN_CKN (15u)
|
||||
#define PIN_CKP (14u)
|
||||
#define PIN_D0N (19u)
|
||||
#define PIN_D0P (18u)
|
||||
#define PIN_D1N (17u)
|
||||
#define PIN_D1P (16u)
|
||||
#define PIN_D2N (13u)
|
||||
#define PIN_D2P (12u)
|
||||
|
||||
|
||||
#include "../generic/common.h"
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
// Pin definitions taken from:
|
||||
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
|
||||
|
||||
#define PIN_HE0 (0u)
|
||||
|
||||
#define PIN_FAN0 (1u)
|
||||
#define PIN_FAN1 (2u)
|
||||
#define PIN_FAN2 (3u)
|
||||
|
||||
#define PIN_E0_DIR (4u)
|
||||
#define PIN_E0_STEP (5u)
|
||||
|
||||
#define PIN_SERIAL1_TX (6u)
|
||||
#define PIN_E0_UART (6u)
|
||||
#define PIN_SERIAL1_RX (31u)
|
||||
#define PIN_E0_DIAG (7u)
|
||||
#define PIN_E0_EN (10u)
|
||||
|
||||
#define PIN_CAN_RX (8u)
|
||||
#define PIN_CAN_TX (9u)
|
||||
#define PIN_SERIAL2_TX (8u)
|
||||
#define PIN_SERIAL2_RX (9u)
|
||||
|
||||
#define PIN_3D_TOUCH (11u)
|
||||
|
||||
//SPI
|
||||
#define PIN_SPI1_MISO (12u)
|
||||
#define PIN_SPI1_MOSI (15u)
|
||||
#define PIN_SPI1_SCK (14u)
|
||||
#define PIN_SPI1_SS (13u)
|
||||
|
||||
#define PIN_SPI0_MISO (16u)
|
||||
#define PIN_SPI0_MOSI (19u)
|
||||
#define PIN_SPI0_SCK (18u)
|
||||
#define PIN_SPI0_SS (17u)
|
||||
|
||||
#define PIN_NEOPIXEL (20u)
|
||||
#define PIN_ZPLUS (21u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (22u)
|
||||
#define PIN_WIRE0_SCL (23u)
|
||||
#define PIN_I2C_SDA (22u)
|
||||
#define PIN_I2C_SCL (23u)
|
||||
|
||||
#define PIN_IO24 (24u)
|
||||
#define PIN_IO25 (25u)
|
||||
|
||||
#define PIN_TH0 (26u)
|
||||
#define PIN_IPO29 (29u)
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
// Pin definitions taken from:
|
||||
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
|
||||
|
||||
#define PIN_HE0 (0u)
|
||||
|
||||
#define PIN_FAN0 (1u)
|
||||
#define PIN_FAN1 (2u)
|
||||
#define PIN_FAN2 (3u)
|
||||
|
||||
#define PIN_E0_DIR (4u)
|
||||
#define PIN_E0_STEP (5u)
|
||||
|
||||
#define PIN_SERIAL1_TX (6u)
|
||||
#define PIN_E0_UART (6u)
|
||||
#define PIN_SERIAL1_RX (31u)
|
||||
#define PIN_E0_DIAG (7u)
|
||||
#define PIN_E0_EN (10u)
|
||||
|
||||
#define PIN_CAN_RX (8u)
|
||||
#define PIN_CAN_TX (9u)
|
||||
#define PIN_SERIAL2_TX (8u)
|
||||
#define PIN_SERIAL2_RX (9u)
|
||||
|
||||
#define PIN_3D_TOUCH (11u)
|
||||
|
||||
//SPI
|
||||
#define PIN_SPI1_MISO (12u)
|
||||
#define PIN_SPI1_MOSI (15u)
|
||||
#define PIN_SPI1_SCK (14u)
|
||||
#define PIN_SPI1_SS (13u)
|
||||
|
||||
#define PIN_SPI0_MISO (16u)
|
||||
#define PIN_SPI0_MOSI (19u)
|
||||
#define PIN_SPI0_SCK (18u)
|
||||
#define PIN_SPI0_SS (17u)
|
||||
|
||||
#define PIN_NEOPIXEL (20u)
|
||||
#define PIN_ZPLUS (21u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (22u)
|
||||
#define PIN_WIRE0_SCL (23u)
|
||||
#define PIN_I2C_SDA (22u)
|
||||
#define PIN_I2C_SCL (23u)
|
||||
|
||||
#define PIN_IO24 (24u)
|
||||
#define PIN_IO25 (25u)
|
||||
|
||||
#define PIN_TH0 (26u)
|
||||
#define PIN_IPO29 (29u)
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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>
|
||||
#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();
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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"
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
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() {
|
||||
init_cyw43_wifi();
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
#pragma once
|
||||
|
||||
#include <cyw43_wrappers.h>
|
||||
|
||||
// XRP default pin names
|
||||
#define MOTOR_L_IN_1 (6u)
|
||||
#define MOTOR_L_IN_2 (7u)
|
||||
#define MOTOR_R_IN_1 (14u)
|
||||
#define MOTOR_R_IN_2 (15u)
|
||||
#define MOTOR_3_IN_1 (2u)
|
||||
#define MOTOR_3_IN_2 (3u)
|
||||
#define MOTOR_4_IN_1 (10u)
|
||||
#define MOTOR_4_IN_2 (11u)
|
||||
#define MOTOR_L_ENCODER_A (4u)
|
||||
#define MOTOR_L_ENCODER_B (5u)
|
||||
#define MOTOR_R_ENCODER_A (12u)
|
||||
#define MOTOR_R_ENCODER_B (13u)
|
||||
#define MOTOR_3_ENCODER_A (0u)
|
||||
#define MOTOR_3_ENCODER_B (1u)
|
||||
#define MOTOR_4_ENCODER_A (8u)
|
||||
#define MOTOR_4_ENCODER_B (9u)
|
||||
#define SERVO_1 (16u)
|
||||
#define SERVO_2 (17u)
|
||||
#define I2C_SDA_1 (18u)
|
||||
#define I2C_SCL_1 (19u)
|
||||
#define DISTANCE_TRIGGER (20u)
|
||||
#define DISTANCE_ECHO (21u)
|
||||
#define LINE_L (26u)
|
||||
#define LINE_R (27u)
|
||||
#define BOARD_VIN_MEASURE (28u)
|
||||
#define BOARD_USER_BUTTON (22u)
|
||||
#define BOARD_LED (PIN_LED)
|
||||
|
||||
// XRP alternate pin names
|
||||
#define ML_IN_1 (6u)
|
||||
#define ML_IN_2 (7u)
|
||||
#define MR_IN_1 (14u)
|
||||
#define MR_IN_2 (15u)
|
||||
#define M3_IN_1 (2u)
|
||||
#define M3_IN_2 (3u)
|
||||
#define M4_IN_1 (10u)
|
||||
#define M4_IN_2 (11u)
|
||||
#define ML_ENC_A (4u)
|
||||
#define ML_ENC_B (5u)
|
||||
#define MR_ENC_A (12u)
|
||||
#define MR_ENC_B (13u)
|
||||
#define M3_ENC_A (0u)
|
||||
#define M3_ENC_B (1u)
|
||||
#define M4_ENC_A (8u)
|
||||
#define M4_ENC_B (9u)
|
||||
#define S1 (16u)
|
||||
#define S2 (17u)
|
||||
#define SDA_1 (18u)
|
||||
#define SCL_1 (19u)
|
||||
#define RANGE_TRIGGER (20u)
|
||||
#define RANGE_ECHO (21u)
|
||||
#define REFLECTANCE_L (26u)
|
||||
#define REFLECTANCE_R (27u)
|
||||
#define BRD_VIN (28u)
|
||||
#define BRD_USR_BTN (22u)
|
||||
#define BRD_LED (PIN_LED)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (64u)
|
||||
|
||||
// Serial
|
||||
#define PIN_SERIAL1_TX (31u)
|
||||
#define PIN_SERIAL1_RX (31u)
|
||||
|
||||
#define PIN_SERIAL2_TX (31u)
|
||||
#define PIN_SERIAL2_RX (31u)
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (31u)
|
||||
#define PIN_SPI0_MOSI (31u)
|
||||
#define PIN_SPI0_SCK (31u)
|
||||
#define PIN_SPI0_SS (31u)
|
||||
|
||||
#define PIN_SPI1_MISO (31u)
|
||||
#define PIN_SPI1_MOSI (31u)
|
||||
#define PIN_SPI1_SCK (31u)
|
||||
#define PIN_SPI1_SS (31u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (18u)
|
||||
#define PIN_WIRE0_SCL (19u)
|
||||
|
||||
#define PIN_WIRE1_SDA (31u)
|
||||
#define PIN_WIRE1_SCL (31u)
|
||||
|
||||
// XRP Beta Controller uses I2C1 for Qwiic connector, make that the default
|
||||
#ifndef __WIRE0_DEVICE
|
||||
#define __WIRE0_DEVICE i2c1
|
||||
#endif
|
||||
#ifndef __WIRE1_DEVICE
|
||||
#define __WIRE1_DEVICE i2c0
|
||||
#endif
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (2u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
Reference in New Issue
Block a user