Merge branch 'master' of github.com:adafruit/arduino-pico

This commit is contained in:
ladyada 2025-05-24 15:05:34 -04:00
commit ecd662640f
75 changed files with 824 additions and 259 deletions

View file

@ -10,7 +10,7 @@ jobs:
# Consistent style, spelling
astyle:
name: Spelling, Style, Boards, Package
name: Spelling, Style, Boards, Package, PIO
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -21,11 +21,6 @@ jobs:
with:
skip: ./ArduinoCore-API,./libraries/ESP8266SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst,./cores/rp2040/api,./libraries/FreeRTOS,./tools/libbearssl/bearssl,./include,./libraries/WiFi/examples/BearSSL_Server,./ota/uzlib,./libraries/http-parser/lib,./libraries/WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino,./libraries/HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino,./.git,./libraries/FatFS/lib/fatfs,./libraries/FatFS/src/diskio.h,./libraries/FatFS/src/ff.cpp,./libraries/FatFS/src/ffconf.h,./libraries/FatFS/src/ffsystem.cpp,./libraries/FatFS/src/ff.h,./libraries/lwIP_WINC1500/src/driver,./libraries/lwIP_WINC1500/src/common,./libraries/lwIP_WINC1500/src/bus_wrapper,./libraries/lwIP_WINC1500/src/spi_flash
ignore_words_list: ser,dout,shiftIn,acount,froms
- name: Get submodules for following tests
run: git submodule update --init
- name: Check package references
run: |
./tests/ci/pkgrefs_test.sh
- name: Check boards.txt was not edited after makeboards.py
run: |
./tools/makeboards.py
@ -38,6 +33,15 @@ jobs:
./tests/restyle.sh
# If anything changed, GIT should return an error and fail the test
git diff --exit-code
- name: Check compiled PIO files
run: |
(cd ./tools && ./get.py)
./tools/makepio.py
# If anything changed, GIT should return an error and fail the test
git diff -w --exit-code
- name: Check package references
run: |
./tests/ci/pkgrefs_test.sh
# Build all examples on linux (core and Arduino IDE)
build-linux:

5
.gitignore vendored
View file

@ -5,5 +5,8 @@ docs/_build
ota/build
ota/build-rp2350
ota/build-rp2350-riscv
tools/libpico/build
tools/libpico/boot
tools/libpico/build-rp2040
tools/libpico/build-rp2350
tools/libpico/build-rp2350-riscv
platform.local.txt

File diff suppressed because it is too large Load diff

View file

