Squashed 'third_party/pico-sdk/' changes from 2062372d20..2e6142b15b

2e6142b15b SDK 1.4.0 release
5e9a5e827b Add Pico W and lwIP support
77c04e458c revert TinyUSB update (#889)
bc5d1b8485 Add channel_config_set_high_priority (#888)
85dbbfdf4d Update TinyUSB to commit 39069cf4b to pick up recent RP2040 fixes (#886)
e7267f99fe Fix GPIO # callback parameter (#880)
4c49427bf3 Fix auto_init_recursive_mutex definition for C++ (#875)
33818dd0bd Increase PLL min VCO from 400MHz to 750MHz for improved stability across operating conditions (#869)
8f09099757 sem_acquire has no reason to do a notify! (#857)
9644399993 Suppress new GCC 12 warning (#842)
b3c56e7169 Add stderr support and remove 1us timeout for timeouts of 0us (#858)
7858601a58 stdio_usb improvements (#871)
0bdd463898 Add DatanoiseTV DSP Board. (#866)
7daa20ce4c Add board definition for the RP2040 Stamp Round Carrier (#837)
705b5cedcd Wrap realloc() call with malloc_mutex in multicore (#864)
bdd9746635 Don't copy .data for NO_FLASH binaries, as it's loaded in-place (#859)
babc4a1794 Remove 'default=none' from PICO_CONFIG lines (#865)
6c19d20aa5 Fix up filename displayed by extract_config.py when an invalid attribute is found (#853)
672e48e9e9 Add sem_try_acquire(). Fixes #846 (#856)
ef47dfeeaf Add new GPIO APIs for adding shared GPIO handlers, and improve docs (#850)
6389927cf9 Add some optional header includes, to make per-target changes to config easier (#851)
d3dcbb8292 Add new user_irq claim APIs to make it easier for independent code using them to interoperate (#854)
f3c446ae14 move get_core_num() into platform.h (#852)
4e4cf11d9b Start SDK 1.3.2 development
426e46126b SDK 1.3.1 release
ebc601f71f Re-merge SDK1.3.0 history back into SDK1.3.1
1e6c122fc9 gate inclusion of pico.h in binary info, so as not to break picotool builds (#836)
7880405292 Doxygen typo (#835)
530204ec0c Small tweak to busy_wait_at_least_cycles doxygen (#834)
ea79d29cd6 Merge non-squashed history of 1.3.0 release back in to master
b2ad632c24 Minor additions to PIO documentation (#831)
658a21b946 Update rtc_set_datetime docs to point out that the written value may not be immediately visible (#832)
e44d2c0010 Add busy_wait_at_least_cycles method (#830)
43a5593e8f Pass PIOASM_EXTRA_SOURCE_FILES to Pioasm sub-cmake and add OUTPUT_FORMAT option (fixes #827) (#828)
792813926d Make pioasm accept windows CRLF input (#829)
159d552150 Fix bug in irq_remove_shared_handler and add test #823 (#825)
3a3d5fe6c4 Small IRQ doxygen tweaks (#824)
5e22c09660 convert unlikely panic to hard_assert to not waste space for string (#826)
4e62c26a2c Add documentation to dma_channel_abort regarding errata RP2040-E13 (#816)
5a927792ef Suppress false GCC 11 warning on TinyUSB (#819)
60a6fea534 Fix list management in stdio_set_driver_enabled so drivers can be freely added and removed (#822)
04c68c554b cleanup pico_stdlib_test. add actual check for __builtin bitops (#821)
0d2591e1f1 Pad all but last sector in flash binary to write whole of sector (#800)
81bdcb6681 print build type during CMake config; remove spurious call to pico_is_toplevel_project() (#818)
9c616da1e5 fix bug in pico_float_test (#817)
f260477802 Adapt assembler syntax to eliminate Clang errors. (LLVM 14.0.0) (#798)
e1c5fd34e4 PLL setup check bug (#796) (#806)
5d422deed1 Add extra info about address_range defined values (#652)
0c501c246a Add wiznet_w5100s_evb_pico support (#666)
259da19660 Include structs/iobank0.h from hardware/gpio.h (#733) (#807)
5325008956 Added board definition for upcoming Pimoroni motor driver (#795)
510ca47c92 Additional PWM validation and small tidy-up (#801)
d5121dc880 Removed unnecessary ifdefs from Pimoroni boards (#802)
3c450011da Additional param-validation for PIO (#805)
6149b9e4ec Add board definition for Seeed Xiao RP2040 (#691)
8554fc4ea1 Add is_at_the_end_of_time() method (#784)
01290c4cb3 Added int_frac function for configuring PWM (#768)
8d43364cfb Small typos (#776)
1c9f72ba1c Small edits to the Doxygen mainpage and update the RPi logo (#778)
76c1830aeb Add gpio_deinit (#793)
c66a2c1c3b Remove implicit grouping for PIO defines (#779)
e4a2aa7262 Fix typo in binary_info description (#788)
fc86203f49 comment typo (#794)
6619a2d329 Typo (#799)
5a427fbf1f irq_add_shared_handler assertion fix #724 (#747)
bb5a2a3906 Added definition for Badger RP2040 board (#735)
8291f1013a add #ifdef guards to vgaboard.h to allow user overrides (#746)
e90f831756 add board definition of eetree gamekit rp2040 (#732)
541f93541c improve comment (#658)
17d53af105 Allow 252-byte binaries to be checksummed (#764)
1896b1491b fix __ctzdi2 for values with non-zero low 32 bits (fixes #765) (#766)
3d45276423 Added board definition for upcoming Pimoroni servo driver (#769)
d35083b3f7 Fix typo in SIO register description (#770)
38b26b5d65 pico_sdk_import: don't recurse git submodules (#772)
d54104a1e5 fix when PICO_NO_BINARY_INFO is set (#693)
bc3484e793 Mark __aeabi_lmul section as allocatable and executable (#722)
b7e82b638a Fix function-names reported by  hardware_pwm_test (#736)
bf9848eaf9 Updated DMA CTRL_TRIG.CHAIN_TO reset values (#743)
ae7ef546a6 Fix typo in Doxygen comment (#731)
b3cf3e8f6f Correct comment in time.h (#715)
25a3b36793 Fix assert in adc_set_round_robin() (#698)
96afce8ece Add board definition for Adafruit Macropad (#684)
5bcf4ed83a Clarify header-comments about pico_enable_stdio_ CMake-functions (#705)
e379f6764b Add board definition for RP2040 Stamp and Carrier (#696)
91462e430a Add `__attribute__((noreturn))` to `_exit` (#707)
d831eff5a2 fix pioasm python output (#694) (#695)
215f77b836 Moves the #if guards to before the comments (#690)
0f67a6c00c Add board definition for Adafruit KB2040 (#676)
add120e4f6 add missing change to dma.h from __force_inline fix (#680)
386e2a7bc6 Added Tiny2040 2MB (#672)
0562089fab fixup __forceinline for cpp code and add kitchen_sink cpp test (#670)
269332dc21 rename pybstick26_rp2040.h to garatronic_pybstick26_rp2040.h (#675)
a8fa19a74d pio_set_irqn_source_mask_enabled() sets wrong irq (#655)
699838d153 Start SDK 1.3.1 development (#648)
60c5a929cc Remove <b> from mutex doxygen due to PDF generation bug
d0af70bd77 fix __packed attribute for MSVC (#646)
da476610e2 allow override of XOSC_MHZ (#644)
d7358e4ed8 update generated struct headers to fix collision (#641)
ccccff8450 Add pybstick26_rp2040 support (#636)
d0c7642369 Update ADC ENOB comment to match (measured) value in RP2040 datasheet (#643)
cc1e2e8758 Small typo in kitchen_sink (#642)
e4d6ff9ecd Small PICO_PLATFORM=host fixes (#639)
97eec951b1 Another .org -> .com fix (#638)
fba9c8ce4d change SDK version to 1.3.0 (#628)
da7c39bc23 Fix some of the (simpler) errors reported by the doxygen command (#617)
b04a09110f revert additional assertion check which breaks used of hw_alias macro outside of functions (#635)
5641cd0a4a __aeabi_memset* were switching the wrong arguments (#634)
68555c9751 Added some waveshare boards definition (#619)
e5110dfce1 add docs for pio_instructions.h (#624)
3604a6fa13 add CONTRIBUTING.md (#626)
e850214938 Platform updates (#611)
723dfd04ff add more/better documentation to pico/multicore (#620)
05418b4e71 fix minor bug in add_repeating_timer_us, and add some comments (#621)
83cd1da1ef fix build if TinyUSB not present (#631)
0ccd0db163 Update to TinyUSB 0.12.0 (#622)
22b0d5d2ed Update links in Doxygen pages from .org to .com (#625)
3c72e753b6 Split recursive mutex into their own functions (was Reduce performance hit of recursive mutex) (#495)
9320d192c3 add watchdog_enable_caused_reboot (minor compatibility issue) (#594)
68571ad33e Hardware struct regeneration (#613)
a0450d0133 Updated reg_headers and SVD (#612)
3c94bc8137 Change _watchdog_enable to trigger immediate reboot when no delay set (#561)
f808b5f2dc Add DREQ methods for PWM/SPI/UART/I2C (#603)
2f2e62968d Use auto-generated hardware/structs/ headers (based off SVD) SVD errors fixed.
a793222331 add template PR - very polite (#596)
ec4036181f tweak info message for TinyUSB support (#590)
db47fba48d respect OUTPUT_NAME target property when generating supplemental files (#592)
a0d4bdf731 fix pico_set_printf_implementation(TARGET compiler) (#593)
d50e743e0e make type punning of floating point/int in float_math and double_math use union to avoid warnings (#600)
30673fb6d0 move inline assembly constant out into C code so it doesn't get out of range in a large function (#602)
e76d5a9008 add dma_timer related methods (#604)
9f1c37318b add irq_get_priority method - improve efficiency of irq_init_priorities (#609)
4c9ba3e8ad USB: Fix description of Length 0 in dpram_regs. Fixes #541 (#608)
ace97f3387 More accurate register access-types and reset-values (#601)
0fa58ed219 Adding/propage macros/signature typedefs for ROM functions. Make rom_func_lookup non-flash safe for flash functions (#586)
0a32023aac fix arg parsing segfault (#595)
13be546dc3 pico_stdio improvements (#598)
12017a07ab SPINLOCK regs are RW. (#599)
9319ab11d9 Add xip window alias macros (#566) (#585)
62854f5eff shrink max-page-size for linker to more sensible 4096 by default (#587)
13ed99df0d split out usb_reset_interface header into its own library for consumption by picotool or others (#589)
0fdf543126 Missing extern C in datetime.h #581 (#584)
3c53029c24 Fix some typos (#517)
ce0db40223 adafruit_feather_rp2040: Fix default I2C instance (#526)
a119b5bd9f Fix semihosting_putc (#530)
eb42ecfaa5 Added definitions for some upcoming Pimoroni LED driver boards (#535)
cd4e53a202 Use W25Q080 second stage loader for Nano RP2040 Connect (#537)
f63a14e9ee Change PWM_CH1_DIV_INT_LSB to PWM_CH0_DIV_INT_LSB (#560)
2214468b51 Add Adafruit Trinkey QT2040 board (#525)
e12713d70b pio_assembler: typo fix (#538)
e6b8c7b64e bugfix: "WO" registers should be listed in the SVD as write-only, not read-write (#544)
1d0dcc8177 pico_time: Fix alarm_pool_dump_key format string (#557)
46d8597d35 Add hardware_divider to pico_divider dependencies (#571)
d7feac1495 Fix syntax error in cmake when using custom stage2 (#580)
ca232e9404 Add Melopero Shake RP2040 Board header file (#565)
c08136b696 Move ret_dzero to the same section as it get used (#513)
672d18a6f0 Fix default PICO_BOARD value (#536)
2622e9bc29 Enable UART RX timeout IRQ, as well as RX IRQ, so that individual characters can be received.
9a586371db Add doxygen clarifying PWM behaviour when enabled/disabled, and advice for controlling the pin state when disabled (#521)
a6a436b1fe use PUBLIC for pio headers on any target except INTERFACE library
7e90980118 Add explanatory note on 7-bit I2C addresses (#520)
ae6e574f53 Improve wording of comments in irq.h (#509)
ccc0ba5649 elf2uf2: correctly parse ELF files where the program header is not directly following the file header
5e05469373 bug in sleep_until on host mode for macOS (#502)
dc4342f0f6 Update usb regs to fix https://github.com/raspberrypi/pico-feedback/issues/172
35b4965054 make sure PICO_DEFAULT_BOOT_STAGE2_FILE is defined in parent CMake file (#491)
e02c6b327d Allow one of float/double to have 'none' impl but not the other - previously caused a link error
f4ab723eb5 compile failure with PICO_STDOUT_MUTEX=0
529d7087eb fix operatore precedence of */ vs +- in pioasm
cefe5c5b2a Better support for PICO_DISABLE_SHARED_IRQ_HANDLERS (#496)
edcb65c916 Enable I2C FIFO full hold in slave mode (stretch clock when RX full), fixes #456 (#494)
f16ccfa1ff Small comment typos
44feae4caf set DIVISOR for each use of h/w divider
61b7cbdc54 Using ' inline __always_inline' also for GNUC 7. (#484)
21bbaf3ca6 remove -Winline (#481)
4328b2c75f fix pioasm python output (#479)
1f1c6162cd Header info string updates for PIO DBG_PADx and XOSC STARTUP (#478)
979045dc12 removed CMSIS from SDK doxygen
d42e6a9d10 include pico.h so that uint is defined (#475)
654b66693f start 1.3.0 development

git-subtree-dir: third_party/pico-sdk
git-subtree-split: 2e6142b15b8a75c1227dd3edbe839193b2bf9041
Signed-off-by: Ravago Jones <ravagojones@gmail.com>
Change-Id: I7d5ab3e7e797e8e956d3a651b600448157ab0608
diff --git a/src/boards/include/boards/adafruit_kb2040.h b/src/boards/include/boards/adafruit_kb2040.h
new file mode 100644
index 0000000..9353082
--- /dev/null
+++ b/src/boards/include/boards/adafruit_kb2040.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_ADAFRUIT_KB2040_H
+#define _BOARDS_ADAFRUIT_KB2040_H
+
+// For board detection
+#define ADAFRUIT_KB2040
+
+// On some samples, the xosc can take longer to stabilize than is usual
+#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
+#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
+#endif
+
+//------------- UART -------------//
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 0
+#endif
+
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 1
+#endif
+
+//------------- LED -------------//
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN 17
+#endif
+
+//------------- I2C -------------//
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C 0
+#endif
+
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN 12
+#endif
+
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN 13
+#endif
+
+//------------- SPI -------------//
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 0
+#endif
+
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 19
+#endif
+
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 20
+#endif
+
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 18
+#endif
+
+//------------- FLASH -------------//
+
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/adafruit_macropad_rp2040.h b/src/boards/include/boards/adafruit_macropad_rp2040.h
new file mode 100644
index 0000000..3c0c525
--- /dev/null
+++ b/src/boards/include/boards/adafruit_macropad_rp2040.h
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_ADAFRUIT_MACROPAD_RP2040_H
+#define _BOARDS_ADAFRUIT_MACROPAD_RP2040_H
+
+// For board detection
+#define ADAFRUIT_MACROPAD_RP2040
+
+// On some samples, the xosc can take longer to stabilize than is usual
+#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
+#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
+#endif
+
+// --- BOARD SPECIFIC ---
+#ifndef ADAFRUIT_MACROPAD_KEY1_PIN
+#define ADAFRUIT_MACROPAD_KEY1_PIN 1
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY2_PIN
+#define ADAFRUIT_MACROPAD_KEY2_PIN 2
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY3_PIN
+#define ADAFRUIT_MACROPAD_KEY3_PIN 3
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY4_PIN
+#define ADAFRUIT_MACROPAD_KEY4_PIN 4
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY5_PIN
+#define ADAFRUIT_MACROPAD_KEY5_PIN 5
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY6_PIN
+#define ADAFRUIT_MACROPAD_KEY6_PIN 6
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY7_PIN
+#define ADAFRUIT_MACROPAD_KEY7_PIN 7
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY8_PIN
+#define ADAFRUIT_MACROPAD_KEY8_PIN 8
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY9_PIN
+#define ADAFRUIT_MACROPAD_KEY9_PIN 9
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY10_PIN
+#define ADAFRUIT_MACROPAD_KEY10_PIN 10
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY11_PIN
+#define ADAFRUIT_MACROPAD_KEY11_PIN 11
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_KEY12_PIN
+#define ADAFRUIT_MACROPAD_KEY12_PIN 12
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_LED_PIN
+#define ADAFRUIT_MACROPAD_LED_PIN 13
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_SPEAKER_ENABLE_PIN
+#define ADAFRUIT_MACROPAD_SPEAKER_ENABLE_PIN 14
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_SPEAKER_PIN
+#define ADAFRUIT_MACROPAD_SPEAKER_PIN 16
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_BUTTON_PIN
+#define ADAFRUIT_MACROPAD_BUTTON_PIN 0
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_ROTA_PIN
+#define ADAFRUIT_MACROPAD_ROTA_PIN 17
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_ROTB_PIN
+#define ADAFRUIT_MACROPAD_ROTB_PIN 18
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_NEOPIXEL_PIN
+#define ADAFRUIT_MACROPAD_NEOPIXEL_PIN 19
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_DISPLAY_OLED_CS_PIN
+#define ADAFRUIT_MACROPAD_DISPLAY_OLED_CS_PIN 22
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_DISPLAY_OLED_RESET_PIN
+#define ADAFRUIT_MACROPAD_DISPLAY_OLED_RESET_PIN 23
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_DISPLAY_OLED_DC_PIN
+#define ADAFRUIT_MACROPAD_DISPLAY_OLED_DC_PIN 24
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_DISPLAY_SCK_PIN
+#define ADAFRUIT_MACROPAD_DISPLAY_SCK_PIN 26
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_DISPLAY_MOSI_PIN
+#define ADAFRUIT_MACROPAD_DISPLAY_MOSI_PIN 27
+#endif
+
+#ifndef ADAFRUIT_MACROPAD_DISPLAY_MISO_PIN
+#define ADAFRUIT_MACROPAD_DISPLAY_MISO_PIN 28
+#endif
+
+// no PICO_DEFAULT_UART
+
+//------------- LED -------------//
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN ADAFRUIT_MACROPAD_LED_PIN
+#endif
+
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN ADAFRUIT_MACROPAD_NEOPIXEL_PIN
+#endif
+
+//------------- I2C -------------//
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C 0
+#endif
+
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN 20
+#endif
+
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN 21
+#endif
+
+//------------- SPI -------------//
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 1
+#endif
+
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 27
+#endif
+
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 28
+#endif
+
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 26
+#endif
+
+//------------- FLASH -------------//
+
+// Use slower generic flash access
+#define PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 4
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_FLOAT_SUPPORT_ROM_V1
+#define PICO_FLOAT_SUPPORT_ROM_V1 0
+#endif
+
+#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
+#define PICO_DOUBLE_SUPPORT_ROM_V1 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/datanoisetv_rp2040_dsp.h b/src/boards/include/boards/datanoisetv_rp2040_dsp.h
new file mode 100644
index 0000000..49a357b
--- /dev/null
+++ b/src/boards/include/boards/datanoisetv_rp2040_dsp.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+//
+//------------------------------------------------------------------------------------------
+// Board definition for the DatanoiseTV RP2040 DSP Board
+//
+// This header may be included by other board headers as "boards/datanoisetv_rp2040_dsp.h"
+
+#ifndef _BOARDS_DATANOISETV_RP2040_DSP_H
+#define _BOARDS_DATANOISETV_RP2040_DSP_H
+
+// For board detection
+#define DATANOISETV_RP2040_DSP
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C       0
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN   24 
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN   25
+#endif
+
+// -- FLASH --
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
+#endif
+
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+
+// --- I2S ---
+#ifndef PICO_AUDIO_I2S_DATA_PIN
+#define PICO_AUDIO_I2S_DATA_PIN 16
+#endif
+#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
+#define PICO_AUDIO_I2S_CLOCK_PIN_BASE 17
+#endif
+
+#include "boards/pico.h"
+
+#endif
diff --git a/src/boards/include/boards/eetree_gamekit_rp2040.h b/src/boards/include/boards/eetree_gamekit_rp2040.h
new file mode 100644
index 0000000..f007147
--- /dev/null
+++ b/src/boards/include/boards/eetree_gamekit_rp2040.h
@@ -0,0 +1,79 @@
+/*

+ * Copyright (c) 2021 Raspberry Pi (Trading) Ltd.

+ *

+ * SPDX-License-Identifier: BSD-3-Clause

+ */

+

+// -----------------------------------------------------

+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO

+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES

+// -----------------------------------------------------

+

+#ifndef _BOARDS_EETREE_GAMEKIT_RP2040_H

+#define _BOARDS_EETREE_GAMEKIT_RP2040_H

+

+// For board detection

+#define EETREE_GAMEKIT_RP2040

+

+// --- UART ---

+// no PICO_DEFAULT_UART

+// no PICO_DEFAULT_UART_TX_PIN

+// no PICO_DEFAULT_UART_RX_PIN

+

+// --- LED ---

+#ifndef PICO_DEFAULT_LED_PIN

+    #define PICO_DEFAULT_LED_PIN 4

+#endif

+// no PICO_DEFAULT_WS2812_PIN

+

+// --- I2C ---

+#ifndef PICO_DEFAULT_I2C

+    #define PICO_DEFAULT_I2C 1

+#endif

+#ifndef PICO_DEFAULT_I2C_SDA_PIN

+    #define PICO_DEFAULT_I2C_SDA_PIN 10

+#endif

+#ifndef PICO_DEFAULT_I2C_SCL_PIN

+    #define PICO_DEFAULT_I2C_SCL_PIN 11

+#endif

+

+// --- SPI ---

+// no PICO_DEFAULT_SPI

+// no PICO_DEFAULT_SPI_SCK_PIN

+// no PICO_DEFAULT_SPI_TX_PIN

+// no PICO_DEFAULT_SPI_RX_PIN

+// no PICO_DEFAULT_SPI_CSN_PIN

+

+// --- LCD ---

+#ifndef EETREE_RP2040_LCD_SPI

+    #define EETREE_RP2040_LCD_SPI 0

+#endif

+#ifndef EETREE_RP2040_LCD_DC_PIN

+    #define EETREE_RP2040_LCD_DC_PIN 1

+#endif

+#ifndef EETREE_RP2040_LCD_SCLK_PIN

+    #define EETREE_RP2040_LCD_SCLK_PIN 2

+#endif

+#ifndef EETREE_RP2040_LCD_TX_PIN

+    #define EETREE_RP2040_LCD_TX_PIN 3

+#endif

+#ifndef EETREE_RP2040_LCD_RST_PIN

+    #define EETREE_RP2040_LCD_RST_PIN 0

+#endif

+// no EETREE_RP2040_LCD_CS_PIN

+

+// --- FLASH ---

+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1

+#ifndef PICO_FLASH_SPI_CLKDIV

+    #define PICO_FLASH_SPI_CLKDIV 2

+#endif

+#ifndef PICO_FLASH_SIZE_BYTES

+    #define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)

+#endif

+

+// All boards have B1 RP2040

+#ifndef PICO_RP2040_B0_SUPPORTED

+    #define PICO_RP2040_B0_SUPPORTED  0

+#endif

+

+#endif // _BOARDS_EETREE_GAMEKIT_RP2040_H

diff --git a/src/boards/include/boards/pybstick26_rp2040.h b/src/boards/include/boards/garatronic_pybstick26_rp2040.h
similarity index 90%
rename from src/boards/include/boards/pybstick26_rp2040.h
rename to src/boards/include/boards/garatronic_pybstick26_rp2040.h
index 8a9ca41..d1c0298 100644
--- a/src/boards/include/boards/pybstick26_rp2040.h
+++ b/src/boards/include/boards/garatronic_pybstick26_rp2040.h
@@ -9,11 +9,11 @@
 //       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
 // -----------------------------------------------------
 
-#ifndef _BOARDS_PYBSTICK26_RP2040_H
-#define _BOARDS_PYBSTICK26_RP2040_H
+#ifndef _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
+#define _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
 
 // For board detection
-#define PYBSTICK26_RP2040
+#define GARATRONIC_PYBSTICK26_RP2040
 
 // --- UART ---
 #ifndef PICO_DEFAULT_UART
@@ -82,4 +82,4 @@
 #endif
 
 #endif
-// of #define _BOARDS_PYBSTICK26_RP2040_H
+// of #define _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
diff --git a/src/boards/include/boards/pico_w.h b/src/boards/include/boards/pico_w.h
new file mode 100644
index 0000000..b4a8bd7
--- /dev/null
+++ b/src/boards/include/boards/pico_w.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+// This header may be included by other board headers as "boards/pico.h"
+
+#ifndef _BOARDS_PICO_W_H
+#define _BOARDS_PICO_W_H
+
+// For board detection
+#define RASPBERRYPI_PICO_W
+
+// --- UART ---
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 0
+#endif
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 1
+#endif
+
+// --- LED ---
+// no PICO_DEFAULT_LED_PIN - LED is on Wireless chip
+// no PICO_DEFAULT_WS2812_PIN
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C 0
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN 4
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN 5
+#endif
+
+// --- SPI ---
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 0
+#endif
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 18
+#endif
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 19
+#endif
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 16
+#endif
+#ifndef PICO_DEFAULT_SPI_CSN_PIN
+#define PICO_DEFAULT_SPI_CSN_PIN 17
+#endif
+
+// --- FLASH ---
+
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// note the SMSP mode pin is on WL_GPIO1
+// #define PICO_SMPS_MODE_PIN
+
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#ifndef PICO_RP2040_B1_SUPPORTED
+#define PICO_RP2040_B1_SUPPORTED 0
+#endif
+
+#ifndef CYW43_PIN_WL_HOST_WAKE
+#define CYW43_PIN_WL_HOST_WAKE 24
+#endif
+
+#ifndef CYW43_PIN_WL_REG_ON
+#define CYW43_PIN_WL_REG_ON 23
+#endif
+
+#ifndef CYW43_WL_GPIO_COUNT
+#define CYW43_WL_GPIO_COUNT 3
+#endif
+
+#ifndef CYW43_WL_GPIO_LED_PIN
+#define CYW43_WL_GPIO_LED_PIN 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/pimoroni_badger2040.h b/src/boards/include/boards/pimoroni_badger2040.h
new file mode 100644
index 0000000..0749450
--- /dev/null
+++ b/src/boards/include/boards/pimoroni_badger2040.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_PIMORONI_BADGER2040_H
+#define _BOARDS_PIMORONI_BADGER2040_H
+
+// For board detection
+#define PIMORONI_BADGER2040
+
+// --- BOARD SPECIFIC ---
+#define BADGER2040_UART 0
+#define BADGER2040_TX_PIN 0
+#define BADGER2040_RX_PIN 1
+
+#define BADGER2040_I2C 0
+#define BADGER2040_INT_PIN 3
+#define BADGER2040_SDA_PIN 4
+#define BADGER2040_SCL_PIN 5
+
+#define BADGER2040_3V3_EN_PIN 10
+
+#define BADGER2040_SW_DOWN_PIN 11
+#define BADGER2040_SW_A_PIN 12
+#define BADGER2040_SW_B_PIN 13
+#define BADGER2040_SW_C_PIN 14
+#define BADGER2040_SW_UP_PIN 15
+
+#define BADGER2040_INKY_SPI 0
+#define BADGER2040_INKY_MISO_PIN 16
+#define BADGER2040_INKY_CSN_PIN 17
+#define BADGER2040_INKY_SCK_PIN 18
+#define BADGER2040_INKY_MOSI_PIN 19
+#define BADGER2040_INKY_DC_PIN 20
+#define BADGER2040_INKY_RESET_PIN 21
+#define BADGER2040_INKY_BUSY_PIN 26
+
+#define BADGER2040_USER_SW_PIN 23
+#define BADGER2040_USER_LED_PIN 25
+
+#define BADGER2040_VBUS_DETECT_PIN 24
+#define BADGER2040_VREF_POWER_PIN 27
+#define BADGER2040_1V2_REF_PIN 28
+#define BADGER2040_BAT_SENSE_PIN 29
+
+// --- UART ---
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART BADGER2040_UART
+#endif
+
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN BADGER2040_TX_PIN
+#endif
+
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN BADGER2040_RX_PIN
+#endif
+
+// --- LED ---
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN BADGER2040_USER_LED_PIN
+#endif
+// no PICO_DEFAULT_WS2812_PIN
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C BADGER2040_I2C
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN BADGER2040_SDA_PIN
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN BADGER2040_SCL_PIN
+#endif
+
+// --- SPI ---
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI BADGER2040_INKY_SPI
+#endif
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN BADGER2040_INKY_SCK_PIN
+#endif
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN BADGER2040_INKY_MOSI_PIN
+#endif
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN BADGER2040_INKY_MISO_PIN
+#endif
+#ifndef PICO_DEFAULT_SPI_CSN_PIN
+#define PICO_DEFAULT_SPI_CSN_PIN BADGER2040_INKY_CSN_PIN
+#endif
+
+// --- FLASH ---
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/pimoroni_interstate75.h b/src/boards/include/boards/pimoroni_interstate75.h
index e2621b0..5b5bf06 100644
--- a/src/boards/include/boards/pimoroni_interstate75.h
+++ b/src/boards/include/boards/pimoroni_interstate75.h
@@ -16,117 +16,42 @@
 #define PIMORONI_INTERSTATE75
 
 // --- BOARD SPECIFIC ---
-#ifndef INTERSTATE75_R0_PIN
 #define INTERSTATE75_R0_PIN 0
-#endif
-
-#ifndef INTERSTATE75_G0_PIN
 #define INTERSTATE75_G0_PIN 1
-#endif
-
-#ifndef INTERSTATE75_B0_PIN
 #define INTERSTATE75_B0_PIN 2
-#endif
-
-#ifndef INTERSTATE75_R1_PIN
 #define INTERSTATE75_R1_PIN 3
-#endif
-
-#ifndef INTERSTATE75_G1_PIN
 #define INTERSTATE75_G1_PIN 4
-#endif
-
-#ifndef INTERSTATE75_B1_PIN
 #define INTERSTATE75_B1_PIN 5
-#endif
 
-#ifndef INTERSTATE75_ROW_A_PIN
 #define INTERSTATE75_ROW_A_PIN 6
-#endif
-
-#ifndef INTERSTATE75_ROW_B_PIN
 #define INTERSTATE75_ROW_B_PIN 7
-#endif
-
-#ifndef INTERSTATE75_ROW_C_PIN
 #define INTERSTATE75_ROW_C_PIN 8
-#endif
-
-#ifndef INTERSTATE75_ROW_D_PIN
 #define INTERSTATE75_ROW_D_PIN 9
-#endif
-
-#ifndef INTERSTATE75_ROW_E_PIN
 #define INTERSTATE75_ROW_E_PIN 10
-#endif
 
-#ifndef INTERSTATE75_CLK_PIN
 #define INTERSTATE75_CLK_PIN 11
-#endif
-
-#ifndef INTERSTATE75_LAT_PIN
 #define INTERSTATE75_LAT_PIN 12
-#endif
-
-#ifndef INTERSTATE75_OE_PIN
 #define INTERSTATE75_OE_PIN 13
-#endif
 
-#ifndef INTERSTATE75_SW_A_PIN
 #define INTERSTATE75_SW_A_PIN 14
-#endif
 
-#ifndef INTERSTATE75_LED_R_PIN
 #define INTERSTATE75_LED_R_PIN 16
-#endif
-
-#ifndef INTERSTATE75_LED_G_PIN
 #define INTERSTATE75_LED_G_PIN 17
-#endif
-
-#ifndef INTERSTATE75_LED_B_PIN
 #define INTERSTATE75_LED_B_PIN 18
-#endif
 
-#ifndef INTERSTATE75_I2C
 #define INTERSTATE75_I2C 0
-#endif
-
-#ifndef INTERSTATE75_INT_PIN
 #define INTERSTATE75_INT_PIN 19
-#endif
-
-#ifndef INTERSTATE75_SDA_PIN
 #define INTERSTATE75_SDA_PIN 20
-#endif
-
-#ifndef INTERSTATE75_SCL_PIN
 #define INTERSTATE75_SCL_PIN 21
-#endif
 
-#ifndef INTERSTATE75_USER_SW_PIN
 #define INTERSTATE75_USER_SW_PIN 23
-#endif
 
-#ifndef INTERSTATE75_A0_PIN
 #define INTERSTATE75_A0_PIN 26
-#endif
-
-#ifndef INTERSTATE75_A1_PIN
 #define INTERSTATE75_A1_PIN 27
-#endif
-
-#ifndef INTERSTATE75_A2_PIN
 #define INTERSTATE75_A2_PIN 28
-#endif
-
-#ifndef INTERSTATE75_NUM_ADC_PINS
 #define INTERSTATE75_NUM_ADC_PINS 3
-#endif
 
-#ifndef INTERSTATE75_CURRENT_SENSE_PIN
 #define INTERSTATE75_CURRENT_SENSE_PIN 29
-#endif
 
 // --- UART ---
 // no PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_keybow2040.h b/src/boards/include/boards/pimoroni_keybow2040.h
index 43772e8..baf0c40 100644
--- a/src/boards/include/boards/pimoroni_keybow2040.h
+++ b/src/boards/include/boards/pimoroni_keybow2040.h
@@ -16,89 +16,30 @@
 #define PIMORONI_KEYBOW2040
 
 // --- BOARD SPECIFIC ---
-#ifndef KEYBOW2040_I2C_SDA_PIN
 #define KEYBOW2040_I2C_SDA_PIN 4
-#endif
-
-#ifndef KEYBOW2040_I2C_SCL_PIN
 #define KEYBOW2040_I2C_SCL_PIN 5
-#endif
-
-#ifndef KEYBOW2040_I2C_INT_PIN
 #define KEYBOW2040_I2C_INT_PIN 3
-#endif
 
-#ifndef KEYBOW2040_USER_SW_PIN
 #define KEYBOW2040_USER_SW_PIN 23
-#endif
 
-#ifndef KEYBOW2040_SW0_PIN
 #define KEYBOW2040_SW0_PIN 21
-#endif
-
-#ifndef KEYBOW2040_SW1_PIN
 #define KEYBOW2040_SW1_PIN 20
-#endif
-
-#ifndef KEYBOW2040_SW2_PIN
 #define KEYBOW2040_SW2_PIN 19
-#endif
-
-#ifndef KEYBOW2040_SW3_PIN
 #define KEYBOW2040_SW3_PIN 18
-#endif
-
-#ifndef KEYBOW2040_SW4_PIN
 #define KEYBOW2040_SW4_PIN 17
-#endif
-
-#ifndef KEYBOW2040_SW5_PIN
 #define KEYBOW2040_SW5_PIN 16
-#endif
-
-#ifndef KEYBOW2040_SW6_PIN
 #define KEYBOW2040_SW6_PIN 15
-#endif
-
-#ifndef KEYBOW2040_SW7_PIN
 #define KEYBOW2040_SW7_PIN 14
-#endif
-
-#ifndef KEYBOW2040_SW8_PIN
 #define KEYBOW2040_SW8_PIN 13
-#endif
-
-#ifndef KEYBOW2040_SW9_PIN
 #define KEYBOW2040_SW9_PIN 12
-#endif
-
-#ifndef KEYBOW2040_SW10_PIN
 #define KEYBOW2040_SW10_PIN 11
-#endif
-
-#ifndef KEYBOW2040_SW11_PIN
 #define KEYBOW2040_SW11_PIN 10
-#endif
-
-#ifndef KEYBOW2040_SW12_PIN
 #define KEYBOW2040_SW12_PIN 9
-#endif
-
-#ifndef KEYBOW2040_SW13_PIN
 #define KEYBOW2040_SW13_PIN 8
-#endif
-
-#ifndef KEYBOW2040_SW14_PIN
 #define KEYBOW2040_SW14_PIN 7
-#endif
-
-#ifndef KEYBOW2040_SW15_PIN
 #define KEYBOW2040_SW15_PIN 6
-#endif
 
-#ifndef KEYBOW2040_NUM_SWITCHES_PINS
 #define KEYBOW2040_NUM_SWITCHES_PINS 16
-#endif
 
 // --- UART ---
 #ifndef PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_motor2040.h b/src/boards/include/boards/pimoroni_motor2040.h
new file mode 100644
index 0000000..00fd91a
--- /dev/null
+++ b/src/boards/include/boards/pimoroni_motor2040.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_PIMORONI_MOTOR2040_H
+#define _BOARDS_PIMORONI_MOTOR2040_H
+
+// For board detection
+#define PIMORONI_MOTOR2040
+
+#ifndef MOTOR2040_USE_DISTANCE_SENSOR
+// default to 0, if not explicitly set
+#define MOTOR2040_USE_DISTANCE_SENSOR 0
+#endif
+
+// --- BOARD SPECIFIC ---
+#define MOTOR2040_MOTOR_A_P_PIN 4
+#define MOTOR2040_MOTOR_A_N_PIN 5
+#define MOTOR2040_MOTOR_B_P_PIN 6
+#define MOTOR2040_MOTOR_B_N_PIN 7
+#define MOTOR2040_MOTOR_C_P_PIN 8
+#define MOTOR2040_MOTOR_C_N_PIN 9
+#define MOTOR2040_MOTOR_D_P_PIN 10
+#define MOTOR2040_MOTOR_D_N_PIN 11
+#define MOTOR2040_NUM_MOTORS 4
+
+#define MOTOR2040_ENCODER_A_A_PIN 0
+#define MOTOR2040_ENCODER_A_B_PIN 1
+#define MOTOR2040_ENCODER_B_A_PIN 2
+#define MOTOR2040_ENCODER_B_B_PIN 3
+#define MOTOR2040_ENCODER_C_A_PIN 12
+#define MOTOR2040_ENCODER_C_B_PIN 13
+#define MOTOR2040_ENCODER_D_A_PIN 14
+#define MOTOR2040_ENCODER_D_B_PIN 15
+#define MOTOR2040_NUM_ENCODERS 4
+
+#if MOTOR2040_USE_DISTANCE_SENSOR
+#define MOTOR2040_TRIG_PIN 16
+#define MOTOR2040_ECHO_PIN 17
+#else
+#define MOTOR2040_UART 0
+#define MOTOR2040_TX_PIN 16
+#define MOTOR2040_RX_PIN 17
+#endif
+
+#define MOTOR2040_LED_DATA_PIN 18
+#define MOTOR2040_NUM_LEDS 1
+
+#define MOTOR2040_I2C 0
+#define MOTOR2040_INT_PIN 19
+#define MOTOR2040_SDA_PIN 20
+#define MOTOR2040_SCL_PIN 21
+
+#define MOTOR2040_USER_SW_PIN 23
+
+#define MOTOR2040_A0_PIN 26
+#define MOTOR2040_A1_PIN 27
+#define MOTOR2040_A2_PIN 28
+#define MOTOR2040_NUM_ADC_PINS 3
+
+#define MOTOR2040_SHARED_ADC_PIN 29
+#define MOTOR2040_ADC_ADDR_0_PIN 22
+#define MOTOR2040_ADC_ADDR_1_PIN 24
+#define MOTOR2040_ADC_ADDR_2_PIN 25
+
+#define MOTOR2040_CURRENT_SENSE_A_ADDR 0b000
+#define MOTOR2040_CURRENT_SENSE_B_ADDR 0b001
+#define MOTOR2040_CURRENT_SENSE_C_ADDR 0b010
+#define MOTOR2040_CURRENT_SENSE_D_ADDR 0b011
+#define MOTOR2040_VOLTAGE_SENSE_ADDR 0b100
+#define MOTOR2040_FAULT_SENSE_ADDR 0b101
+#define MOTOR2040_SENSOR_1_ADDR 0b110
+#define MOTOR2040_SENSOR_2_ADDR 0b111
+#define MOTOR2040_NUM_SENSORS 2
+
+// --- UART ---
+#if MOTOR2040_USE_DISTANCE_SENSOR
+// no PICO_DEFAULT_UART
+#else
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART MOTOR2040_UART
+#endif
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN MOTOR2040_TX_PIN
+#endif
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN MOTOR2040_RX_PIN
+#endif
+#endif
+
+// --- LED ---
+// no PICO_DEFAULT_LED_PIN
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN MOTOR2040_LED_DATA_PIN
+#endif
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C MOTOR2040_I2C
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN MOTOR2040_SDA_PIN
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN MOTOR2040_SCL_PIN
+#endif
+
+// --- SPI ---
+// no PICO_DEFAULT_SPI
+// no PICO_DEFAULT_SPI_SCK_PIN
+// no PICO_DEFAULT_SPI_TX_PIN
+// no PICO_DEFAULT_SPI_RX_PIN
+// no PICO_DEFAULT_SPI_CSN_PIN
+
+// --- FLASH ---
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/pimoroni_picolipo_16mb.h b/src/boards/include/boards/pimoroni_picolipo_16mb.h
index 338977b..dfad767 100644
--- a/src/boards/include/boards/pimoroni_picolipo_16mb.h
+++ b/src/boards/include/boards/pimoroni_picolipo_16mb.h
@@ -16,17 +16,9 @@
 #define PIMORONI_PICOLIPO_16MB
 
 // --- BOARD SPECIFIC ---
-#ifndef PICOLIPO_USER_SW_PIN
 #define PICOLIPO_USER_SW_PIN 23
-#endif
-
-#ifndef PICOLIPO_VBUS_DETECT_PIN
 #define PICOLIPO_VBUS_DETECT_PIN 24
-#endif
-
-#ifndef PICOLIPO_BAT_SENSE_PIN
 #define PICOLIPO_BAT_SENSE_PIN 29
-#endif
 
 // --- UART ---
 #ifndef PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_picolipo_4mb.h b/src/boards/include/boards/pimoroni_picolipo_4mb.h
index 871ed83..aea767d 100644
--- a/src/boards/include/boards/pimoroni_picolipo_4mb.h
+++ b/src/boards/include/boards/pimoroni_picolipo_4mb.h
@@ -16,17 +16,9 @@
 #define PIMORONI_PICOLIPO_4MB
 
 // --- BOARD SPECIFIC ---
-#ifndef PICOLIPO_USER_SW_PIN
 #define PICOLIPO_USER_SW_PIN 23
-#endif
-
-#ifndef PICOLIPO_VBUS_DETECT_PIN
 #define PICOLIPO_VBUS_DETECT_PIN 24
-#endif
-
-#ifndef PICOLIPO_BAT_SENSE_PIN
 #define PICOLIPO_BAT_SENSE_PIN 29
-#endif
 
 // --- UART ---
 #ifndef PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_picosystem.h b/src/boards/include/boards/pimoroni_picosystem.h
index 1e7c80e..0717b05 100644
--- a/src/boards/include/boards/pimoroni_picosystem.h
+++ b/src/boards/include/boards/pimoroni_picosystem.h
@@ -16,97 +16,35 @@
 #define PIMORONI_PICOSYSTEM
 
 // --- BOARD SPECIFIC ---
-#ifndef PICOSYSTEM_VBUS_DETECT_PIN
 #define PICOSYSTEM_VBUS_DETECT_PIN 2
-#endif
 
-#ifndef PICOSYSTEM_LCD_SPI
 #define PICOSYSTEM_LCD_SPI 0
-#endif
-
-#ifndef PICOSYSTEM_LCD_RESET_PIN
 #define PICOSYSTEM_LCD_RESET_PIN 4
-#endif
-
-#ifndef PICOSYSTEM_LCD_CSN_PIN
 #define PICOSYSTEM_LCD_CSN_PIN 5
-#endif
-
-#ifndef PICOSYSTEM_LCD_SCLK_PIN
 #define PICOSYSTEM_LCD_SCLK_PIN 6
-#endif
-
-#ifndef PICOSYSTEM_LCD_MOSI_PIN
 #define PICOSYSTEM_LCD_MOSI_PIN 7
-#endif
-
-#ifndef PICOSYSTEM_LCD_VSYNC_PIN
 #define PICOSYSTEM_LCD_VSYNC_PIN 8
-#endif
-
-#ifndef PICOSYSTEM_LCD_DC_PIN
 #define PICOSYSTEM_LCD_DC_PIN 9
-#endif
 
-#ifndef PICOSYSTEM_AUDIO_PIN
 #define PICOSYSTEM_AUDIO_PIN 11
-#endif
 
-#ifndef PICOSYSTEM_BACKLIGHT_PIN
 #define PICOSYSTEM_BACKLIGHT_PIN 12
-#endif
 
-#ifndef PICOSYSTEM_LED_G_PIN
 #define PICOSYSTEM_LED_G_PIN 13
-#endif
-
-#ifndef PICOSYSTEM_LED_R_PIN
 #define PICOSYSTEM_LED_R_PIN 14
-#endif
-
-#ifndef PICOSYSTEM_LED_B_PIN
 #define PICOSYSTEM_LED_B_PIN 15
-#endif
 
-#ifndef PICOSYSTEM_SW_Y_PIN
 #define PICOSYSTEM_SW_Y_PIN 16
-#endif
-
-#ifndef PICOSYSTEM_SW_X_PIN
 #define PICOSYSTEM_SW_X_PIN 17
-#endif
-
-#ifndef PICOSYSTEM_SW_A_PIN
 #define PICOSYSTEM_SW_A_PIN 18
-#endif
-
-#ifndef PICOSYSTEM_SW_B_PIN
 #define PICOSYSTEM_SW_B_PIN 19
-#endif
-
-#ifndef PICOSYSTEM_SW_DOWN_PIN
 #define PICOSYSTEM_SW_DOWN_PIN 20
-#endif
-
-#ifndef PICOSYSTEM_SW_RIGHT_PIN
 #define PICOSYSTEM_SW_RIGHT_PIN 21
-#endif
-
-#ifndef PICOSYSTEM_SW_LEFT_PIN
 #define PICOSYSTEM_SW_LEFT_PIN 22
-#endif
-
-#ifndef PICOSYSTEM_SW_UP_PIN
 #define PICOSYSTEM_SW_UP_PIN 23
-#endif
 
-#ifndef PICOSYSTEM_CHARGE_STAT_PIN
 #define PICOSYSTEM_CHARGE_STAT_PIN 24
-#endif
-
-#ifndef PICOSYSTEM_BAT_SENSE_PIN
 #define PICOSYSTEM_BAT_SENSE_PIN 26
-#endif
 
 // --- UART ---
 #ifndef PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_plasma2040.h b/src/boards/include/boards/pimoroni_plasma2040.h
index 226aaf5..2cdb4c5 100644
--- a/src/boards/include/boards/pimoroni_plasma2040.h
+++ b/src/boards/include/boards/pimoroni_plasma2040.h
@@ -16,73 +16,29 @@
 #define PIMORONI_PLASMA2040
 
 // --- BOARD SPECIFIC ---
-#ifndef PLASMA2040_SW_A_PIN
 #define PLASMA2040_SW_A_PIN 12
-#endif
-
-#ifndef PLASMA2040_SW_B_PIN
 #define PLASMA2040_SW_B_PIN 13
-#endif
 
-#ifndef PLASMA2040_CLK_PIN
 #define PLASMA2040_CLK_PIN 14
-#endif
-
-#ifndef PLASMA2040_DATA_PIN
 #define PLASMA2040_DATA_PIN 15
-#endif
 
-#ifndef PLASMA2040_LED_R_PIN
 #define PLASMA2040_LED_R_PIN 16
-#endif
-
-#ifndef PLASMA2040_LED_G_PIN
 #define PLASMA2040_LED_G_PIN 17
-#endif
-
-#ifndef PLASMA2040_LED_B_PIN
 #define PLASMA2040_LED_B_PIN 18
-#endif
 
-#ifndef PLASMA2040_I2C
 #define PLASMA2040_I2C 0
-#endif
-
-#ifndef PLASMA2040_INT_PIN
 #define PLASMA2040_INT_PIN 19
-#endif
-
-#ifndef PLASMA2040_SDA_PIN
 #define PLASMA2040_SDA_PIN 20
-#endif
-
-#ifndef PLASMA2040_SCL_PIN
 #define PLASMA2040_SCL_PIN 21
-#endif
 
-#ifndef PLASMA2040_USER_SW_PIN
 #define PLASMA2040_USER_SW_PIN 23
-#endif
 
-#ifndef PLASMA2040_A0_PIN
 #define PLASMA2040_A0_PIN 26
-#endif
-
-#ifndef PLASMA2040_A1_PIN
 #define PLASMA2040_A1_PIN 27
-#endif
-
-#ifndef PLASMA2040_A2_PIN
 #define PLASMA2040_A2_PIN 28
-#endif
-
-#ifndef PLASMA2040_NUM_ADC_PINS
 #define PLASMA2040_NUM_ADC_PINS 3
-#endif
 
-#ifndef PLASMA2040_CURRENT_SENSE_PIN
 #define PLASMA2040_CURRENT_SENSE_PIN 29
-#endif
 
 // --- UART ---
 // no PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_servo2040.h b/src/boards/include/boards/pimoroni_servo2040.h
new file mode 100644
index 0000000..17fd76f
--- /dev/null
+++ b/src/boards/include/boards/pimoroni_servo2040.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_PIMORONI_SERVO2040_H
+#define _BOARDS_PIMORONI_SERVO2040_H
+
+// For board detection
+#define PIMORONI_SERVO2040
+
+// --- BOARD SPECIFIC ---
+#define SERVO2040_SERVO_1_PIN 0
+#define SERVO2040_SERVO_2_PIN 1
+#define SERVO2040_SERVO_3_PIN 2
+#define SERVO2040_SERVO_4_PIN 3
+#define SERVO2040_SERVO_5_PIN 4
+#define SERVO2040_SERVO_6_PIN 5
+#define SERVO2040_SERVO_7_PIN 6
+#define SERVO2040_SERVO_8_PIN 7
+#define SERVO2040_SERVO_9_PIN 8
+#define SERVO2040_SERVO_10_PIN 9
+#define SERVO2040_SERVO_11_PIN 10
+#define SERVO2040_SERVO_12_PIN 11
+#define SERVO2040_SERVO_13_PIN 12
+#define SERVO2040_SERVO_14_PIN 13
+#define SERVO2040_SERVO_15_PIN 14
+#define SERVO2040_SERVO_16_PIN 15
+#define SERVO2040_SERVO_17_PIN 16
+#define SERVO2040_SERVO_18_PIN 17
+#define SERVO2040_NUM_SERVOS 18
+
+#define SERVO2040_LED_DATA_PIN 18
+#define SERVO2040_NUM_LEDS 6
+
+#define SERVO2040_I2C 0
+#define SERVO2040_INT_PIN 19
+#define SERVO2040_SDA_PIN 20
+#define SERVO2040_SCL_PIN 21
+
+#define SERVO2040_USER_SW_PIN 23
+
+#define SERVO2040_A0_PIN 26
+#define SERVO2040_A1_PIN 27
+#define SERVO2040_A2_PIN 28
+#define SERVO2040_NUM_ADC_PINS 3
+
+#define SERVO2040_SHARED_ADC_PIN 29
+#define SERVO2040_ADC_ADDR_0_PIN 22
+#define SERVO2040_ADC_ADDR_1_PIN 24
+#define SERVO2040_ADC_ADDR_2_PIN 25
+
+#define SERVO2040_SENSOR_1_ADDR 0b000
+#define SERVO2040_SENSOR_2_ADDR 0b001
+#define SERVO2040_SENSOR_3_ADDR 0b010
+#define SERVO2040_SENSOR_4_ADDR 0b011
+#define SERVO2040_SENSOR_5_ADDR 0b100
+#define SERVO2040_SENSOR_6_ADDR 0b101
+#define SERVO2040_VOLTAGE_SENSE_ADDR 0b110
+#define SERVO2040_CURRENT_SENSE_ADDR 0b111
+#define SERVO2040_NUM_SENSORS 6
+
+// --- UART ---
+// no PICO_DEFAULT_UART
+// no PICO_DEFAULT_UART_TX_PIN
+// no PICO_DEFAULT_UART_RX_PIN
+
+// --- LED ---
+// no PICO_DEFAULT_LED_PIN
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN SERVO2040_LED_DATA_PIN
+#endif
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C SERVO2040_I2C
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN SERVO2040_SDA_PIN
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN SERVO2040_SCL_PIN
+#endif
+
+// --- SPI ---
+// no PICO_DEFAULT_SPI
+// no PICO_DEFAULT_SPI_SCK_PIN
+// no PICO_DEFAULT_SPI_TX_PIN
+// no PICO_DEFAULT_SPI_RX_PIN
+// no PICO_DEFAULT_SPI_CSN_PIN
+
+// --- FLASH ---
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/pimoroni_tiny2040.h b/src/boards/include/boards/pimoroni_tiny2040.h
index 51d17f6..f407008 100644
--- a/src/boards/include/boards/pimoroni_tiny2040.h
+++ b/src/boards/include/boards/pimoroni_tiny2040.h
@@ -14,47 +14,22 @@
 
 // For board detection
 #define PIMORONI_TINY2040
+#define PIMORONI_TINY2040_8MB
 
 // --- BOARD SPECIFIC ---
-#ifndef TINY2040_LED_R_PIN
 #define TINY2040_LED_R_PIN 18
-#endif
-
-#ifndef TINY2040_LED_G_PIN
 #define TINY2040_LED_G_PIN 19
-#endif
-
-#ifndef TINY2040_LED_B_PIN
 #define TINY2040_LED_B_PIN 20
-#endif
 
-#ifndef TINY2040_USER_SW_PIN
 #define TINY2040_USER_SW_PIN 23
-#endif
 
-#ifndef TINY2040_A0_PIN
 #define TINY2040_A0_PIN 26
-#endif
-
-#ifndef TINY2040_A1_PIN
 #define TINY2040_A1_PIN 27
-#endif
-
-#ifndef TINY2040_A2_PIN
 #define TINY2040_A2_PIN 28
-#endif
-
-#ifndef TINY2040_A3_PIN
 #define TINY2040_A3_PIN 29
-#endif
 
-#ifndef TINY2040_NUM_IO_PINS
 #define TINY2040_NUM_IO_PINS 8
-#endif
-
-#ifndef TINY2040_NUM_ADC_PINS
 #define TINY2040_NUM_ADC_PINS 4
-#endif
 
 // --- UART ---
 #ifndef PICO_DEFAULT_UART
diff --git a/src/boards/include/boards/pimoroni_tiny2040_2mb.h b/src/boards/include/boards/pimoroni_tiny2040_2mb.h
new file mode 100644
index 0000000..e32d370
--- /dev/null
+++ b/src/boards/include/boards/pimoroni_tiny2040_2mb.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_PIMORONI_TINY2040_2MB_H
+#define _BOARDS_PIMORONI_TINY2040_2MB_H
+
+// For board detection
+#define PIMORONI_TINY2040
+#define PIMORONI_TINY2040_2MB
+
+// --- BOARD SPECIFIC ---
+#define TINY2040_LED_R_PIN 18
+#define TINY2040_LED_G_PIN 19
+#define TINY2040_LED_B_PIN 20
+
+#define TINY2040_USER_SW_PIN 23
+
+#define TINY2040_A0_PIN 26
+#define TINY2040_A1_PIN 27
+#define TINY2040_A2_PIN 28
+#define TINY2040_A3_PIN 29
+
+#define TINY2040_NUM_IO_PINS 8
+#define TINY2040_NUM_ADC_PINS 4
+
+// --- UART ---
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 0
+#endif
+
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 1
+#endif
+
+// --- LED ---
+// Included so basic examples will work, and set it to the green LED
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN TINY2040_LED_G_PIN
+#endif
+// no PICO_DEFAULT_WS2812_PIN
+
+#ifndef PICO_DEFAULT_LED_PIN_INVERTED
+#define PICO_DEFAULT_LED_PIN_INVERTED 1
+#endif
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C 1
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN 2
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN 3
+#endif
+
+// --- SPI ---
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 0
+#endif
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 6
+#endif
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 7
+#endif
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 4
+#endif
+#ifndef PICO_DEFAULT_SPI_CSN_PIN
+#define PICO_DEFAULT_SPI_CSN_PIN 5
+#endif
+
+// --- FLASH ---
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/seeed_xiao_rp2040.h b/src/boards/include/boards/seeed_xiao_rp2040.h
new file mode 100644
index 0000000..2fd3687
--- /dev/null
+++ b/src/boards/include/boards/seeed_xiao_rp2040.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+#ifndef _BOARDS_SEEED_XIAO_RP2040_H
+#define _BOARDS_SEEED_XIAO_RP2040_H
+
+// For board detection
+#define SEEED_XIAO_RP2040
+
+// On some samples, the xosc can take longer to stabilize than is usual
+#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
+#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
+#endif
+
+//------------- UART -------------//
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 0
+#endif
+
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 1
+#endif
+
+//------------- LED -------------//
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN 25
+#endif
+
+#ifndef PICO_DEFAULT_LED_PIN_INVERTED
+#define PICO_DEFAULT_LED_PIN_INVERTED 1
+#endif
+
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN 12
+#endif
+
+#ifndef PICO_DEFAULT_WS2812_POWER_PIN
+#define PICO_DEFAULT_WS2812_POWER_PIN 11
+#endif
+
+//------------- I2C -------------//
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C 1
+#endif
+
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN 6
+#endif
+
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN 7
+#endif
+
+//------------- SPI -------------//
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 0
+#endif
+
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 3
+#endif
+
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 4
+#endif
+
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 2
+#endif
+
+//------------- FLASH -------------//
+
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// All boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/solderparty_rp2040_stamp.h b/src/boards/include/boards/solderparty_rp2040_stamp.h
new file mode 100644
index 0000000..fb3c5b9
--- /dev/null
+++ b/src/boards/include/boards/solderparty_rp2040_stamp.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+//
+//------------------------------------------------------------------------------------------
+// Board definition for the Solder Party RP2040 Stamp
+//
+// This header may be included by other board headers as "boards/solderparty_rp2040_stamp.h"
+
+#ifndef _BOARDS_SOLDERPARTY_RP2040_STAMP_H
+#define _BOARDS_SOLDERPARTY_RP2040_STAMP_H
+
+// For board detection
+#define SOLDERPARTY_RP2040_STAMP
+
+// --- UART ---
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 0
+#endif
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 1
+#endif
+
+// --- Neopixel ---
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN 21
+#endif
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C       0
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN   4
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN   5
+#endif
+
+// --- SPI ---
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 0
+#endif
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 18
+#endif
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 19
+#endif
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 16
+#endif
+#ifndef PICO_DEFAULT_SPI_CSN_PIN
+#define PICO_DEFAULT_SPI_CSN_PIN 17
+#endif
+
+// --- FLASH ---
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
+#endif
+
+// All production boards have B1 RP2040
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/include/boards/solderparty_rp2040_stamp_carrier.h b/src/boards/include/boards/solderparty_rp2040_stamp_carrier.h
new file mode 100644
index 0000000..aac45f4
--- /dev/null
+++ b/src/boards/include/boards/solderparty_rp2040_stamp_carrier.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+//
+//------------------------------------------------------------------------------------------
+// Board definition for the Solder Party RP2040 Stamp Carrier
+//
+// This header may be included by other board headers as "boards/solderparty_rp2040_stamp_carrier.h"
+
+#ifndef _BOARDS_SOLDERPARTY_RP2040_STAMP_CARRIER_H
+#define _BOARDS_SOLDERPARTY_RP2040_STAMP_CARRIER_H
+
+// For board detection
+#define SOLDERPARTY_RP2040_STAMP_CARRIER
+
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN   20
+#endif
+
+#include "solderparty_rp2040_stamp.h"
+
+#endif
diff --git a/src/boards/include/boards/solderparty_rp2040_stamp_round_carrier.h b/src/boards/include/boards/solderparty_rp2040_stamp_round_carrier.h
new file mode 100644
index 0000000..bb9d335
--- /dev/null
+++ b/src/boards/include/boards/solderparty_rp2040_stamp_round_carrier.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+//
+//------------------------------------------------------------------------------------------
+// Board definition for the Solder Party RP2040 Stamp Round Carrier
+//
+// This header may be included by other board headers as "boards/solderparty_rp2040_stamp_round_carrier.h"
+
+#ifndef _BOARDS_SOLDERPARTY_RP2040_STAMP_ROUND_CARRIER_H
+#define _BOARDS_SOLDERPARTY_RP2040_STAMP_ROUND_CARRIER_H
+
+// For board detection
+#define SOLDERPARTY_RP2040_STAMP_ROUND_CARRIER
+
+// --- User LED ---
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN   25
+#endif
+
+// --- UART ---
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 16
+#endif
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 17
+#endif
+
+// --- Neopixel Ring ---
+#ifndef PICO_DEFAULT_WS2812_PIN
+#define PICO_DEFAULT_WS2812_PIN 24
+#endif
+
+// --- On-Stamp Neopixel ---
+#ifndef SOLDERPARTY_RP2040_STAMP_WS2812_PIN
+#define SOLDERPARTY_RP2040_STAMP_WS2812_PIN 21
+#endif
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C       0
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN   0
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN   1
+#endif
+
+// --- SPI ---
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 1
+#endif
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 10
+#endif
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 11
+#endif
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 8
+#endif
+#ifndef PICO_DEFAULT_SPI_CSN_PIN
+#define PICO_DEFAULT_SPI_CSN_PIN 9
+#endif
+
+#include "solderparty_rp2040_stamp.h"
+
+#endif
diff --git a/src/boards/include/boards/vgaboard.h b/src/boards/include/boards/vgaboard.h
index f0b6f0e..dd4bf6c 100644
--- a/src/boards/include/boards/vgaboard.h
+++ b/src/boards/include/boards/vgaboard.h
@@ -53,12 +53,25 @@
 #define PICO_DEFAULT_UART_RX_PIN 21
 #endif
 
+#ifndef PICO_SCANVIDEO_COLOR_PIN_BASE
 #define PICO_SCANVIDEO_COLOR_PIN_BASE VGABOARD_VGA_COLOR_PIN_BASE
-#define PICO_SCANVIDEO_SYNC_PIN_BASE VGABOARD_VGA_SYNC_PIN_BASE
+#endif
 
+#ifndef PICO_SCANVIDEO_SYNC_PIN_BASE
+#define PICO_SCANVIDEO_SYNC_PIN_BASE VGABOARD_VGA_SYNC_PIN_BASE
+#endif
+
+#ifndef PICO_SD_CLK_PIN
 #define PICO_SD_CLK_PIN VGABOARD_SD_CLK_PIN
+#endif
+
+#ifndef PICO_SD_CMD_PIN
 #define PICO_SD_CMD_PIN VGABOARD_SD_CMD_PIN
+#endif
+
+#ifndef PICO_SD_DAT0_PIN
 #define PICO_SD_DAT0_PIN VGABOARD_SD_DAT0_PIN
+#endif
 
 // 1 or 4
 #ifndef PICO_SD_DAT_PIN_COUNT
@@ -66,13 +79,24 @@
 #endif
 
 // 1 or -1
+#ifndef PICO_SD_DAT_PIN_INCREMENT
 #define PICO_SD_DAT_PIN_INCREMENT 1
+#endif
 
+#ifndef PICO_AUDIO_I2S_DATA_PIN
 #define PICO_AUDIO_I2S_DATA_PIN VGABOARD_I2S_DIN_PIN
+#endif
+#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
 #define PICO_AUDIO_I2S_CLOCK_PIN_BASE VGABOARD_I2S_BCK_PIN
+#endif
 
+#ifndef PICO_AUDIO_PWM_L_PIN
 #define PICO_AUDIO_PWM_L_PIN VGABOARD_PWM_L_PIN
+#endif
+
+#ifndef PICO_AUDIO_PWM_R_PIN
 #define PICO_AUDIO_PWM_R_PIN VGABOARD_PWM_R_PIN
+#endif
 
 #define PICO_VGA_BOARD
 
diff --git a/src/boards/include/boards/wiznet_w5100s_evb_pico.h b/src/boards/include/boards/wiznet_w5100s_evb_pico.h
new file mode 100644
index 0000000..585f1d1
--- /dev/null
+++ b/src/boards/include/boards/wiznet_w5100s_evb_pico.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+// -----------------------------------------------------
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
+//       SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
+// -----------------------------------------------------
+
+
+
+#ifndef _BOARDS_WIZNET_W5100S_EVB_PICO_H
+#define _BOARDS_WIZNET_W5100S_EVB_PICO_H
+
+// For board detection
+#define WIZNET_W5100S_EVB_PICO
+
+// --- BOARD SPECIFIC ---
+#ifndef W5100S_EVB_PICO_INTN_PIN
+#define W5100S_EVB_PICO_INTN_PIN 21
+#endif
+
+#ifndef W5100S_EVB_PICO_RSTN_PIN
+#define W5100S_EVB_PICO_RSTN_PIN 20
+#endif
+
+#ifndef W5100S_EVB_PICO_A0_PIN
+#define W5100S_EVB_PICO_A0_PIN 26
+#endif
+#ifndef W5100S_EVB_PICO_A1_PIN
+#define W5100S_EVB_PICO_A1_PIN 27
+#endif
+#ifndef W5100S_EVB_PICO_A2_PIN
+#define W5100S_EVB_PICO_A2_PIN 28
+#endif
+
+// --- LED ---
+#ifndef PICO_DEFAULT_LED_PIN
+#define PICO_DEFAULT_LED_PIN 25
+#endif
+
+// --- UART ---
+#ifndef PICO_DEFAULT_UART
+#define PICO_DEFAULT_UART 0
+#endif
+#ifndef PICO_DEFAULT_UART_TX_PIN
+#define PICO_DEFAULT_UART_TX_PIN 0
+#endif
+#ifndef PICO_DEFAULT_UART_RX_PIN
+#define PICO_DEFAULT_UART_RX_PIN 1
+#endif
+
+
+// --- I2C ---
+#ifndef PICO_DEFAULT_I2C
+#define PICO_DEFAULT_I2C 0
+#endif
+#ifndef PICO_DEFAULT_I2C_SDA_PIN
+#define PICO_DEFAULT_I2C_SDA_PIN 4
+#endif
+#ifndef PICO_DEFAULT_I2C_SCL_PIN
+#define PICO_DEFAULT_I2C_SCL_PIN 5
+#endif
+
+// --- SPI ---
+#ifndef PICO_DEFAULT_SPI
+#define PICO_DEFAULT_SPI 0
+#endif
+#ifndef PICO_DEFAULT_SPI_SCK_PIN
+#define PICO_DEFAULT_SPI_SCK_PIN 18
+#endif
+#ifndef PICO_DEFAULT_SPI_TX_PIN
+#define PICO_DEFAULT_SPI_TX_PIN 19
+#endif
+#ifndef PICO_DEFAULT_SPI_RX_PIN
+#define PICO_DEFAULT_SPI_RX_PIN 16
+#endif
+#ifndef PICO_DEFAULT_SPI_CSN_PIN
+#define PICO_DEFAULT_SPI_CSN_PIN 17
+#endif
+
+// --- FLASH ---
+
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
+
+#ifndef PICO_FLASH_SPI_CLKDIV
+#define PICO_FLASH_SPI_CLKDIV 2
+#endif
+
+#ifndef PICO_FLASH_SIZE_BYTES
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
+#endif
+
+// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
+#define PICO_SMPS_MODE_PIN 23
+
+#ifndef PICO_RP2040_B0_SUPPORTED
+#define PICO_RP2040_B0_SUPPORTED 0
+#endif
+
+#endif
diff --git a/src/boards/pico_w.cmake b/src/boards/pico_w.cmake
new file mode 100644
index 0000000..15b901d
--- /dev/null
+++ b/src/boards/pico_w.cmake
@@ -0,0 +1,2 @@
+set(PICO_CYW43_SUPPORTED "1" CACHE INTERNAL "Try to add support for PICO_CYW43")
+include(${CMAKE_CURRENT_LIST_DIR}/generic_board.cmake)