From 1a58688cb04920e9f2b9919132a8a94bce30e87d Mon Sep 17 00:00:00 2001 From: Dryw Wade Date: Thu, 20 Feb 2025 14:41:17 -0700 Subject: [PATCH] Add SparkFun XRP Controller (Beta) --- boards.txt | 239 ++++++++++++++++++ package/package_pico_index.template.json | 3 + tools/json/sparkfun_xrp_controller_beta.json | 55 ++++ tools/makeboards.py | 1 + .../sparkfun_xrp_controller_beta/digital.cpp | 33 +++ .../sparkfun_xrp_controller_beta/init.cpp | 25 ++ .../pins_arduino.h | 103 ++++++++ 7 files changed, 459 insertions(+) create mode 100644 tools/json/sparkfun_xrp_controller_beta.json create mode 100644 variants/sparkfun_xrp_controller_beta/digital.cpp create mode 100644 variants/sparkfun_xrp_controller_beta/init.cpp create mode 100644 variants/sparkfun_xrp_controller_beta/pins_arduino.h diff --git a/boards.txt b/boards.txt index 5213c7482..5f8a4c490 100644 --- a/boards.txt +++ b/boards.txt @@ -28334,6 +28334,245 @@ sparkfun_iotnode_lorawanrp2350.menu.uploadmethod.picoprobe_cmsis_dap.upload.maxi sparkfun_iotnode_lorawanrp2350.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool=picoprobe_cmsis_dap sparkfun_iotnode_lorawanrp2350.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool.default=picoprobe_cmsis_dap +# ----------------------------------- +# SparkFun XRP Controller (Beta) +# ----------------------------------- +sparkfun_xrp_controller_beta.name=SparkFun XRP Controller (Beta) +sparkfun_xrp_controller_beta.vid.0=0x1b4f +sparkfun_xrp_controller_beta.pid.0=0x0045 +sparkfun_xrp_controller_beta.vid.1=0x1b4f +sparkfun_xrp_controller_beta.pid.1=0x0145 +sparkfun_xrp_controller_beta.vid.2=0x1b4f +sparkfun_xrp_controller_beta.pid.2=0x4045 +sparkfun_xrp_controller_beta.vid.3=0x1b4f +sparkfun_xrp_controller_beta.pid.3=0x4145 +sparkfun_xrp_controller_beta.vid.4=0x1b4f +sparkfun_xrp_controller_beta.pid.4=0x8045 +sparkfun_xrp_controller_beta.vid.5=0x1b4f +sparkfun_xrp_controller_beta.pid.5=0x8145 +sparkfun_xrp_controller_beta.vid.6=0x1b4f +sparkfun_xrp_controller_beta.pid.6=0xc045 +sparkfun_xrp_controller_beta.vid.7=0x1b4f +sparkfun_xrp_controller_beta.pid.7=0xc145 +sparkfun_xrp_controller_beta.upload_port.0.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.0.pid=0x0045 +sparkfun_xrp_controller_beta.upload_port.1.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.1.pid=0x0145 +sparkfun_xrp_controller_beta.upload_port.2.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.2.pid=0x4045 +sparkfun_xrp_controller_beta.upload_port.3.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.3.pid=0x4145 +sparkfun_xrp_controller_beta.upload_port.4.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.4.pid=0x8045 +sparkfun_xrp_controller_beta.upload_port.5.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.5.pid=0x8145 +sparkfun_xrp_controller_beta.upload_port.6.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.6.pid=0xc045 +sparkfun_xrp_controller_beta.upload_port.7.vid=0x1b4f +sparkfun_xrp_controller_beta.upload_port.7.pid=0xc145 +sparkfun_xrp_controller_beta.build.usbvid=-DUSBD_VID=0x1b4f +sparkfun_xrp_controller_beta.build.usbpid=-DUSBD_PID=0x0045 +sparkfun_xrp_controller_beta.build.usbpwr=-DUSBD_MAX_POWER_MA=250 +sparkfun_xrp_controller_beta.build.board=SPARKFUN_XRP_CONTROLLER_BETA +sparkfun_xrp_controller_beta.build.mcu=cortex-m0plus +sparkfun_xrp_controller_beta.build.chip=rp2040 +sparkfun_xrp_controller_beta.build.toolchain=arm-none-eabi +sparkfun_xrp_controller_beta.build.toolchainpkg=pqt-gcc +sparkfun_xrp_controller_beta.build.toolchainopts=-march=armv6-m -mcpu=cortex-m0plus -mthumb +sparkfun_xrp_controller_beta.build.uf2family=--family rp2040 +sparkfun_xrp_controller_beta.build.variant=sparkfun_xrp_controller_beta +sparkfun_xrp_controller_beta.upload.maximum_size=2097152 +sparkfun_xrp_controller_beta.upload.wait_for_upload_port=true +sparkfun_xrp_controller_beta.upload.erase_cmd= +sparkfun_xrp_controller_beta.serial.disableDTR=false +sparkfun_xrp_controller_beta.serial.disableRTS=false +sparkfun_xrp_controller_beta.build.f_cpu=125000000 +sparkfun_xrp_controller_beta.build.led= +sparkfun_xrp_controller_beta.build.core=rp2040 +sparkfun_xrp_controller_beta.build.ldscript=memmap_default.ld +sparkfun_xrp_controller_beta.build.boot2=boot2_w25q080_2_padded_checksum +sparkfun_xrp_controller_beta.build.usb_manufacturer="SparkFun" +sparkfun_xrp_controller_beta.build.usb_product="XRP Controller (Beta)" +sparkfun_xrp_controller_beta.build.extra_flags=-DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1 +sparkfun_xrp_controller_beta.menu.flash.2097152_0=2MB (no FS) +sparkfun_xrp_controller_beta.menu.flash.2097152_0.upload.maximum_size=2093056 +sparkfun_xrp_controller_beta.menu.flash.2097152_0.build.flash_total=2097152 +sparkfun_xrp_controller_beta.menu.flash.2097152_0.build.flash_length=2093056 +sparkfun_xrp_controller_beta.menu.flash.2097152_0.build.eeprom_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_0.build.fs_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_0.build.fs_end=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_65536=2MB (Sketch: 1984KB, FS: 64KB) +sparkfun_xrp_controller_beta.menu.flash.2097152_65536.upload.maximum_size=2027520 +sparkfun_xrp_controller_beta.menu.flash.2097152_65536.build.flash_total=2097152 +sparkfun_xrp_controller_beta.menu.flash.2097152_65536.build.flash_length=2027520 +sparkfun_xrp_controller_beta.menu.flash.2097152_65536.build.eeprom_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_65536.build.fs_start=270462976 +sparkfun_xrp_controller_beta.menu.flash.2097152_65536.build.fs_end=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_131072=2MB (Sketch: 1920KB, FS: 128KB) +sparkfun_xrp_controller_beta.menu.flash.2097152_131072.upload.maximum_size=1961984 +sparkfun_xrp_controller_beta.menu.flash.2097152_131072.build.flash_total=2097152 +sparkfun_xrp_controller_beta.menu.flash.2097152_131072.build.flash_length=1961984 +sparkfun_xrp_controller_beta.menu.flash.2097152_131072.build.eeprom_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_131072.build.fs_start=270397440 +sparkfun_xrp_controller_beta.menu.flash.2097152_131072.build.fs_end=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_262144=2MB (Sketch: 1792KB, FS: 256KB) +sparkfun_xrp_controller_beta.menu.flash.2097152_262144.upload.maximum_size=1830912 +sparkfun_xrp_controller_beta.menu.flash.2097152_262144.build.flash_total=2097152 +sparkfun_xrp_controller_beta.menu.flash.2097152_262144.build.flash_length=1830912 +sparkfun_xrp_controller_beta.menu.flash.2097152_262144.build.eeprom_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_262144.build.fs_start=270266368 +sparkfun_xrp_controller_beta.menu.flash.2097152_262144.build.fs_end=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_524288=2MB (Sketch: 1536KB, FS: 512KB) +sparkfun_xrp_controller_beta.menu.flash.2097152_524288.upload.maximum_size=1568768 +sparkfun_xrp_controller_beta.menu.flash.2097152_524288.build.flash_total=2097152 +sparkfun_xrp_controller_beta.menu.flash.2097152_524288.build.flash_length=1568768 +sparkfun_xrp_controller_beta.menu.flash.2097152_524288.build.eeprom_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_524288.build.fs_start=270004224 +sparkfun_xrp_controller_beta.menu.flash.2097152_524288.build.fs_end=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576=2MB (Sketch: 1MB, FS: 1MB) +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576.upload.maximum_size=1044480 +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576.build.flash_total=2097152 +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576.build.flash_length=1044480 +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576.build.eeprom_start=270528512 +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576.build.fs_start=269479936 +sparkfun_xrp_controller_beta.menu.flash.2097152_1048576.build.fs_end=270528512 +sparkfun_xrp_controller_beta.menu.freq.133=133 MHz +sparkfun_xrp_controller_beta.menu.freq.133.build.f_cpu=133000000L +sparkfun_xrp_controller_beta.menu.freq.50=50 MHz +sparkfun_xrp_controller_beta.menu.freq.50.build.f_cpu=50000000L +sparkfun_xrp_controller_beta.menu.freq.100=100 MHz +sparkfun_xrp_controller_beta.menu.freq.100.build.f_cpu=100000000L +sparkfun_xrp_controller_beta.menu.freq.120=120 MHz +sparkfun_xrp_controller_beta.menu.freq.120.build.f_cpu=120000000L +sparkfun_xrp_controller_beta.menu.freq.125=125 MHz +sparkfun_xrp_controller_beta.menu.freq.125.build.f_cpu=125000000L +sparkfun_xrp_controller_beta.menu.freq.128=128 MHz +sparkfun_xrp_controller_beta.menu.freq.128.build.f_cpu=128000000L +sparkfun_xrp_controller_beta.menu.freq.150=150 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.150.build.f_cpu=150000000L +sparkfun_xrp_controller_beta.menu.freq.175=175 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.175.build.f_cpu=175000000L +sparkfun_xrp_controller_beta.menu.freq.200=200 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.200.build.f_cpu=200000000L +sparkfun_xrp_controller_beta.menu.freq.225=225 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.225.build.f_cpu=225000000L +sparkfun_xrp_controller_beta.menu.freq.240=240 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.240.build.f_cpu=240000000L +sparkfun_xrp_controller_beta.menu.freq.250=250 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.250.build.f_cpu=250000000L +sparkfun_xrp_controller_beta.menu.freq.275=275 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.275.build.f_cpu=275000000L +sparkfun_xrp_controller_beta.menu.freq.300=300 MHz (Overclock) +sparkfun_xrp_controller_beta.menu.freq.300.build.f_cpu=300000000L +sparkfun_xrp_controller_beta.menu.opt.Small=Small (-Os) (standard) +sparkfun_xrp_controller_beta.menu.opt.Small.build.flags.optimize=-Os +sparkfun_xrp_controller_beta.menu.opt.Optimize=Optimize (-O) +sparkfun_xrp_controller_beta.menu.opt.Optimize.build.flags.optimize=-O +sparkfun_xrp_controller_beta.menu.opt.Optimize2=Optimize More (-O2) +sparkfun_xrp_controller_beta.menu.opt.Optimize2.build.flags.optimize=-O2 +sparkfun_xrp_controller_beta.menu.opt.Optimize3=Optimize Even More (-O3) +sparkfun_xrp_controller_beta.menu.opt.Optimize3.build.flags.optimize=-O3 +sparkfun_xrp_controller_beta.menu.opt.Fast=Fast (-Ofast) (maybe slower) +sparkfun_xrp_controller_beta.menu.opt.Fast.build.flags.optimize=-Ofast +sparkfun_xrp_controller_beta.menu.opt.Debug=Debug (-Og) +sparkfun_xrp_controller_beta.menu.opt.Debug.build.flags.optimize=-Og +sparkfun_xrp_controller_beta.menu.opt.Disabled=Disabled (-O0) +sparkfun_xrp_controller_beta.menu.opt.Disabled.build.flags.optimize=-O0 +sparkfun_xrp_controller_beta.menu.profile.Disabled=Disabled +sparkfun_xrp_controller_beta.menu.profile.Disabled.build.flags.profile= +sparkfun_xrp_controller_beta.menu.profile.Enabled=Enabled +sparkfun_xrp_controller_beta.menu.profile.Enabled.build.flags.profile=-pg -D__PROFILE +sparkfun_xrp_controller_beta.menu.rtti.Disabled=Disabled +sparkfun_xrp_controller_beta.menu.rtti.Disabled.build.flags.rtti=-fno-rtti +sparkfun_xrp_controller_beta.menu.rtti.Enabled=Enabled +sparkfun_xrp_controller_beta.menu.rtti.Enabled.build.flags.rtti= +sparkfun_xrp_controller_beta.menu.stackprotect.Disabled=Disabled +sparkfun_xrp_controller_beta.menu.stackprotect.Disabled.build.flags.stackprotect= +sparkfun_xrp_controller_beta.menu.stackprotect.Enabled=Enabled +sparkfun_xrp_controller_beta.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector +sparkfun_xrp_controller_beta.menu.exceptions.Disabled=Disabled +sparkfun_xrp_controller_beta.menu.exceptions.Disabled.build.flags.exceptions=-fno-exceptions +sparkfun_xrp_controller_beta.menu.exceptions.Disabled.build.flags.libstdcpp=-lstdc++ +sparkfun_xrp_controller_beta.menu.exceptions.Enabled=Enabled +sparkfun_xrp_controller_beta.menu.exceptions.Enabled.build.flags.exceptions=-fexceptions +sparkfun_xrp_controller_beta.menu.exceptions.Enabled.build.flags.libstdcpp=-lstdc++-exc +sparkfun_xrp_controller_beta.menu.dbgport.Disabled=Disabled +sparkfun_xrp_controller_beta.menu.dbgport.Disabled.build.debug_port= +sparkfun_xrp_controller_beta.menu.dbgport.Serial=Serial +sparkfun_xrp_controller_beta.menu.dbgport.Serial.build.debug_port=-DDEBUG_RP2040_PORT=Serial +sparkfun_xrp_controller_beta.menu.dbgport.Serial1=Serial1 +sparkfun_xrp_controller_beta.menu.dbgport.Serial1.build.debug_port=-DDEBUG_RP2040_PORT=Serial1 +sparkfun_xrp_controller_beta.menu.dbgport.Serial2=Serial2 +sparkfun_xrp_controller_beta.menu.dbgport.Serial2.build.debug_port=-DDEBUG_RP2040_PORT=Serial2 +sparkfun_xrp_controller_beta.menu.dbgport.SerialSemi=SerialSemi +sparkfun_xrp_controller_beta.menu.dbgport.SerialSemi.build.debug_port=-DDEBUG_RP2040_PORT=SerialSemi +sparkfun_xrp_controller_beta.menu.dbglvl.None=None +sparkfun_xrp_controller_beta.menu.dbglvl.None.build.debug_level= +sparkfun_xrp_controller_beta.menu.dbglvl.Core=Core +sparkfun_xrp_controller_beta.menu.dbglvl.Core.build.debug_level=-DDEBUG_RP2040_CORE +sparkfun_xrp_controller_beta.menu.dbglvl.SPI=SPI +sparkfun_xrp_controller_beta.menu.dbglvl.SPI.build.debug_level=-DDEBUG_RP2040_SPI +sparkfun_xrp_controller_beta.menu.dbglvl.Wire=Wire +sparkfun_xrp_controller_beta.menu.dbglvl.Wire.build.debug_level=-DDEBUG_RP2040_WIRE +sparkfun_xrp_controller_beta.menu.dbglvl.Bluetooth=Bluetooth +sparkfun_xrp_controller_beta.menu.dbglvl.Bluetooth.build.debug_level=-DDEBUG_RP2040_BLUETOOTH +sparkfun_xrp_controller_beta.menu.dbglvl.All=All +sparkfun_xrp_controller_beta.menu.dbglvl.All.build.debug_level=-DDEBUG_RP2040_WIRE -DDEBUG_RP2040_SPI -DDEBUG_RP2040_CORE -DDEBUG_RP2040_BLUETOOTH +sparkfun_xrp_controller_beta.menu.dbglvl.NDEBUG=NDEBUG +sparkfun_xrp_controller_beta.menu.dbglvl.NDEBUG.build.debug_level=-DNDEBUG +sparkfun_xrp_controller_beta.menu.usbstack.picosdk=Pico SDK +sparkfun_xrp_controller_beta.menu.usbstack.picosdk.build.usbstack_flags= +sparkfun_xrp_controller_beta.menu.usbstack.tinyusb=Adafruit TinyUSB +sparkfun_xrp_controller_beta.menu.usbstack.tinyusb.build.usbstack_flags=-DUSE_TINYUSB "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino" +sparkfun_xrp_controller_beta.menu.usbstack.tinyusb_host=Adafruit TinyUSB Host (native) +sparkfun_xrp_controller_beta.menu.usbstack.tinyusb_host.build.usbstack_flags=-DUSE_TINYUSB -DUSE_TINYUSB_HOST "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino" +sparkfun_xrp_controller_beta.menu.usbstack.nousb=No USB +sparkfun_xrp_controller_beta.menu.usbstack.nousb.build.usbstack_flags="-DNO_USB -DDISABLE_USB_SERIAL -I{runtime.platform.path}/tools/libpico" +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4only=IPv4 Only +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4only.build.libpicow=libipv4.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4only.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6=IPv4 + IPv6 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6.build.libpicow=libipv4-ipv6.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4btcble=IPv4 + Bluetooth +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4btcble.build.libpicow=libipv4-bt.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4btcble.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6btcble=IPv4 + IPv6 + Bluetooth +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6btcble.build.libpicow=libipv4-ipv6-bt.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6btcble.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4onlybig=IPv4 Only - 32K +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4onlybig.build.libpicow=libipv4-big.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4onlybig.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 -D__LWIP_MEMMULT=2 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6big=IPv4 + IPv6 - 32K +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6big.build.libpicow=libipv4-ipv6-big.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6big.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -D__LWIP_MEMMULT=2 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4btcblebig=IPv4 + Bluetooth - 32K +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4btcblebig.build.libpicow=libipv4-bt-big.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4btcblebig.build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 -D__LWIP_MEMMULT=2 +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6btcblebig=IPv4 + IPv6 + Bluetooth - 32K +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6btcblebig.build.libpicow=libipv4-ipv6-bt-big.a +sparkfun_xrp_controller_beta.menu.ipbtstack.ipv4ipv6btcblebig.build.libpicowdefs=-DLWIP_IPV6=1 -DLWIP_IPV4=1 -DENABLE_CLASSIC=1 -DENABLE_BLE=1 -D__LWIP_MEMMULT=2 +sparkfun_xrp_controller_beta.menu.uploadmethod.default=Default (UF2) +sparkfun_xrp_controller_beta.menu.uploadmethod.default.build.ram_length=256k +sparkfun_xrp_controller_beta.menu.uploadmethod.default.build.debugscript=picoprobe_cmsis_dap.tcl +sparkfun_xrp_controller_beta.menu.uploadmethod.default.upload.maximum_data_size=262144 +sparkfun_xrp_controller_beta.menu.uploadmethod.default.upload.tool=uf2conv +sparkfun_xrp_controller_beta.menu.uploadmethod.default.upload.tool.default=uf2conv +sparkfun_xrp_controller_beta.menu.uploadmethod.default.upload.tool.network=uf2conv-network +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool=Picotool +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool.build.ram_length=256k +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool.build.debugscript=picoprobe.tcl +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool.build.picodebugflags=-DENABLE_PICOTOOL_USB +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool.upload.maximum_data_size=262144 +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool.upload.tool=picotool +sparkfun_xrp_controller_beta.menu.uploadmethod.picotool.upload.tool.default=picotool +sparkfun_xrp_controller_beta.menu.uploadmethod.picoprobe_cmsis_dap=Picoprobe/Debugprobe (CMSIS-DAP) +sparkfun_xrp_controller_beta.menu.uploadmethod.picoprobe_cmsis_dap.build.ram_length=256k +sparkfun_xrp_controller_beta.menu.uploadmethod.picoprobe_cmsis_dap.build.debugscript=picoprobe_cmsis_dap.tcl +sparkfun_xrp_controller_beta.menu.uploadmethod.picoprobe_cmsis_dap.upload.maximum_data_size=262144 +sparkfun_xrp_controller_beta.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool=picoprobe_cmsis_dap +sparkfun_xrp_controller_beta.menu.uploadmethod.picoprobe_cmsis_dap.upload.tool.default=picoprobe_cmsis_dap + # ----------------------------------- # Seeed INDICATOR RP2040 # ----------------------------------- diff --git a/package/package_pico_index.template.json b/package/package_pico_index.template.json index 2e145f638..7571f2d82 100644 --- a/package/package_pico_index.template.json +++ b/package/package_pico_index.template.json @@ -305,6 +305,9 @@ { "name": "SparkFun IoT Node LoRaWAN" }, + { + "name": "SparkFun XRP Controller (Beta)" + }, { "name": "Seeed INDICATOR RP2040" }, diff --git a/tools/json/sparkfun_xrp_controller_beta.json b/tools/json/sparkfun_xrp_controller_beta.json new file mode 100644 index 000000000..7c2a2f0d2 --- /dev/null +++ b/tools/json/sparkfun_xrp_controller_beta.json @@ -0,0 +1,55 @@ +{ + "build": { + "arduino": { + "earlephilhower": { + "boot2_source": "boot2_w25q080_2_padded_checksum.S", + "usb_vid": "0x1B4F", + "usb_pid": "0x0045" + } + }, + "core": "earlephilhower", + "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_SPARKFUN_XRP_CONTROLLER_BETA -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1", + "f_cpu": "133000000L", + "hwids": [ + [ + "0x2E8A", + "0x00C0" + ], + [ + "0x1B4F", + "0x0045" + ] + ], + "mcu": "rp2040", + "variant": "sparkfun_xrp_controller_beta" + }, + "debug": { + "jlink_device": "RP2040_M0_0", + "openocd_target": "rp2040.cfg", + "svd_path": "rp2040.svd" + }, + "frameworks": [ + "arduino" + ], + "name": "XRP Controller (Beta)", + "upload": { + "maximum_ram_size": 262144, + "maximum_size": 2097152, + "require_upload_port": true, + "native_usb": true, + "use_1200bps_touch": true, + "wait_for_upload_port": false, + "protocol": "picotool", + "protocols": [ + "blackmagic", + "cmsis-dap", + "jlink", + "raspberrypi-swd", + "picotool", + "picoprobe" + ] + }, + "url": "https://www.raspberrypi.org/products/raspberry-pi-pico/", + "vendor": "SparkFun" +} \ No newline at end of file diff --git a/tools/makeboards.py b/tools/makeboards.py index be0c82877..978618b88 100755 --- a/tools/makeboards.py +++ b/tools/makeboards.py @@ -652,6 +652,7 @@ def MakeBoardJSON(name, chip, vendor_name, product_name, vid, pid, pwr, boarddef MakeBoard("sparkfun_thingplusrp2040", "rp2040", "SparkFun", "Thing Plus RP2040", "0x1b4f", "0x0026", 250, "SPARKFUN_THINGPLUS_RP2040", 16, 0, "boot2_w25q080_2_padded_checksum") MakeBoard("sparkfun_thingplusrp2350", "rp2350", "SparkFun", "Thing Plus RP2350", "0x1b4f", "0x0038", 250, "SPARKFUN_THINGPLUS_RP2350", 16, 8, "none", ["PICO_CYW43_SUPPORTED=1", "CYW43_PIN_WL_DYNAMIC=1"]) MakeBoard("sparkfun_iotnode_lorawanrp2350", "rp2350", "SparkFun", "IoT Node LoRaWAN", "0x1b4f", "0x0044", 250, "SPARKFUN_IOTNODE_LORAWAN_RP2350", 16, 8, "none") +MakeBoard("sparkfun_xrp_controller_beta", "rp2040", "SparkFun", "XRP Controller (Beta)", "0x1b4f", "0x0045", 250, "SPARKFUN_XRP_CONTROLLER_BETA", 2, 0, "boot2_w25q080_2_padded_checksum", ["PICO_CYW43_SUPPORTED=1", "CYW43_PIN_WL_DYNAMIC=1"]) # Seeed MakeBoard("seeed_indicator_rp2040", "rp2040", "Seeed", "INDICATOR RP2040", "0x2886", "0x0050", 250, "SEEED_INDICATOR_RP2040", 2, 0, "boot2_w25q080_2_padded_checksum") diff --git a/variants/sparkfun_xrp_controller_beta/digital.cpp b/variants/sparkfun_xrp_controller_beta/digital.cpp new file mode 100644 index 000000000..2dc7a878e --- /dev/null +++ b/variants/sparkfun_xrp_controller_beta/digital.cpp @@ -0,0 +1,33 @@ +/* + pinMode and digitalRead/Write for the Raspberry Pi Pico W RP2040 + Copyright (c) 2022 Earle F. Philhower, III + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" +#include + +extern "C" void pinMode(pin_size_t pin, PinMode mode) { + cyw43_pinMode(pin, mode); +} + +extern "C" void digitalWrite(pin_size_t pin, PinStatus val) { + cyw43_digitalWrite(pin, val); +} + +extern "C" PinStatus digitalRead(pin_size_t pin) { + return cyw43_digitalRead(pin); +} diff --git a/variants/sparkfun_xrp_controller_beta/init.cpp b/variants/sparkfun_xrp_controller_beta/init.cpp new file mode 100644 index 000000000..568ccdca8 --- /dev/null +++ b/variants/sparkfun_xrp_controller_beta/init.cpp @@ -0,0 +1,25 @@ +/* + Initialize the Pico W WiFi driver + + Copyright (c) 2022 Earle F. Philhower, III + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +extern "C" void initVariant() { + init_cyw43_wifi(); +} diff --git a/variants/sparkfun_xrp_controller_beta/pins_arduino.h b/variants/sparkfun_xrp_controller_beta/pins_arduino.h new file mode 100644 index 000000000..4814b712e --- /dev/null +++ b/variants/sparkfun_xrp_controller_beta/pins_arduino.h @@ -0,0 +1,103 @@ +#pragma once + +#include + +// XRP default pin names +#define MOTOR_L_IN_1 (6u) +#define MOTOR_L_IN_2 (7u) +#define MOTOR_R_IN_1 (14u) +#define MOTOR_R_IN_2 (15u) +#define MOTOR_3_IN_1 (2u) +#define MOTOR_3_IN_2 (3u) +#define MOTOR_4_IN_1 (10u) +#define MOTOR_4_IN_2 (11u) +#define MOTOR_L_ENCODER_A (4u) +#define MOTOR_L_ENCODER_B (5u) +#define MOTOR_R_ENCODER_A (12u) +#define MOTOR_R_ENCODER_B (13u) +#define MOTOR_3_ENCODER_A (0u) +#define MOTOR_3_ENCODER_B (1u) +#define MOTOR_4_ENCODER_A (8u) +#define MOTOR_4_ENCODER_B (9u) +#define SERVO_1 (16u) +#define SERVO_2 (17u) +#define I2C_SDA_1 (18u) +#define I2C_SCL_1 (19u) +#define DISTANCE_TRIGGER (20u) +#define DISTANCE_ECHO (21u) +#define LINE_L (26u) +#define LINE_R (27u) +#define BOARD_VIN_MEASURE (28u) +#define BOARD_USER_BUTTON (22u) +#define BOARD_LED (PIN_LED) + +// XRP alternate pin names +#define ML_IN_1 (6u) +#define ML_IN_2 (7u) +#define MR_IN_1 (14u) +#define MR_IN_2 (15u) +#define M3_IN_1 (2u) +#define M3_IN_2 (3u) +#define M4_IN_1 (10u) +#define M4_IN_2 (11u) +#define ML_ENC_A (4u) +#define ML_ENC_B (5u) +#define MR_ENC_A (12u) +#define MR_ENC_B (13u) +#define M3_ENC_A (0u) +#define M3_ENC_B (1u) +#define M4_ENC_A (8u) +#define M4_ENC_B (9u) +#define S1 (16u) +#define S2 (17u) +#define SDA_1 (18u) +#define SCL_1 (19u) +#define RANGE_TRIGGER (20u) +#define RANGE_ECHO (21u) +#define REFLECTANCE_L (26u) +#define REFLECTANCE_R (27u) +#define BRD_VIN (28u) +#define BRD_USR_BTN (22u) +#define BRD_LED (PIN_LED) + +// LEDs +#define PIN_LED (64u) + +// Serial +#define PIN_SERIAL1_TX (31u) +#define PIN_SERIAL1_RX (31u) + +#define PIN_SERIAL2_TX (31u) +#define PIN_SERIAL2_RX (31u) + +// SPI +#define PIN_SPI0_MISO (31u) +#define PIN_SPI0_MOSI (31u) +#define PIN_SPI0_SCK (31u) +#define PIN_SPI0_SS (31u) + +#define PIN_SPI1_MISO (31u) +#define PIN_SPI1_MOSI (31u) +#define PIN_SPI1_SCK (31u) +#define PIN_SPI1_SS (31u) + +// Wire +#define PIN_WIRE0_SDA (18u) +#define PIN_WIRE0_SCL (19u) + +#define PIN_WIRE1_SDA (31u) +#define PIN_WIRE1_SCL (31u) + +// XRP Beta Controller uses I2C1 for Qwiic connector, make that the default +#ifndef __WIRE0_DEVICE +#define __WIRE0_DEVICE i2c1 +#endif +#ifndef __WIRE1_DEVICE +#define __WIRE1_DEVICE i2c0 +#endif + +#define SERIAL_HOWMANY (3u) +#define SPI_HOWMANY (2u) +#define WIRE_HOWMANY (2u) + +#include "../generic/common.h"