@ -27,10 +27,23 @@
#include "RP2040Version.h"
#include "api/ArduinoAPI.h"
#include "api/itoa.h" // ARM toolchain doesn't provide itoa etc, provide them
#include <pico.h>
#undef PICO_RP2350A // Set in the RP2350 SDK boards file, overridden in the variant pins_arduino.h
#include <pins_arduino.h>
#include <hardware/gpio.h> // Required for the port*Register macros
#include "debug_internal.h"
// Chip sanity checking. SDK uses interesting way of separating 2350A from 2350B, see https://github.com/raspberrypi/pico-sdk/issues/2364
#if (!defined(PICO_RP2040) && !defined(PICO_RP2350)) || defined(PICO_RP2040) && defined(PICO_RP2350)
#error Invalid core definition. Either PICO_RP2040 or PICO_RP2350 must be defined.
#endif
#if defined(PICO_RP2350) && !defined(PICO_RP2350A)
#error Invalid RP2350 definition. Need to set PICO_RP2350A=0/1 for A/B variant
#endif
#if defined(PICO_RP2350B)
#error Do not define PICO_RP2350B. Use PICO_RP2350A=0 to indicate RP2350B. See the SDK for more details
#endif
// Try and make the best of the old Arduino abs() macro. When in C++, use
// the sane std::abs() call, but for C code use their macro since stdlib abs()
// is int but their macro "works" for everything (with potential side effects)
@ -152,7 +165,7 @@ constexpr uint64_t __bitset(const int (&a)[N], size_t i = 0U) {
#define PSRAM __attribute__((section("\".psram\"")))
// General GPIO/ADC layout info
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A
#define __GPIOCNT 48
#define __FIRSTANALOGGPIO 40
#else

View file

@ -1 +1,2 @@
#include "api/IPAddress.h"
using arduino::IPAddress;

View file

@ -190,8 +190,8 @@ public:
RP2040() { /* noop */ }
~RP2040() { /* noop */ }
void begin() {
_epoch = 0;
void begin(int cpuid) {
_epoch[cpuid] = 0;
#if !defined(__riscv) && !defined(__PROFILE)
if (!__isFreeRTOS) {
// Enable SYSTICK exception
@ -200,11 +200,14 @@ public:
systick_hw->rvr = 0x00FFFFFF;
} else {
#endif
int off = 0;
_ccountPgm = new PIOProgram(&ccount_program);
_ccountPgm->prepare(&_pio, &_sm, &off);
ccount_program_init(_pio, _sm, off);
pio_sm_set_enabled(_pio, _sm, true);
// Only start 1 instance of the PIO SM
if (cpuid == 0) {
int off = 0;
_ccountPgm = new PIOProgram(&ccount_program);
_ccountPgm->prepare(&_pio, &_sm, &off);
ccount_program_init(_pio, _sm, off);
pio_sm_set_enabled(_pio, _sm, true);
}
#if !defined(__riscv) && !defined(__PROFILE)
}
#endif
@ -241,7 +244,7 @@ public:
/**
@brief CPU cycle counter epoch (24-bit cycle). For internal use
*/
volatile uint64_t _epoch = 0;
volatile uint64_t _epoch[2] = {};
/**
@brief Get the count of CPU clock cycles since power on.
@ -258,9 +261,9 @@ public:
uint32_t epoch;
uint32_t ctr;
do {
epoch = (uint32_t)_epoch;
epoch = (uint32_t)_epoch[sio_hw->cpuid];
ctr = systick_hw->cvr;
} while (epoch != (uint32_t)_epoch);
} while (epoch != (uint32_t)_epoch[sio_hw->cpuid]);
return epoch + (1 << 24) - ctr; /* CTR counts down from 1<<24-1 */
} else {
#endif
@ -280,9 +283,9 @@ public:
uint64_t epoch;
uint64_t ctr;
do {
epoch = _epoch;
epoch = _epoch[sio_hw->cpuid];
ctr = systick_hw->cvr;
} while (epoch != _epoch);
} while (epoch != _epoch[sio_hw->cpuid]);
return epoch + (1LL << 24) - ctr;
} else {
#endif
@ -666,8 +669,8 @@ public:
private:
static void _SystickHandler() {
rp2040._epoch += 1LL << 24;
static void __no_inline_not_in_flash_func(_SystickHandler)() {
rp2040._epoch[sio_hw->cpuid] += 1LL << 24;
}
PIO _pio;
int _sm;

View file

@ -1,5 +1,5 @@
#pragma once
#define ARDUINO_PICO_MAJOR 4
#define ARDUINO_PICO_MINOR 5
#define ARDUINO_PICO_REVISION 1
#define ARDUINO_PICO_VERSION_STR "4.5.1"
#define ARDUINO_PICO_REVISION 3
#define ARDUINO_PICO_VERSION_STR "4.5.3"

View file

@ -68,13 +68,10 @@ static PIOProgram *_getRxProgram(int bits) {
}
// ------------------------------------------------------------------------
// TODO - this works, but there must be a faster/better way...
static int _parity(int bits, int data) {
int p = 0;
for (int b = 0; b < bits; b++) {
p ^= (data & (1 << b)) ? 1 : 0;
}
return p;
static int __not_in_flash_func(_parity)(int data) {
data ^= data >> 4;
data &= 0xf;
return (0x6996 >> data) & 1;
}
// We need to cache generated SerialPIOs so we can add data to them from
@ -98,20 +95,16 @@ void __not_in_flash_func(SerialPIO::_handleIRQ)() {
}
while (!pio_sm_is_rx_fifo_empty(_rxPIO, _rxSM)) {
uint32_t decode = _rxPIO->rxf[_rxSM];
decode >>= 33 - _rxBits;
uint32_t val = 0;
for (int b = 0; b < _bits + 1; b++) {
val |= (decode & (1 << (b * 2))) ? 1 << b : 0;
}
uint32_t val = decode >> (32 - _rxBits - 1);
if (_parity == UART_PARITY_EVEN) {
int p = ::_parity(_bits, val);
int p = ::_parity(val);
int r = (val & (1 << _bits)) ? 1 : 0;
if (p != r) {
// TODO - parity error
continue;
}
} else if (_parity == UART_PARITY_ODD) {
int p = ::_parity(_bits, val);
int p = ::_parity(val);
int r = (val & (1 << _bits)) ? 1 : 0;
if (p == r) {
// TODO - parity error
@ -234,7 +227,7 @@ void SerialPIO::begin(unsigned long baud, uint16_t config) {
_writer = 0;
_reader = 0;
_rxBits = 2 * (_bits + _stop + (_parity != UART_PARITY_NONE ? 1 : 0) + 1) - 1;
_rxBits = _bits + (_parity != UART_PARITY_NONE ? 1 : 0);
_rxPgm = _getRxProgram(_rxBits);
int off;
if (!_rxPgm->prepare(&_rxPIO, &_rxSM, &off, _rx, 1)) {
@ -249,7 +242,7 @@ void SerialPIO::begin(unsigned long baud, uint16_t config) {
pio_sm_clear_fifos(_rxPIO, _rxSM); // Remove any existing data
// Put phase divider into OSR w/o using add'l program memory
pio_sm_put_blocking(_rxPIO, _rxSM, clock_get_hz(clk_sys) / (_baud * 2) - 7 /* insns in PIO halfbit loop */);
pio_sm_put_blocking(_rxPIO, _rxSM, clock_get_hz(clk_sys) / (_baud * 2) - 3);
pio_sm_exec(_rxPIO, _rxSM, pio_encode_pull(false, false));
// Join the TX FIFO to the RX one now that we don't need it
@ -378,10 +371,10 @@ size_t SerialPIO::write(uint8_t c) {
if (_parity == UART_PARITY_NONE) {
val |= 7 << _bits; // Set 2 stop bits, the HW will only transmit the required number
} else if (_parity == UART_PARITY_EVEN) {
val |= ::_parity(_bits, c) << _bits;
val |= ::_parity(c) << _bits;
val |= 7 << (_bits + 1);
} else {
val |= (1 ^ ::_parity(_bits, c)) << _bits;
val |= (1 ^ ::_parity(c)) << _bits;
val |= 7 << (_bits + 1);
}
val <<= 1; // Start bit = low

View file

@ -32,7 +32,7 @@ extern void serialEvent1() __attribute__((weak));
extern void serialEvent2() __attribute__((weak));
bool SerialUART::setRX(pin_size_t pin) {
#if defined(PICO_RP2350B)
#if defined(PICO_RP2350) && !PICO_RP2350A // 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 */
};
@ -64,7 +64,7 @@ bool SerialUART::setRX(pin_size_t pin) {
}
bool SerialUART::setTX(pin_size_t pin) {
#if defined(PICO_RP2350B)
#if defined(PICO_RP2350) && !PICO_RP2350A // 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 */
};
@ -95,7 +95,7 @@ bool SerialUART::setTX(pin_size_t pin) {
}
bool SerialUART::setRTS(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({3, 15, 19, 31, 35, 47}) /* UART0 */,
__bitset({7, 11, 23, 27, 39, 43}) /* UART1 */
};
@ -122,7 +122,7 @@ bool SerialUART::setRTS(pin_size_t pin) {
}
bool SerialUART::setCTS(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({2, 14, 18, 30, 34, 46}) /* UART0 */,
__bitset({6, 10, 22, 26, 38, 42}) /* UART1 */
};
@ -182,7 +182,7 @@ 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)
#if defined(PICO_RP2350) && !PICO_RP2350A
case 2:
case 3:
case 6:

View file

@ -51,9 +51,14 @@ void initVariant() { }
// Optional 2nd core setup and loop
bool core1_separate_stack __attribute__((weak)) = false;
bool core1_disable_systick __attribute__((weak)) = false;
extern void setup1() __attribute__((weak));
extern void loop1() __attribute__((weak));
extern "C" void main1() {
if (!core1_disable_systick) {
// Don't install the SYSTICK exception handler. rp2040.getCycleCount will not work properly on core1
rp2040.begin(1);
}
rp2040.fifo.registerCore();
if (setup1) {
setup1();
@ -128,7 +133,7 @@ extern "C" int main() {
_REENT_INIT_PTR(_impure_ptr1);
}
rp2040.begin();
rp2040.begin(0);
initVariant();
@ -239,3 +244,10 @@ void hexdump(const void* mem, uint32_t len, uint8_t cols) {
}
const String emptyString = "";
extern "C" void __attribute__((__noreturn__)) __wrap___stack_chk_fail() {
while (true) {
panic("*** stack smashing detected ***: terminated\n");
}
}

View file

@ -73,20 +73,25 @@ static inline void pio_tx_program_init(PIO pio, uint sm, uint offset, uint pin_t
; IN pin 0 and JMP pin are both mapped to the GPIO used as UART RX.
start:
set x, 18 ; Preload bit counter...we'll shift in the start bit and stop bit, and each bit will be double-recorded (to be fixed by RP2040 code)
set x, 18 ; Preload bit counter...overwritten by the app
wait 0 pin 0 ; Stall until start bit is asserted
bitloop:
; Delay until 1/2 way into the bit time
mov y, osr
wait_half:
jmp y-- wait_half
wait_mid_start:
jmp y-- wait_mid_start
; Read in the bit
in pins, 1 ; Shift data bit into ISR
jmp x-- bitloop ; Loop all bits
push ; Stuff it and wait for next start
bitloop:
mov y, osr
bitloop1:
jmp y-- bitloop1
mov y, osr
bitloop2:
jmp y-- bitloop2
in pins, 1
jmp x-- bitloop
push
% c-sdk {
static inline void pio_rx_program_init(PIO pio, uint sm, uint offset, uint pin) {

View file

@ -71,7 +71,7 @@ static inline void pio_tx_program_init(PIO pio, uint sm, uint offset, uint pin_t
// ------ //
#define pio_rx_wrap_target 0
#define pio_rx_wrap 6
#define pio_rx_wrap 10
#define pio_rx_pio_version 0
static const uint16_t pio_rx_program_instructions[] = {
@ -80,16 +80,20 @@ static const uint16_t pio_rx_program_instructions[] = {
0x2020, // 1: wait 0 pin, 0
0xa047, // 2: mov y, osr
0x0083, // 3: jmp y--, 3
0x4001, // 4: in pins, 1
0x0042, // 5: jmp x--, 2
0x8020, // 6: push block
0xa047, // 4: mov y, osr
0x0085, // 5: jmp y--, 5
0xa047, // 6: mov y, osr
0x0087, // 7: jmp y--, 7
0x4001, // 8: in pins, 1
0x0044, // 9: jmp x--, 4
0x8020, // 10: push block
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program pio_rx_program = {
.instructions = pio_rx_program_instructions,
.length = 7,
.length = 11,
.origin = -1,
.pio_version = 0,
#if PICO_PIO_VERSION > 0

View file

@ -17,14 +17,14 @@
#define tone2_pio_version 0
static const uint16_t tone2_program_instructions[] = {
// .wrap_target
// .wrap_target
0x8080, // 0: pull noblock
0xb827, // 1: mov x, osr side 1
0xa047, // 2: mov y, osr
0x0083, // 3: jmp y--, 3
0xb047, // 4: mov y, osr side 0
0x0085, // 5: jmp y--, 5
// .wrap
// .wrap
};
#if !PICO_NO_HARDWARE
@ -32,7 +32,7 @@ static const struct pio_program tone2_program = {
.instructions = tone2_program_instructions,
.length = 6,
.origin = -1,
.pio_version = tone2_pio_version,
.pio_version = 0,
#if PICO_PIO_VERSION > 0
.used_gpio_ranges = 0x0
#endif

View file

@ -12,9 +12,9 @@ need to be periodically sampled to be read by applications, easily, such as:
* Light dependent resistors (LDR), etc.
Up to 4 analog samples can be recorded by the hardware (``A0`` ... ``A3``), and all
recording is done at 16-bit levels (but be aware that the ADC in the Pico will only
ever return values between 0...4095).
Up to 4 (or 8 in the case of the RP2350B) analog samples can be recorded by the
hardware (``A0`` ... ``A3``), and all recording is done at 16-bit levels (but be
aware that the ADC in the Pico will only ever return values between 0...4095).
The interface for the ``ADCInput`` device is very similar to the ``I2S`` input
device, and most code can be ported simply by instantiating a ``ADCInput``
@ -26,11 +26,12 @@ allowed while in use.
ADC Input API
-------------
ADCInput(pin0 [, pin1, pin2, pin3])
ADCInput(pin0 [, pin1, pin2, pin3[, pin4, pin5, pin6, pin7])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creates an ADC input object which will record the pins specified in the code.
Only pins ``A0`` ... ``A3`` can be used, and they must be specified in increasing
order (i.e. ``ADCInput(A0, A1);`` is valid, but ``ADCInput(A1, A0)`` is not.
Only pins ``A0`` ... ``A3`` (``A7`` on RP2350B) can be used, and they must be
specified in increasing order (i.e. ``ADCInput(A0, A1);`` is valid,
but ``ADCInput(A1, A0)`` is not.
bool setBuffers(size_t buffers, size_t bufferWords)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
# built documents.
#
# The short X.Y version.
version = u'4.5.1'
version = u'4.5.3'
# The full version, including alpha/beta/rc tags.
release = u'4.5.1'
release = u'4.5.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View file

@ -112,7 +112,7 @@ For only RP2350A variants (using the compile options, not the onboard ID registe
.. code:: cpp
#if defined(PICO_RP2350) && !defined(PICO_RP2350B)
#if defined(PICO_RP2350A) && PICO_RP2350A
...RP2350A only code...
#endif
@ -121,7 +121,7 @@ and not the chip ID register):
.. code:: cpp
#if defined(PICO_RP2350B)
#if defined(PICO_RP2350A) && !PICO_RP2350A
...48-GPIO version code here
#endif

View file

@ -16,6 +16,25 @@ not necessarily simultaneously!).
See the ``Multicore.ino`` example in the ``rp2040`` example directory for a
quick introduction.
Core 1 Operation
----------------
By default, core1 (the second core) has no non-user written code running on it.
No interrupts, exceptions, or other background processing is done (but the core
is still subject to hardware stalls due to on-die memory resource conflicts).
When flash erase or write operations (i.e. ``LittleFS`` or ``EEPROM``) are called
from core0, core1 **will** be paused.
If ``rp2040.getCycleCount`` is needed to operate on the second core, then a
periodic (once ever 16M clock cycles) ``SYSTICK`` exception will happen behind
the scenes. For extremely time-critical operations this may not be desirable
and can be disabled by defining a new ``bool`` variable to ``true`` anywhere
in your sketch:
.. code:: cpp
bool core1_disable_systick = true;
Stack Sizes
-----------
@ -67,6 +86,9 @@ void rp2040.restartCore1()
~~~~~~~~~~~~~~~~~~~~~~~~~~
Hard resets Core1 from Core 0 and restarts its operation from ``setup1()``.
This can cause unpredictable behavior because globals and the heap
are shared between cores and not re-initialized with this call. Use with
extreme caution.
Communicating Between Cores
---------------------------

View file

@ -67,3 +67,5 @@
-Wl,--wrap=cyw43_tcpip_link_status
-Wl,--wrap=cyw43_cb_tcpip_init
-Wl,--wrap=cyw43_cb_tcpip_deinit
-Wl,--wrap=__stack_chk_fail

View file

@ -1,4 +1,5 @@
-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1
-DTARGET_RP2350
-DCYW43_LWIP=1
-DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
-DCFG_TUSB_MCU=OPT_MCU_RP2040

View file

@ -1,4 +1,5 @@
-DPICO_CYW43_ARCH_THREADSAFE_BACKGROUND=1
-DTARGET_RP2350
-DCYW43_LWIP=1
-DCYW43_PIO_CLOCK_DIV_DYNAMIC=1
-DCFG_TUSB_MCU=OPT_MCU_RP2040

View file

@ -49,12 +49,7 @@ bool ADCInput::setBuffers(size_t buffers, size_t bufferWords) {
int ADCInput::_mask(pin_size_t p) {
switch (p) {
#if !defined(PICO_RP2350B)
case 26: return 1;
case 27: return 2;
case 28: return 4;
case 29: return 8;
#else // Starts at 40 and there are 8 of them
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
case 40: return 1;
case 41: return 2;
case 42: return 4;
@ -63,6 +58,11 @@ int ADCInput::_mask(pin_size_t p) {
case 45: return 32;
case 46: return 64;
case 47: return 128;
#else
case 26: return 1;
case 27: return 2;
case 28: return 4;
case 29: return 8;
#endif
default: return 0;
}
@ -106,7 +106,7 @@ bool ADCInput::begin() {
// Set up the GPIOs to go to ADC
adc_init();
int cnt = 0;
#if !defined(PICO_RP2350B)
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
int startpin = 26;
int maxpin = 29;
#else

@ -1 +1 @@
Subproject commit c92b7fde169fceb6b375f6f95a69412caf2d1f0f
Subproject commit 6b772c0ac4a8158011a738e794463a2fe4e84a33

View file

@ -199,6 +199,7 @@ static inline pio_sm_config pio_tdm_out_swap_program_get_default_config(uint off
#define pio_tdm_inout_wrap_target 0
#define pio_tdm_inout_wrap 5
#define pio_tdm_inout_pio_version 0
static const uint16_t pio_tdm_inout_program_instructions[] = {
// .wrap_target
@ -236,6 +237,7 @@ static inline pio_sm_config pio_tdm_inout_program_get_default_config(uint offset
#define pio_tdm_inout_swap_wrap_target 0
#define pio_tdm_inout_swap_wrap 5
#define pio_tdm_inout_swap_pio_version 0
static const uint16_t pio_tdm_inout_swap_program_instructions[] = {
// .wrap_target
@ -659,3 +661,4 @@ static inline void pio_i2s_inout_program_init(PIO pio, uint sm, uint offset, uin
}
#endif

@ -1 +1 @@
Subproject commit 0494ce7169f06a734a7bd7585f49a9fa91fa7318
Subproject commit 8ed63b27be79ab59ee1cd15a950ddd64e7a602f7

View file

@ -31,7 +31,7 @@ static inline void pdm_pio_program_init(PIO pio, uint sm, uint offset, uint clkP
pio_sm_set_consecutive_pindirs(pio, sm, dataPin, 1, false);
pio_sm_set_consecutive_pindirs(pio, sm, clkPin, 1, true);
pio_sm_set_pins_with_mask(pio, sm, 0, (1u << clkPin) );
//pio_gpio_init(pio, dataPin);
pio_gpio_init(pio, dataPin);
pio_gpio_init(pio, clkPin);
pio_sm_init(pio, sm, offset, &c);

View file

@ -18,8 +18,8 @@ static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 16000, 1}, {11025, 116
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 16625, 1}, {11025, 24127, 2}, {16000, 16625, 2}, {22050, 24127, 4}, {32000, 16625, 4}, {44100, 24127, 8}, {48000, 16625, 6}, {88200, 24127, 16}, {96000, 16625, 12}, {176400, 47500, 63}, {192000, 16625, 24}};
#elif F_CPU == 150000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 18750, 1}, {11025, 27211, 2}, {16000, 9375, 1}, {22050, 47619, 7}, {32000, 9375, 2}, {44100, 37415, 11}, {48000, 3125, 1}, {88200, 42517, 25}, {96000, 3125, 2}, {176400, 42517, 50}, {192000, 3125, 4}};
#elif F_CPU == 175000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 21875, 1}, {11025, 15873, 1}, {16000, 21875, 2}, {22050, 15873, 2}, {32000, 21875, 4}, {44100, 15873, 4}, {48000, 21875, 6}, {88200, 15873, 8}, {96000, 21875, 12}, {176400, 62500, 63}, {192000, 21875, 24}};
#elif F_CPU == 176000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 22000, 1}, {11025, 63855, 4}, {16000, 11000, 1}, {22050, 55873, 7}, {32000, 5500, 1}, {44100, 55873, 14}, {48000, 11000, 3}, {88200, 55873, 28}, {96000, 5500, 3}, {176400, 55873, 56}, {192000, 2750, 3}};
#elif F_CPU == 200000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 25000, 1}, {11025, 54422, 3}, {16000, 12500, 1}, {22050, 63492, 7}, {32000, 6250, 1}, {44100, 31746, 7}, {48000, 12500, 3}, {88200, 15873, 7}, {96000, 6250, 3}, {176400, 53288, 47}, {192000, 3125, 3}};
#elif F_CPU == 225000000
@ -28,8 +28,8 @@ static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 28125, 1}, {11025, 204
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 30000, 1}, {11025, 65306, 3}, {16000, 15000, 1}, {22050, 32653, 3}, {32000, 7500, 1}, {44100, 59864, 11}, {48000, 5000, 1}, {88200, 62585, 23}, {96000, 2500, 1}, {176400, 62585, 46}, {192000, 1250, 1}};
#elif F_CPU == 250000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 31250, 1}, {11025, 45351, 2}, {16000, 15625, 1}, {22050, 56689, 5}, {32000, 15625, 2}, {44100, 62358, 11}, {48000, 15625, 3}, {88200, 42517, 15}, {96000, 15625, 6}, {176400, 42517, 30}, {192000, 15625, 12}};
#elif F_CPU == 275000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 34375, 1}, {11025, 49887, 2}, {16000, 34375, 2}, {22050, 37415, 3}, {32000, 34375, 4}, {44100, 37415, 6}, {48000, 34375, 6}, {88200, 37415, 12}, {96000, 34375, 12}, {176400, 35856, 23}, {192000, 34375, 24}};
#elif F_CPU == 276000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 34500, 1}, {11025, 25034, 1}, {16000, 17250, 1}, {22050, 12517, 1}, {32000, 8625, 1}, {44100, 12517, 2}, {48000, 5750, 1}, {88200, 12517, 4}, {96000, 2875, 1}, {176400, 12517, 8}, {192000, 2875, 2}};
#elif F_CPU == 300000000
static const PWMPacerPrecalc __PWMAudio_pacer[] = {{8000, 37500, 1}, {11025, 27211, 1}, {16000, 18750, 1}, {22050, 27211, 2}, {32000, 9375, 1}, {44100, 47619, 7}, {48000, 6250, 1}, {88200, 37415, 11}, {96000, 3125, 1}, {176400, 42517, 25}, {192000, 3125, 2}};
#else

View file

@ -263,8 +263,8 @@ void SPIClassRP2040::abortAsync() {
bool SPIClassRP2040::setRX(pin_size_t pin) {
#ifdef PICO_RP2350B
constexpr uint64_t valid[2] = { __bitset({0, 4, 16, 20, 32, 26}) /* SPI0 */,
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({0, 4, 16, 20, 32, 36}) /* SPI0 */,
__bitset({8, 12, 24, 28, 40, 44}) /* SPI1 */
};
#else
@ -290,7 +290,7 @@ bool SPIClassRP2040::setRX(pin_size_t pin) {
}
bool SPIClassRP2040::setCS(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({1, 5, 17, 21, 33, 37}) /* SPI0 */,
__bitset({9, 13, 25, 29, 41, 45}) /* SPI1 */
};
@ -317,7 +317,7 @@ bool SPIClassRP2040::setCS(pin_size_t pin) {
}
bool SPIClassRP2040::setSCK(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({2, 6, 18, 22, 34, 38}) /* SPI0 */,
__bitset({10, 14, 26, 30, 42, 46}) /* SPI1 */
};
@ -344,7 +344,7 @@ bool SPIClassRP2040::setSCK(pin_size_t pin) {
}
bool SPIClassRP2040::setTX(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({3, 7, 19, 23, 35, 39}) /* SPI0 */,
__bitset({11, 15, 27, 31, 43, 47}) /* SPI1 */
};

View file

@ -98,7 +98,7 @@ public:
return (reverseByte(w & 0xff) << 8) | (reverseByte(w >> 8));
}
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
static constexpr int GPIOIRQREGS = 6;
#else
static constexpr int GPIOIRQREGS = 4;

View file

@ -79,7 +79,7 @@ inline spi_cpha_t SPISlaveClass::cpha(SPISettings _spis) {
}
bool SPISlaveClass::setRX(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({0, 4, 16, 20, 32, 26}) /* SPI0 */,
__bitset({8, 12, 24, 28, 40, 44}) /* SPI1 */
};
@ -106,7 +106,7 @@ bool SPISlaveClass::setRX(pin_size_t pin) {
}
bool SPISlaveClass::setCS(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({1, 5, 17, 21, 33, 37}) /* SPI0 */,
__bitset({9, 13, 25, 29, 41, 45}) /* SPI1 */
};
@ -133,7 +133,7 @@ bool SPISlaveClass::setCS(pin_size_t pin) {
}
bool SPISlaveClass::setSCK(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({2, 6, 18, 22, 34, 38}) /* SPI0 */,
__bitset({10, 14, 26, 30, 42, 46}) /* SPI1 */
};
@ -160,7 +160,7 @@ bool SPISlaveClass::setSCK(pin_size_t pin) {
}
bool SPISlaveClass::setTX(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({3, 7, 19, 23, 35, 39}) /* SPI0 */,
__bitset({11, 15, 27, 31, 43, 47}) /* SPI1 */
};

View file

@ -49,7 +49,7 @@ TwoWire::TwoWire(i2c_inst_t *i2c, pin_size_t sda, pin_size_t scl) {
}
bool TwoWire::setSDA(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44}) /* I2C0 */,
__bitset({2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46}) /* I2C1 */
};
@ -76,7 +76,7 @@ bool TwoWire::setSDA(pin_size_t pin) {
}
bool TwoWire::setSCL(pin_size_t pin) {
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
constexpr uint64_t valid[2] = { __bitset({1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45}) /* I2C0 */,
__bitset({3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47}) /* I2C1 */
};

View file

@ -75,7 +75,7 @@ void __removeEthernetPacketHandler(int id) {
}
#define GPIOSTACKSIZE 8
#ifdef PICO_RP2350B
#if defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
#define GPIOIRQREGS 6
#define GPIOIRQREGSINIT 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
#else

View file

@ -8,7 +8,7 @@
const char* host = "djxmmx.net";
const uint16_t port = 17;
Wiznet55rp20lwIP eth(1 /* chip select */);
Wiznet55rp20lwIP eth(20 /* chip select */);
void setup() {
Serial.begin(115200);

View file

@ -51,7 +51,7 @@ public:
Constructor that uses the default hardware SPI pins
@param cs the Arduino Chip Select / Slave Select pin (default 10)
*/
Wiznet55rp20(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1);
Wiznet55rp20(int8_t cs = WIZNET_PIO_SPI_CS_PIN, SPIClass& spi = SPI, int8_t intr = -1);
//Wiznet55rp20();
/**

View file

@ -14,6 +14,7 @@
#define wiznet_pio_spi_write_read_wrap_target 0
#define wiznet_pio_spi_write_read_wrap 8
#define wiznet_pio_spi_write_read_pio_version 0
#define wiznet_pio_spi_write_read_offset_write_bits 0u
#define wiznet_pio_spi_write_read_offset_write_end 3u
@ -38,6 +39,10 @@ static const struct pio_program wiznet_pio_spi_write_read_program = {
.instructions = wiznet_pio_spi_write_read_program_instructions,
.length = 9,
.origin = -1,
.pio_version = 0,
#if PICO_PIO_VERSION > 0
.used_gpio_ranges = 0x0
#endif
};
static inline pio_sm_config wiznet_pio_spi_write_read_program_get_default_config(uint offset) {

View file

@ -1,6 +1,6 @@
{
"name": "framework-arduinopico",
"version": "1.40501.0",
"version": "1.40503.0",
"description": "Arduino Wiring-based Framework (RPi Pico RP2040, RP2350)",
"keywords": [
"framework",

View file

@ -80,6 +80,9 @@
{
"name": "Adafruit KB2040"
},
{
"name": "Adafruit Feather RP2350 Adalogger"
},
{
"name": "Adafruit Feather RP2350 HSTX"
},

View file

@ -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.5.1
version=4.5.3
# Required discoveries and monitors
# ---------------------------------
@ -203,6 +203,7 @@ tools.uf2conv-network.cmd={runtime.platform.path}/system/python3/python3
tools.uf2conv-network.upload.protocol=uf2
tools.uf2conv-network.upload.params.verbose=
tools.uf2conv-network.upload.params.quiet=
tools.uf2conv-network.upload.field.password=Password
tools.uf2conv-network.upload.pattern="{cmd}" -I "{runtime.platform.path}/tools/espota.py" -i "{upload.port.address}" -p "{upload.port.properties.port}" "--auth={upload.field.password}" -f "{build.path}/{build.project_name}.bin"
#tools.picotool.cmd={runtime.tools.pqt-picotool.path}

View file

@ -30,6 +30,15 @@ as necessary to add any add'l fields or menus required. Used because the
`boards.txt` file is very repetitive and it's safer to generate with code
than by hand.
## makepacer.cpp
Generates ``libraries/PWMAudio/src/PWMAudioPrecalc.h` which contains the
precalculated DMA pacer settings for common audio sample rates and CPU
frequencies. Makes setting the frequency for PWMAudio instantaneous.
## makepio.py
Rebuilds all the ``*.pio`` files in the core and libraries using the
currently installed pioasm. Use when a new PIOASM is available.
## makever.py
Updates the version info prior to a release in platform.txt, package.json,
and the version header. Run from root of the repo.

View file

@ -0,0 +1,55 @@
{
"build": {
"arduino": {
"earlephilhower": {
"boot2_source": "none.S",
"usb_vid": "0x239A",
"usb_pid": "0x816D"
}
},
"core": "earlephilhower",
"cpu": "cortex-m33",
"extra_flags": "-DARDUINO_ADAFRUIT_FEATHER_RP2350_ADALOGGER -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 ",
"f_cpu": "150000000L",
"hwids": [
[
"0x2E8A",
"0x00C0"
],
[
"0x239A",
"0x816D"
]
],
"mcu": "rp2350",
"variant": "adafruit_feather_rp2350_adalogger"
},
"debug": {
"jlink_device": "RP2350_0",
"openocd_target": "rp2350.cfg",
"svd_path": "rp2350.svd"
},
"frameworks": [
"arduino"
],
"name": "Feather RP2350 Adalogger",
"upload": {
"maximum_ram_size": 524288,
"maximum_size": 8388608,
"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": "Adafruit"
}

View file

@ -48,7 +48,8 @@
"raspberrypi-swd",
"picotool",
"picoprobe"
]
],
"psram_length": 8388608
},
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
"vendor": "Adafruit"

View file

@ -85,7 +85,7 @@ def BuildPSRAMFreq(name):
print("%s.menu.psramfreq.freq%d.build.psram_freq=-DRP2350_PSRAM_MAX_SCK_HZ=%d" % (name, s, s * 1000000))
def BuildRP2350Variant(name):
for l in [ ("RP2350A", "-DPICO_RP2350A=1"), ("RP2530B", "-DPICO_RP2350B=1") ]:
for l in [ ("RP2350A", "-D__PICO_RP2350A=1"), ("RP2530B", "-D__PICO_RP2350A=0") ]:
print("%s.menu.variantchip.%s=%s" % (name, l[0], l[0]))
print("%s.menu.variantchip.%s.build.variantdefines=%s" % (name, l[0], l[1]))
@ -112,7 +112,7 @@ def BuildStackProtect(name):
print("%s.menu.stackprotect.Disabled=Disabled" % (name))
print("%s.menu.stackprotect.Disabled.build.flags.stackprotect=" % (name))
print("%s.menu.stackprotect.Enabled=Enabled" % (name))
print("%s.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector" % (name))
print("%s.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector-all" % (name))
def BuildExceptions(name):
print("%s.menu.exceptions.Disabled=Disabled" % (name))
@ -364,7 +364,7 @@ def MakeBoard(name, chip, vendor_name, product_name, vid, pid, pwr, boarddefine,
# Optional, user needs to solder themselves
BuildPSRAM(name)
BuildPSRAMFreq(name)
elif name == "adafruit_feather_rp2350_hstx":
elif (name == "adafruit_feather_rp2350_hstx") or (name == "adafruit_metro_rp2350"):
# Optional, user needs to solder themselves
BuildPSRAM(name)
else:
@ -519,10 +519,11 @@ MakeBoard("adafruit_stemmafriend", "rp2040", "Adafruit", "STEMMA Friend RP2040",
MakeBoard("adafruit_trinkeyrp2040qt", "rp2040", "Adafruit", "Trinkey RP2040 QT", "0x239a", "0x8109", 250, "ADAFRUIT_TRINKEYQT_RP2040", 8, 0, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_macropad2040", "rp2040", "Adafruit", "MacroPad RP2040", "0x239a", "0x8107", 250, "ADAFRUIT_MACROPAD_RP2040", 8, 0, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_kb2040", "rp2040", "Adafruit", "KB2040", "0x239a", "0x8105", 250, "ADAFRUIT_KB2040_RP2040", 8, 0, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_feather_rp2350_adalogger", "rp2350", "Adafruit", "Feather RP2350 Adalogger", "0x239a", "0x816D", 250, "ADAFRUIT_FEATHER_RP2350_ADALOGGER", 8, 0, "none")
MakeBoard("adafruit_feather_rp2350_hstx", "rp2350", "Adafruit", "Feather RP2350 HSTX", "0x239a", "0x814f", 250, "ADAFRUIT_FEATHER_RP2350_HSTX", 8, 0, "none")
MakeBoard("adafruit_floppsy", "rp2040", "Adafruit", "Floppsy", "0x239a", "0x8151", 250, "ADAFRUIT_FLOPPSY_RP2040", 16, 0, "boot2_w25q080_2_padded_checksum")
MakeBoard("adafruit_metro_rp2350", "rp2350", "Adafruit", "Metro RP2350", "0x239a", "0x814d", 250, "ADAFRUIT_METRO_RP2350", 16, 0, "none")
MakeBoard("adafruit_fruitjam", "rp2350", "Adafruit", "Fruit Jam RP2350", "0x239a", "0x816B", 250, "ADAFRUIT_FRUITJAM_RP2350", 16, 0, "none")
MakeBoard("adafruit_fruitjam", "rp2350", "Adafruit", "Fruit Jam RP2350", "0x239a", "0x816B", 250, "ADAFRUIT_FRUITJAM_RP2350", 16, 8, "none")
# Amken
MakeBoard("amken_bunny", "rp2040","Amken","BunnyBoard","0x2770",["0x7303"],250,"AMKEN_BB",128,0,"boot2_w25q128jvxq_4_padded_checksum","","https://www.amken3d.com")
MakeBoard("amken_revelop", "rp2040","Amken","Revelop","0x2770",["0x7304"],250,"AMKEN_REVELOP",32,0,"boot2_W25Q32JVxQ_4_padded_checksum","","https://www.amken3d.com")

View file

@ -51,7 +51,7 @@ int main(int argc, char **argv) {
(void) argc;
(void) argv;
int M = 1000000;
int fsys[] = {50*M, 100*M, 120*M, 125*M, 128*M, 133*M, 150*M, 175*M, 200*M, 225*M, 240*M, 250*M, 275*M, 300*M};
int fsys[] = {50*M, 100*M, 120*M, 125*M, 128*M, 133*M, 150*M, 176*M, 200*M, 225*M, 240*M, 250*M, 276*M, 300*M};
int freq[] = {8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000};
FILE *f = fopen("../libraries/PWMAudio/src/PWMAudioPrecalc.h", "w");
fprintf(f, "// Generated by tools/makepacer.cpp, do not edit\n");

21
tools/makepio.py Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import os
import subprocess
PIOASM="system/pioasm/pioasm"
def recursivepioasm(path):
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith(".pio"):
subprocess.run([PIOASM, "-o", "c-sdk", os.path.join(root, f), os.path.join(root, f) + ".h"])
print(os.path.join(root, f))
def main():
recursivepioasm("cores")
recursivepioasm("libraries")
if __name__ == "__main__":
main()

View file

@ -0,0 +1,53 @@
#pragma once
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (7u)
#define PIN_NEOPIXEL (21u)
#define NUM_NEOPIXEL (1)
// SD Card connector
#define PIN_CARD_DETECT (13u)
#define PIN_SD_CLK (14u)
#define PIN_SD_CMD_MOSI (15u)
#define PIN_SD_DAT0_MISO (16u)
#define PIN_SD_DAT1 (17u)
#define PIN_SD_DAT2 (18u)
#define PIN_SD_DAT3_CS (19u)
// UARTs
#define PIN_SERIAL1_TX (0u)
#define PIN_SERIAL1_RX (1u)
#define PIN_SERIAL2_TX (99u) // not pinned out
#define PIN_SERIAL2_RX (99u)
// SPI
#define PIN_SPI0_MISO (20u)
#define PIN_SPI0_MOSI (23u)
#define PIN_SPI0_SCK (22u)
#define PIN_SPI0_SS (13u)
#define __SPI0_DEVICE spi0
// SPI1 for SD card
#define PIN_SPI1_MISO PIN_SD_DAT0_MISO
#define PIN_SPI1_MOSI PIN_SD_CMD_MOSI
#define PIN_SPI1_SCK PIN_SD_CLK
#define PIN_SPI1_SS PIN_SD_DAT3_CS
#define __SPI1_DEVICE spi1
// Wire
#define __WIRE0_DEVICE i2c0
#define PIN_WIRE0_SDA (2u)
#define PIN_WIRE0_SCL (3u)
#define __WIRE1_DEVICE i2c1
#define PIN_WIRE1_SDA (31u) // not pinned out
#define PIN_WIRE1_SCL (31u)
#define SERIAL_HOWMANY (1u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (1u)
#include "../generic/common.h"

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (7u)

View file

@ -1,5 +1,5 @@
#pragma once
#define PICO_RP2350B 1
#define PICO_RP2350A 0
// LEDs
#define PIN_LED (29u)

View file

@ -1,5 +1,6 @@
#pragma once
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
// LEDs
#define PIN_LED (23u)

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
#define PINS_COUNT (30u)
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
#define PINS_COUNT (30u)
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (29u)
@ -62,8 +64,13 @@
#define PIN_SPI0_SS (21u)
// Wire
#define PIN_WIRE0_SDA (16u)
#define PIN_WIRE0_SCL (17u)
#define __WIRE0_DEVICE i2c0
#define PIN_WIRE0_SDA (16u)
#define PIN_WIRE0_SCL (17u)
#define __WIRE1_DEVICE i2c1
#define PIN_WIRE1_SDA (31u) // Not used.
#define PIN_WIRE1_SCL (31u) // Not used.

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (2u)

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// DatanoiseTV PicoADK v2 - Audio Development Kit with RP2350A
// https://github.com/DatanoiseTV/PicoDSP-Hardware

View file

@ -164,7 +164,7 @@ static const uint8_t D29 = __PIN_D29;
static const uint8_t D29 = (29u);
#endif
#if !defined(PICO_RP2350B)
#if defined(PICO_RP2040) || (defined(PICO_RP2350) && PICO_RP2350A)
#ifdef __PIN_A0
static const uint8_t A0 = __PIN_A0;
@ -190,7 +190,7 @@ static const uint8_t A3 = __PIN_A3;
static const uint8_t A3 = (29u);
#endif
#elif defined(PICO_RP2350B)
#elif defined(PICO_RP2350) && !PICO_RP2350A // RP2350B
#ifdef __PIN_D30
static const uint8_t D30 = __PIN_D30;

View file

@ -3,6 +3,7 @@
// Pin definitions taken from:
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
#define PICO_RP2350A __PICO_RP2350A
// LEDs
#define PIN_LED (25u)

View file

@ -3,7 +3,7 @@
// Pin definitions taken from:
// https://github.com/Architeuthis-Flux/JumperlessV5/tree/main/Hardware/Jumperless23V50
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
// LEDs
#define PIN_LED (17u)

View file

@ -1,3 +1,3 @@
#pragma once
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
#include "../rpipico2/pins_arduino.h"

View file

@ -1,4 +1,4 @@
#pragma once
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
#define RP2350_PSRAM_CS 8
#include "../rpipico2/pins_arduino.h"

View file

@ -2,7 +2,7 @@
// Enables external PSRAM
#define RP2350_PSRAM_CS 47
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
// This is a bare board with no real predefined pins, so use generic
#include "../generic/pins_arduino.h"

View file

@ -49,7 +49,7 @@
#define RP2350_PSRAM_CS (47u)
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000)
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
/* Pins mappings for marked pins on the board */
static const uint8_t D0 = (0u);

View file

@ -51,7 +51,7 @@
#define RP2350_PSRAM_CS (47u)
#define RP2350_PSRAM_MAX_SCK_HZ (109*1000*1000)
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2530B
/* Pins mappings for marked pins on the board */
static const uint8_t D0 = (0u);

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// Pin definitions taken from:
// https://github.com/rp-rs/rp-hal-boards/blob/main/boards/pimoroni-plasma-2040/src/lib.rs

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// This is a bare board with few predefined pins, so based on generic
// Pin definitions taken from:

View file

@ -3,6 +3,7 @@
// Pin definitions taken from:
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (25u)

View file

@ -5,6 +5,7 @@
// Pin definitions taken from:
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (64u)

View file

@ -1,4 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// Pin definitions taken from:
// https://www.seeedstudio.com/Seeed-XIAO-RP2350-p-5944.html

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// Pin definitions taken from:
// https://rp2xxx-stamp-carrier-xl.solder.party/

View file

@ -3,7 +3,7 @@
// Pin definitions taken from:
// https://rp2xxx-stamp-carrier-xl.solder.party/
#define PICO_RP2350B 1
#define PICO_RP2350A 0 // RP2350B
// LEDs
#define PIN_LED (3u)

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// LEDs
#define PIN_LED (25u)

View file

@ -1,10 +1,8 @@
#pragma once
#include <stdint.h>
#include <cyw43_wrappers.h>
#define PICO_RP2350B 1
#define PICO_RP2350A 0
#define PICO_RP2350A 0 // RP2350B
#define PINS_COUNT (48u)
#define NUM_DIGITAL_PINS (48u)

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
// Taken from schematic at https://cdn.sparkfun.com/assets/e/2/7/6/b/ProMicroRP2040_Graphical_Datasheet.pdf
// LEDs

View file

@ -1,5 +1,7 @@
#pragma once
#define PICO_RP2350A 1
#include <cyw43_wrappers.h>
// LEDs

View file

@ -1,6 +1,6 @@
#pragma once
#define PICO_RP2350A 0
#define PICO_RP2350A 0 // RP2350B
#include <cyw43_wrappers.h>

View file

@ -1 +1,2 @@
#define PICO_RP2350A 1
#include "../generic/pins_arduino.h"

View file

@ -1 +1,2 @@
#define PICO_RP2350A 1
#include "../generic/pins_arduino.h"

View file

@ -1 +1,40 @@
#include "../generic/pins_arduino.h"
#pragma once
// Pin definitions taken from:
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
// LEDs
#define PIN_LED (19u)
// Serial
#define PIN_SERIAL1_TX (0u)
#define PIN_SERIAL1_RX (1u)
#define PIN_SERIAL2_TX (8u)
#define PIN_SERIAL2_RX (9u)
// SPI
// Default SPI0 pins are used internally and are unavailable on this board. To use SPI0 other peripherals must be sacrificed.
#define PIN_SPI0_MISO (2u) // 16u is connected to the buck-boost converted.
#define PIN_SPI0_MOSI (3u) // 19u is connected to USERLED, defined as PIN_LED.
#define PIN_SPI0_SCK (4u) // 18u is connected to a voltage divider on VBUS.
#define PIN_SPI0_SS (5u) // 17u doesn't even show up in the schematics.
#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 (26u)
#define PIN_WIRE1_SCL (27u)
#define SERIAL_HOWMANY (3u)
#define SPI_HOWMANY (2u)
#define WIRE_HOWMANY (2u)
#include "../generic/common.h"