Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91c007eb8f | ||
|
|
b29f6b922f | ||
|
|
40e52f84b8 | ||
|
|
972b7f53be | ||
|
|
fc894fba0e | ||
|
|
929ee98a6c | ||
|
|
88ccf0c256 | ||
|
|
874b41f549 | ||
|
|
fcd47fe170 | ||
|
|
842ec245ac | ||
|
|
a41618fa87 | ||
|
|
c095fce5b2 | ||
|
|
6715e5e6b7 | ||
|
|
12702717e3 | ||
|
|
9c66d9737b | ||
|
|
7f5756c464 | ||
|
|
1a30113f0d | ||
|
|
f1170e9d54 | ||
|
|
1bf41bcc60 | ||
|
|
7180ca3b0c | ||
|
|
c64a4a58d7 | ||
|
|
02c272b091 | ||
|
|
2a74250a51 | ||
|
|
adb23c1cac | ||
|
|
a99a572bda | ||
|
|
7ce7dde06a | ||
|
|
fef8d2c384 | ||
|
|
916c31d934 | ||
|
|
403c147fa3 | ||
|
|
915e093564 | ||
|
|
32e74d024e | ||
|
|
326697bbe1 | ||
|
|
afbba68549 | ||
|
|
042555206b | ||
|
|
24f6302612 | ||
|
|
15eb459df9 | ||
|
|
3160fde679 | ||
|
|
1160d7cd7c | ||
|
|
2aa85e3263 | ||
|
|
c4f36170d4 | ||
|
|
3068cd0af0 | ||
|
|
fa390f48af | ||
|
|
0c7454b6f7 | ||
|
|
500f197c02 | ||
|
|
2bf249ffe1 | ||
|
|
81070a0b3f | ||
|
|
d45a11f9e7 | ||
|
|
c3a3526aad | ||
|
|
280fc43731 | ||
|
|
762535faf9 | ||
|
|
0e4fd0587b | ||
|
|
d2461a14ad | ||
|
|
a1902b5f41 | ||
|
|
c2d60774af | ||
|
|
269c579846 | ||
|
|
91183ca22f | ||
|
|
971c235e8d | ||
|
|
abd3547711 | ||
|
|
9181ec055d | ||
|
|
58089b1f44 | ||
|
|
4f62e0a4ba | ||
|
|
dbab62c214 | ||
|
|
6a878cdee8 | ||
|
|
cebdb6c917 | ||
|
|
39a2bbd788 | ||
|
|
199314a463 | ||
|
|
1020023eab | ||
|
|
a475c444c5 | ||
|
|
633ac316b4 | ||
|
|
4625d2c8ab | ||
|
|
db7ba160ae | ||
|
|
ea936f00e1 | ||
|
|
8ac616e8db | ||
|
|
3ce902183e | ||
|
|
c34e602937 | ||
|
|
28e25293a9 | ||
|
|
319d36531e | ||
|
|
5bea328967 | ||
|
|
f5f7267f44 | ||
|
|
a4ad8ae0fd | ||
|
|
44abc19d46 | ||
|
|
2e93f1c9c8 | ||
|
|
ae6847cf78 | ||
|
|
d42f0ab4b0 | ||
|
|
10ddaee94d | ||
|
|
5678bb9904 | ||
|
|
5ecef160d4 | ||
|
|
52d50da56f | ||
|
|
47111a6eba | ||
|
|
f6a5ef0f85 | ||
|
|
7868ddee42 | ||
|
|
6a0cc90a4d | ||
|
|
21d212a2ff | ||
|
|
bd6b20dedd | ||
|
|
3cc68f82a2 | ||
|
|
4f945780e7 | ||
|
|
f08ef117b5 |
@@ -18,7 +18,7 @@ jobs:
|
||||
name: Check spelling
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Run codespell
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
name: Style, Boards, Package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
- name: Check package references
|
||||
@@ -59,15 +59,15 @@ jobs:
|
||||
matrix:
|
||||
chunk: [0, 1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Cache Linux toolchain
|
||||
id: cache-linux
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./tools/dist
|
||||
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
|
||||
@@ -87,15 +87,15 @@ jobs:
|
||||
name: Build TinyUSB Examples
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Cache Linux toolchain
|
||||
id: cache-linux
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./tools/dist
|
||||
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
|
||||
@@ -113,15 +113,15 @@ jobs:
|
||||
name: Windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Cache Windows toolchain
|
||||
id: cache-windows
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./tools/dist
|
||||
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
|
||||
@@ -144,17 +144,20 @@ jobs:
|
||||
# Single build under macOS to ensure the Mac toolchain is good.
|
||||
build-mac:
|
||||
name: Mac
|
||||
runs-on: macOS-12
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macOS-12, macOS-14]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Cache Mac toolchain
|
||||
id: cache-mac
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./tools/dist
|
||||
key: ${{ runner.os }}-${{ hashFiles('package/package_pico_index.template.json', 'tests/common.sh') }}
|
||||
@@ -165,6 +168,7 @@ jobs:
|
||||
mod: 500
|
||||
rem: 1
|
||||
run: |
|
||||
uname -a
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd ..
|
||||
@@ -175,7 +179,7 @@ jobs:
|
||||
name: Build PlatformIO Examples
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: 'true'
|
||||
- name: Initialize needed submodules
|
||||
@@ -186,19 +190,19 @@ jobs:
|
||||
git submodule update --init
|
||||
cd ../..
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install PlatformIO
|
||||
|
||||
@@ -9,21 +9,21 @@ jobs:
|
||||
name: Update master JSON file
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
# - name: Cache PlatformIO
|
||||
# uses: actions/cache@v3
|
||||
# uses: actions/cache@v4
|
||||
# with:
|
||||
# path: ~/.platformio
|
||||
# key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
@@ -15,11 +15,11 @@ jobs:
|
||||
name: Package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Build package JSON
|
||||
|
||||
@@ -30,7 +30,9 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
|
||||
* BridgeTek IDM2040-7A
|
||||
* Cytron Maker Pi RP2040
|
||||
* Cytron Maker Nano RP2040
|
||||
* Cytron Maker Uno RP2040
|
||||
* DatanoiseTV PicoADK+
|
||||
* Degz Suibo RP2040
|
||||
* DeRuiLab FlyBoard2040 Core
|
||||
* DFRobot Beetle RP2040
|
||||
* ElectronicCats Hunter Cat NFC
|
||||
@@ -52,6 +54,10 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
|
||||
* Pimoroni PGA2040
|
||||
* Pimoroni Plasma2040
|
||||
* Pimoroni Tiny2040
|
||||
* RAKwireless RAK11300
|
||||
* Redscorp RP2040-Eins
|
||||
* Redscorp RP2040-ProMini
|
||||
* Sea-Picro
|
||||
* Seeed Indicator RP2040
|
||||
* Seeed XIAO RP2040
|
||||
* Silicognition RP2040-Shim
|
||||
@@ -69,9 +75,36 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
|
||||
* WIZnet W5100S-EVB-Pico
|
||||
* WIZnet W5500-EVB-Pico
|
||||
* WIZnet WizFi360-EVB-Pico
|
||||
* Redscorp RP2040-ProMini
|
||||
* Generic (configurable flash, I/O pins)
|
||||
|
||||
# Features
|
||||
* Adafruit TinyUSB Arduino (USB mouse, keyboard, flash drive, generic HID, CDC Serial, MIDI, WebUSB, others)
|
||||
* Bluetooth on the PicoW (Classic and BLE) with Keyboard, Mouse, Joystick, and Virtual Serial
|
||||
* Generic Arduino USB Serial, Keyboard, Joystick, and Mouse emulation
|
||||
* WiFi (Pico W)
|
||||
* Ethernet (Wired W5500, W5100, ENC28J60)
|
||||
* HTTP client and server (WebServer)
|
||||
* SSL/TLS/HTTPS
|
||||
* Over-the-Air (OTA) upgrades
|
||||
* Filesystems (LittleFS and SD/SDFS)
|
||||
* Multicore support (setup1() and loop1())
|
||||
* FreeRTOS SMP support
|
||||
* Overclocking and underclocking from the menus
|
||||
* digitalWrite/Read, shiftIn/Out, tone, analogWrite(PWM)/Read, temperature
|
||||
* Analog stereo audio in using DMA and the built-in ADC
|
||||
* Analog stereo audio out using PWM hardware
|
||||
* USB drive mode for data loggers (SingleFileDrive)
|
||||
* Peripherals: SPI master/slave, Wire(I2C) master/slave, dual UART, emulated EEPROM, I2S audio input/output, Servo
|
||||
* printf (i.e. debug) output over USB serial
|
||||
|
||||
The RP2040 PIO state machines (SMs) are used to generate jitter-free:
|
||||
* Servos
|
||||
* Tones
|
||||
* I2S Input
|
||||
* I2S Output
|
||||
* Software UARTs (Serial ports)
|
||||
|
||||
|
||||
# Installing via Arduino Boards Manager
|
||||
## Windows-specific Notes
|
||||
Please do not use the Windows Store version of the actual Arduino application
|
||||
@@ -169,11 +202,14 @@ Under Windows a local admin user should be able to access the Picoprobe port aut
|
||||
|
||||
To set up user-level access to Picoprobes on Ubuntu (and other OSes which use `udev`):
|
||||
````
|
||||
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", GROUP="users", MODE="0666"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
|
||||
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="0666"' | sudo tee -a /etc/udev/rules.d/98-PicoProbe.rules
|
||||
sudo udevadm control --reload
|
||||
sudo udevadm trigger -w -s usb
|
||||
````
|
||||
|
||||
The first line creates a file with the USB vendor and ID of the Picoprobe and tells UDEV to give users full access to it. The second causes `udev` to load this new rule. Note that you will need to unplug and re-plug in your device the first time you create this file, to allow udev to make the device node properly.
|
||||
The first line creates a device file in `/dev` matching the USB vendor and product ID of the Picoprobe, and it enables global read+write permissions. The second line causes `udev` to load this new rule. The third line requests the kernel generate "device change" events that will cause our new `udev` rule to run.
|
||||
|
||||
If for some reason the device file does not appear, manually unplug and re-plug the USB connection and check again. The output from `dmesg` can reveal useful diagnostics if the device file remains absent.
|
||||
|
||||
Once Picoprobe permissions are set up properly, then select the board "Raspberry Pi Pico (Picoprobe)" in the Tools menu and upload as normal.
|
||||
|
||||
@@ -182,13 +218,16 @@ Once Picoprobe permissions are set up properly, then select the board "Raspberry
|
||||
|
||||
Under Windows and macOS, any user should be able to access pico-debug automatically, but under Linux `udev` must be told about the device and to allow normal users access.
|
||||
|
||||
To set up user-level access to all CMSIS-DAP adapters on Ubuntu (and other OSes which use `udev`):
|
||||
To set up group-level access to all CMSIS-DAP adapters on Ubuntu (and other OSes which use `udev`):
|
||||
````
|
||||
echo 'ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/98-CMSIS-DAP.rules
|
||||
sudo udevadm control --reload
|
||||
sudo udevadm trigger -w -s usb
|
||||
````
|
||||
|
||||
The first line creates a file that recognizes all CMSIS-DAP adapters and tells UDEV to give users full access to it. The second causes `udev` to load this new rule. Note that you will need to unplug and re-plug in your device the first time you create this file, to allow udev to make the device node properly.
|
||||
The first line creates a device file in `/dev` that matches all CMSIS-DAP adapters, and it enables read+write permissions for members of the `plugdev` group. The second line causes `udev` to load this new rule. The third line requests the kernel generate "device change" events that will cause our new `udev` rule to run.
|
||||
|
||||
If for some reason the device file does not appear, manually unplug and re-plug the USB connection and check again. The output from `dmesg` can reveal useful diagnostics if the device file remains absent.
|
||||
|
||||
Once CMSIS-DAP permissions are set up properly, then select the board "Raspberry Pi Pico (pico-debug)" in the Tools menu.
|
||||
|
||||
@@ -197,48 +236,6 @@ When first connecting the USB port to your PC, you must copy [pico-debug-gimmeca
|
||||
# Debugging with Picoprobe/pico-debug, OpenOCD, and GDB
|
||||
The installed tools include a version of OpenOCD (in the pqt-openocd directory) and GDB (in the pqt-gcc directory). These may be used to run GDB in an interactive window as documented in the Pico Getting Started manuals from the Raspberry Pi Foundation. For [pico-debug](https://github.com/majbthrd/pico-debug/), replace the raspberrypi-swd and picoprobe example OpenOCD arguments of "-f interface/raspberrypi-swd.cfg -f target/rp2040.cfg" or "-f interface/picoprobe.cfg -f target/rp2040.cfg" respectively in the Pico Getting Started manual with "-f board/pico-debug.cfg".
|
||||
|
||||
# Features
|
||||
* Adafruit TinyUSB Arduino (USB mouse, keyboard, flash drive, generic HID, CDC Serial, MIDI, WebUSB, others)
|
||||
* Bluetooth on the PicoW (Classic and BLE) with Keyboard, Mouse, Joystick, and Virtual Serial
|
||||
* Generic Arduino USB Serial, Keyboard, Joystick, and Mouse emulation
|
||||
* WiFi (Pico W)
|
||||
* Ethernet (Wired W5500, W5100, ENC28J60)
|
||||
* HTTP client and server (WebServer)
|
||||
* SSL/TLS/HTTPS
|
||||
* Over-the-Air (OTA) upgrades
|
||||
* Filesystems (LittleFS and SD/SDFS)
|
||||
* Multicore support (setup1() and loop1())
|
||||
* FreeRTOS SMP support
|
||||
* Overclocking and underclocking from the menus
|
||||
* digitalWrite/Read, shiftIn/Out, tone, analogWrite(PWM)/Read, temperature
|
||||
* Analog stereo audio in using DMA and the built-in ADC
|
||||
* Analog stereo audio out using PWM hardware
|
||||
* USB drive mode for data loggers (SingleFileDrive)
|
||||
* Peripherals: SPI master/slave, Wire(I2C) master/slave, dual UART, emulated EEPROM, I2S audio input/output, Servo
|
||||
* printf (i.e. debug) output over USB serial
|
||||
|
||||
The RP2040 PIO state machines (SMs) are used to generate jitter-free:
|
||||
* Servos
|
||||
* Tones
|
||||
* I2S Input
|
||||
* I2S Output
|
||||
* Software UARTs (Serial ports)
|
||||
|
||||
# Tutorials from Across the Web
|
||||
Here are some links to coverage and additional tutorials for using `arduino-pico`
|
||||
* The File:: class is taken from the ESP8266. See https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html
|
||||
* Arduino Support for the Pi Pico available! And how fast is the Pico? - https://youtu.be/-XHh17cuH5E
|
||||
* Pre-release Adafruit QT Py RP2040 - https://www.youtube.com/watch?v=sfC1msqXX0I
|
||||
* Adafruit Feather RP2040 running LCD + TMP117 - https://www.youtube.com/watch?v=fKDeqZiIwHg
|
||||
* Demonstration of Servos and I2C in Korean - https://cafe.naver.com/arduinoshield/1201
|
||||
* Home Assistant Pico W integration starter project using Arduino - https://github.com/daniloc/PicoW_HomeAssistant_Starter
|
||||
* Tutorials for the Raspberry Pi Pico / uPesy RP2040 DevKit board
|
||||
- English version: https://www.upesy.com/blogs/tutorials/best-tutorials-for-rpi-pi-pico-with-arduino-code
|
||||
- French version: https://www.upesy.fr/blogs/tutorials/best-tutorials-for-rpi-pi-pico-with-arduino-code
|
||||
|
||||
# Contributing
|
||||
If you want to contribute or have bugfixes, drop me a note at <earlephilhower@yahoo.com> or open an issue/PR here.
|
||||
|
||||
# Licensing and Credits
|
||||
* The [Arduino IDE and ArduinoCore-API](https://arduino.cc) are developed and maintained by the Arduino team. The IDE is licensed under GPL.
|
||||
* The [RP2040 GCC-based toolchain](https://github.com/earlephilhower/pico-quick-toolchain) is licensed under under the GPL.
|
||||
@@ -248,14 +245,14 @@ If you want to contribute or have bugfixes, drop me a note at <earlephilhower@ya
|
||||
* [UF2CONV.PY](https://github.com/microsoft/uf2) is by Microsoft Corporation and licensed under the MIT license.
|
||||
* Networking and filesystem code taken from the [ESP8266 Arduino Core](https://github.com/esp8266/Arduino) and licensed under the LGPL.
|
||||
* DHCP server for AP host mode from the [Micropython Project](https://micropython.org), distributed under the MIT License.
|
||||
* [FreeRTOS](https://freertos.org) is Copyright Amazon.com, Inc. or its affiliates, and distributed under the MIT license.
|
||||
* [FreeRTOS](https://freertos.org) is copyright Amazon.com, Inc. or its affiliates, and distributed under the MIT license.
|
||||
* [lwIP](https://savannah.nongnu.org/projects/lwip/) is (c) the Swedish Institute of Computer Science and licenced under the BSD license.
|
||||
* [BearSSL](https://bearssl.org) library written by Thomas Pornin, is distributed under the [MIT License](https://bearssl.org/#legal-details).
|
||||
* [UZLib](https://github.com/pfalcon/uzlib) is copyright (c) 2003 Joergen Ibsen and distributed under the zlib license.
|
||||
* [LEAmDNS](https://github.com/LaborEtArs/ESP8266mDNS) is copyright multiple authors and distributed under the MIT license.
|
||||
* [http-parser](https://github.com/nodejs/http-parser) is copyright Joyent, Inc. and other Node contributors.
|
||||
* WebServer code modified from the [ESP32 WebServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/WebServer) and is copyright (c) 2015 Ivan Grokhotkov and others
|
||||
|
||||
* WebServer code modified from the [ESP32 WebServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/WebServer) and is copyright (c) 2015 Ivan Grokhotkov and others.
|
||||
* [Xoshiro-cpp](https://github.com/Reputeless/Xoshiro-cpp) is copyright (c) 2020 Ryo Suzuki and distributed under the MIT license.
|
||||
|
||||
-Earle F. Philhower, III
|
||||
earlephilhower@yahoo.com
|
||||
|
||||
+2319
-353
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
Enable BTStack debugging to a Print-able object
|
||||
|
||||
Copyright (c) 2023 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_CLASSIC) || defined(ENABLE_BLE)
|
||||
#include <Arduino.h>
|
||||
#include <btstack.h>
|
||||
#include <hci_dump.h>
|
||||
|
||||
static Print *_print;
|
||||
|
||||
static void _log_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len) {
|
||||
if (!_print) {
|
||||
return;
|
||||
}
|
||||
_print->printf("[BT @%lu] ", millis());
|
||||
|
||||
switch (packet_type) {
|
||||
case HCI_COMMAND_DATA_PACKET:
|
||||
_print->printf("CMD => ");
|
||||
break;
|
||||
case HCI_EVENT_PACKET:
|
||||
_print->printf("EVT <= ");
|
||||
break;
|
||||
case HCI_ACL_DATA_PACKET:
|
||||
_print->printf("ACL %s ", in ? "<=" : "=>");
|
||||
break;
|
||||
case HCI_SCO_DATA_PACKET:
|
||||
_print->printf("SCO %s ", in ? "<=" : "=>");
|
||||
break;
|
||||
case HCI_ISO_DATA_PACKET:
|
||||
_print->printf("ISO %s ", in ? "<=" : "=>");
|
||||
break;
|
||||
case LOG_MESSAGE_PACKET:
|
||||
_print->printf("LOG -- %s\n", (char*) packet);
|
||||
return;
|
||||
default:
|
||||
_print->printf("UNK(%x) %s ", packet_type, in ? "<=" : "=>");
|
||||
break;
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < len; i++) {
|
||||
_print->printf("%02X ", packet[i]);
|
||||
}
|
||||
_print->printf("\n");
|
||||
}
|
||||
|
||||
static void _log_message(int log_level, const char * format, va_list argptr) {
|
||||
(void)log_level;
|
||||
char log_message_buffer[HCI_DUMP_MAX_MESSAGE_LEN];
|
||||
if (!_print) {
|
||||
return;
|
||||
}
|
||||
vsnprintf(log_message_buffer, sizeof(log_message_buffer), format, argptr);
|
||||
_print->printf("[BT @%lu] LOG -- %s\n", millis(), log_message_buffer);
|
||||
}
|
||||
|
||||
|
||||
static const hci_dump_t hci_dump_instance = {
|
||||
NULL,
|
||||
_log_packet,
|
||||
_log_message
|
||||
};
|
||||
|
||||
|
||||
void __EnableBluetoothDebug(Print &print) {
|
||||
_print = &print;
|
||||
hci_dump_init(&hci_dump_instance);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -157,6 +157,10 @@ extern RP2040 rp2040;
|
||||
extern "C" void main1();
|
||||
extern "C" char __StackLimit;
|
||||
extern "C" char __bss_end__;
|
||||
extern "C" void setup1() __attribute__((weak));
|
||||
extern "C" void loop1() __attribute__((weak));
|
||||
extern "C" bool core1_separate_stack;
|
||||
extern "C" uint32_t* core1_separate_stack_address;
|
||||
|
||||
class RP2040 {
|
||||
public:
|
||||
@@ -238,6 +242,25 @@ public:
|
||||
return &__StackLimit - &__bss_end__;
|
||||
}
|
||||
|
||||
inline uint32_t getStackPointer() {
|
||||
uint32_t *sp;
|
||||
asm volatile("mov %0, sp" : "=r"(sp));
|
||||
return (uint32_t)sp;
|
||||
}
|
||||
|
||||
inline int getFreeStack() {
|
||||
const unsigned int sp = getStackPointer();
|
||||
uint32_t ref = 0x20040000;
|
||||
if (setup1 || loop1) {
|
||||
if (core1_separate_stack) {
|
||||
ref = cpuid() ? (unsigned int)core1_separate_stack_address : 0x20040000;
|
||||
} else {
|
||||
ref = cpuid() ? 0x20040000 : 0x20041000;
|
||||
}
|
||||
}
|
||||
return sp - ref;
|
||||
}
|
||||
|
||||
void idleOtherCore() {
|
||||
fifo.idleOtherCore();
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ static int __usb_task_irq;
|
||||
9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUSB_CLASS_VENDOR_SPECIFIC, RESET_INTERFACE_SUBCLASS, RESET_INTERFACE_PROTOCOL, _stridx,
|
||||
|
||||
|
||||
int usb_hid_poll_interval __attribute__((weak)) = 10;
|
||||
|
||||
const uint8_t *tud_descriptor_device_cb(void) {
|
||||
static tusb_desc_device_t usbd_desc_device = {
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
@@ -263,7 +265,7 @@ void __SetupUSBDescriptor() {
|
||||
uint8_t hid_itf = __USBInstallSerial ? 2 : 0;
|
||||
uint8_t hid_desc[TUD_HID_DESC_LEN] = {
|
||||
// Interface number, string index, protocol, report descriptor len, EP In & Out address, size & polling interval
|
||||
TUD_HID_DESCRIPTOR(hid_itf, 0, HID_ITF_PROTOCOL_NONE, hid_report_len, EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 10)
|
||||
TUD_HID_DESCRIPTOR(hid_itf, 0, HID_ITF_PROTOCOL_NONE, hid_report_len, EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, (uint8_t)usb_hid_poll_interval)
|
||||
};
|
||||
|
||||
uint8_t msd_itf = interface_count - 1;
|
||||
@@ -400,7 +402,7 @@ bool __USBHIDReady() {
|
||||
|
||||
while (((millis() - start) < timeout) && tud_ready() && !tud_hid_ready()) {
|
||||
tud_task();
|
||||
delay(1);
|
||||
delayMicroseconds(1);
|
||||
}
|
||||
return tud_hid_ready();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#define ARDUINO_PICO_MAJOR 3
|
||||
#define ARDUINO_PICO_MINOR 6
|
||||
#define ARDUINO_PICO_REVISION 0
|
||||
#define ARDUINO_PICO_VERSION_STR "3.6.0"
|
||||
#define ARDUINO_PICO_MINOR 7
|
||||
#define ARDUINO_PICO_REVISION 1
|
||||
#define ARDUINO_PICO_VERSION_STR "3.7.1"
|
||||
|
||||
@@ -197,6 +197,14 @@ static void CheckSerialReset() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SerialUSB::dtr() {
|
||||
return _dtr;
|
||||
}
|
||||
|
||||
bool SerialUSB::rts() {
|
||||
return _rts;
|
||||
}
|
||||
|
||||
extern "C" void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
|
||||
(void) itf;
|
||||
_dtr = dtr ? true : false;
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
virtual size_t write(const uint8_t *p, size_t len) override;
|
||||
using Print::write;
|
||||
operator bool() override;
|
||||
bool dtr();
|
||||
bool rts();
|
||||
|
||||
void ignoreFlowControl(bool ignore = true);
|
||||
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
|
||||
// autogenerated from https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
|
||||
// by script <rp2040 arduino core>/tools/tzupdate.sh
|
||||
// Sat 20 Jan 2024 08:54:45 PM UTC
|
||||
//
|
||||
// This database is autogenerated from IANA timezone database
|
||||
// https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
|
||||
// (using https://www.iana.org/time-zones)
|
||||
// and can be updated on demand in this repository
|
||||
// or by yourself using the above script
|
||||
|
||||
#pragma once
|
||||
|
||||
#define TZ_Africa_Abidjan ("GMT0")
|
||||
#define TZ_Africa_Accra ("GMT0")
|
||||
#define TZ_Africa_Addis_Ababa ("EAT-3")
|
||||
#define TZ_Africa_Algiers ("CET-1")
|
||||
#define TZ_Africa_Asmara ("EAT-3")
|
||||
#define TZ_Africa_Bamako ("GMT0")
|
||||
#define TZ_Africa_Bangui ("WAT-1")
|
||||
#define TZ_Africa_Banjul ("GMT0")
|
||||
#define TZ_Africa_Bissau ("GMT0")
|
||||
#define TZ_Africa_Blantyre ("CAT-2")
|
||||
#define TZ_Africa_Brazzaville ("WAT-1")
|
||||
#define TZ_Africa_Bujumbura ("CAT-2")
|
||||
#define TZ_Africa_Cairo ("EET-2EEST,M4.5.5/0,M10.5.4/24")
|
||||
#define TZ_Africa_Casablanca ("<+01>-1")
|
||||
#define TZ_Africa_Ceuta ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Africa_Conakry ("GMT0")
|
||||
#define TZ_Africa_Dakar ("GMT0")
|
||||
#define TZ_Africa_Dar_es_Salaam ("EAT-3")
|
||||
#define TZ_Africa_Djibouti ("EAT-3")
|
||||
#define TZ_Africa_Douala ("WAT-1")
|
||||
#define TZ_Africa_El_Aaiun ("<+01>-1")
|
||||
#define TZ_Africa_Freetown ("GMT0")
|
||||
#define TZ_Africa_Gaborone ("CAT-2")
|
||||
#define TZ_Africa_Harare ("CAT-2")
|
||||
#define TZ_Africa_Johannesburg ("SAST-2")
|
||||
#define TZ_Africa_Juba ("CAT-2")
|
||||
#define TZ_Africa_Kampala ("EAT-3")
|
||||
#define TZ_Africa_Khartoum ("CAT-2")
|
||||
#define TZ_Africa_Kigali ("CAT-2")
|
||||
#define TZ_Africa_Kinshasa ("WAT-1")
|
||||
#define TZ_Africa_Lagos ("WAT-1")
|
||||
#define TZ_Africa_Libreville ("WAT-1")
|
||||
#define TZ_Africa_Lome ("GMT0")
|
||||
#define TZ_Africa_Luanda ("WAT-1")
|
||||
#define TZ_Africa_Lubumbashi ("CAT-2")
|
||||
#define TZ_Africa_Lusaka ("CAT-2")
|
||||
#define TZ_Africa_Malabo ("WAT-1")
|
||||
#define TZ_Africa_Maputo ("CAT-2")
|
||||
#define TZ_Africa_Maseru ("SAST-2")
|
||||
#define TZ_Africa_Mbabane ("SAST-2")
|
||||
#define TZ_Africa_Mogadishu ("EAT-3")
|
||||
#define TZ_Africa_Monrovia ("GMT0")
|
||||
#define TZ_Africa_Nairobi ("EAT-3")
|
||||
#define TZ_Africa_Ndjamena ("WAT-1")
|
||||
#define TZ_Africa_Niamey ("WAT-1")
|
||||
#define TZ_Africa_Nouakchott ("GMT0")
|
||||
#define TZ_Africa_Ouagadougou ("GMT0")
|
||||
#define TZ_Africa_PortomNovo ("WAT-1")
|
||||
#define TZ_Africa_Sao_Tome ("GMT0")
|
||||
#define TZ_Africa_Tripoli ("EET-2")
|
||||
#define TZ_Africa_Tunis ("CET-1")
|
||||
#define TZ_Africa_Windhoek ("CAT-2")
|
||||
#define TZ_America_Adak ("HST10HDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Anchorage ("AKST9AKDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Anguilla ("AST4")
|
||||
#define TZ_America_Antigua ("AST4")
|
||||
#define TZ_America_Araguaina ("<-03>3")
|
||||
#define TZ_America_Argentina_Buenos_Aires ("<-03>3")
|
||||
#define TZ_America_Argentina_Catamarca ("<-03>3")
|
||||
#define TZ_America_Argentina_Cordoba ("<-03>3")
|
||||
#define TZ_America_Argentina_Jujuy ("<-03>3")
|
||||
#define TZ_America_Argentina_La_Rioja ("<-03>3")
|
||||
#define TZ_America_Argentina_Mendoza ("<-03>3")
|
||||
#define TZ_America_Argentina_Rio_Gallegos ("<-03>3")
|
||||
#define TZ_America_Argentina_Salta ("<-03>3")
|
||||
#define TZ_America_Argentina_San_Juan ("<-03>3")
|
||||
#define TZ_America_Argentina_San_Luis ("<-03>3")
|
||||
#define TZ_America_Argentina_Tucuman ("<-03>3")
|
||||
#define TZ_America_Argentina_Ushuaia ("<-03>3")
|
||||
#define TZ_America_Aruba ("AST4")
|
||||
#define TZ_America_Asuncion ("<-04>4<-03>,M10.1.0/0,M3.4.0/0")
|
||||
#define TZ_America_Atikokan ("EST5")
|
||||
#define TZ_America_Bahia ("<-03>3")
|
||||
#define TZ_America_Bahia_Banderas ("CST6")
|
||||
#define TZ_America_Barbados ("AST4")
|
||||
#define TZ_America_Belem ("<-03>3")
|
||||
#define TZ_America_Belize ("CST6")
|
||||
#define TZ_America_BlancmSablon ("AST4")
|
||||
#define TZ_America_Boa_Vista ("<-04>4")
|
||||
#define TZ_America_Bogota ("<-05>5")
|
||||
#define TZ_America_Boise ("MST7MDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Cambridge_Bay ("MST7MDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Campo_Grande ("<-04>4")
|
||||
#define TZ_America_Cancun ("EST5")
|
||||
#define TZ_America_Caracas ("<-04>4")
|
||||
#define TZ_America_Cayenne ("<-03>3")
|
||||
#define TZ_America_Cayman ("EST5")
|
||||
#define TZ_America_Chicago ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Chihuahua ("CST6")
|
||||
#define TZ_America_Costa_Rica ("CST6")
|
||||
#define TZ_America_Creston ("MST7")
|
||||
#define TZ_America_Cuiaba ("<-04>4")
|
||||
#define TZ_America_Curacao ("AST4")
|
||||
#define TZ_America_Danmarkshavn ("GMT0")
|
||||
#define TZ_America_Dawson ("MST7")
|
||||
#define TZ_America_Dawson_Creek ("MST7")
|
||||
#define TZ_America_Denver ("MST7MDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Detroit ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Dominica ("AST4")
|
||||
#define TZ_America_Edmonton ("MST7MDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Eirunepe ("<-05>5")
|
||||
#define TZ_America_El_Salvador ("CST6")
|
||||
#define TZ_America_Fortaleza ("<-03>3")
|
||||
#define TZ_America_Fort_Nelson ("MST7")
|
||||
#define TZ_America_Glace_Bay ("AST4ADT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Godthab ("<-02>2<-01>,M3.5.0/-1,M10.5.0/0")
|
||||
#define TZ_America_Goose_Bay ("AST4ADT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Grand_Turk ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Grenada ("AST4")
|
||||
#define TZ_America_Guadeloupe ("AST4")
|
||||
#define TZ_America_Guatemala ("CST6")
|
||||
#define TZ_America_Guayaquil ("<-05>5")
|
||||
#define TZ_America_Guyana ("<-04>4")
|
||||
#define TZ_America_Halifax ("AST4ADT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Havana ("CST5CDT,M3.2.0/0,M11.1.0/1")
|
||||
#define TZ_America_Hermosillo ("MST7")
|
||||
#define TZ_America_Indiana_Indianapolis ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Knox ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Marengo ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Petersburg ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Tell_City ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Vevay ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Vincennes ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Indiana_Winamac ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Inuvik ("MST7MDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Iqaluit ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Jamaica ("EST5")
|
||||
#define TZ_America_Juneau ("AKST9AKDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Kentucky_Louisville ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Kentucky_Monticello ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Kralendijk ("AST4")
|
||||
#define TZ_America_La_Paz ("<-04>4")
|
||||
#define TZ_America_Lima ("<-05>5")
|
||||
#define TZ_America_Los_Angeles ("PST8PDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Lower_Princes ("AST4")
|
||||
#define TZ_America_Maceio ("<-03>3")
|
||||
#define TZ_America_Managua ("CST6")
|
||||
#define TZ_America_Manaus ("<-04>4")
|
||||
#define TZ_America_Marigot ("AST4")
|
||||
#define TZ_America_Martinique ("AST4")
|
||||
#define TZ_America_Matamoros ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Mazatlan ("MST7")
|
||||
#define TZ_America_Menominee ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Merida ("CST6")
|
||||
#define TZ_America_Metlakatla ("AKST9AKDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Mexico_City ("CST6")
|
||||
#define TZ_America_Miquelon ("<-03>3<-02>,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Moncton ("AST4ADT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Monterrey ("CST6")
|
||||
#define TZ_America_Montevideo ("<-03>3")
|
||||
#define TZ_America_Montreal ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Montserrat ("AST4")
|
||||
#define TZ_America_Nassau ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_New_York ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Nipigon ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Nome ("AKST9AKDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Noronha ("<-02>2")
|
||||
#define TZ_America_North_Dakota_Beulah ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_North_Dakota_Center ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_North_Dakota_New_Salem ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Nuuk ("<-02>2<-01>,M3.5.0/-1,M10.5.0/0")
|
||||
#define TZ_America_Ojinaga ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Panama ("EST5")
|
||||
#define TZ_America_Pangnirtung ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Paramaribo ("<-03>3")
|
||||
#define TZ_America_Phoenix ("MST7")
|
||||
#define TZ_America_PortmaumPrince ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Port_of_Spain ("AST4")
|
||||
#define TZ_America_Porto_Velho ("<-04>4")
|
||||
#define TZ_America_Puerto_Rico ("AST4")
|
||||
#define TZ_America_Punta_Arenas ("<-03>3")
|
||||
#define TZ_America_Rainy_River ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Rankin_Inlet ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Recife ("<-03>3")
|
||||
#define TZ_America_Regina ("CST6")
|
||||
#define TZ_America_Resolute ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Rio_Branco ("<-05>5")
|
||||
#define TZ_America_Santarem ("<-03>3")
|
||||
#define TZ_America_Santiago ("<-04>4<-03>,M9.1.6/24,M4.1.6/24")
|
||||
#define TZ_America_Santo_Domingo ("AST4")
|
||||
#define TZ_America_Sao_Paulo ("<-03>3")
|
||||
#define TZ_America_Scoresbysund ("<-01>1<+00>,M3.5.0/0,M10.5.0/1")
|
||||
#define TZ_America_Sitka ("AKST9AKDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_St_Barthelemy ("AST4")
|
||||
#define TZ_America_St_Johns ("NST3:30NDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_St_Kitts ("AST4")
|
||||
#define TZ_America_St_Lucia ("AST4")
|
||||
#define TZ_America_St_Thomas ("AST4")
|
||||
#define TZ_America_St_Vincent ("AST4")
|
||||
#define TZ_America_Swift_Current ("CST6")
|
||||
#define TZ_America_Tegucigalpa ("CST6")
|
||||
#define TZ_America_Thule ("AST4ADT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Thunder_Bay ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Tijuana ("PST8PDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Toronto ("EST5EDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Tortola ("AST4")
|
||||
#define TZ_America_Vancouver ("PST8PDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Whitehorse ("MST7")
|
||||
#define TZ_America_Winnipeg ("CST6CDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Yakutat ("AKST9AKDT,M3.2.0,M11.1.0")
|
||||
#define TZ_America_Yellowknife ("MST7MDT,M3.2.0,M11.1.0")
|
||||
#define TZ_Antarctica_Casey ("<+11>-11")
|
||||
#define TZ_Antarctica_Davis ("<+07>-7")
|
||||
#define TZ_Antarctica_DumontDUrville ("<+10>-10")
|
||||
#define TZ_Antarctica_Macquarie ("AEST-10AEDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Antarctica_Mawson ("<+05>-5")
|
||||
#define TZ_Antarctica_McMurdo ("NZST-12NZDT,M9.5.0,M4.1.0/3")
|
||||
#define TZ_Antarctica_Palmer ("<-03>3")
|
||||
#define TZ_Antarctica_Rothera ("<-03>3")
|
||||
#define TZ_Antarctica_Syowa ("<+03>-3")
|
||||
#define TZ_Antarctica_Troll ("<+00>0<+02>-2,M3.5.0/1,M10.5.0/3")
|
||||
#define TZ_Antarctica_Vostok ("<+06>-6")
|
||||
#define TZ_Arctic_Longyearbyen ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Asia_Aden ("<+03>-3")
|
||||
#define TZ_Asia_Almaty ("<+06>-6")
|
||||
#define TZ_Asia_Amman ("<+03>-3")
|
||||
#define TZ_Asia_Anadyr ("<+12>-12")
|
||||
#define TZ_Asia_Aqtau ("<+05>-5")
|
||||
#define TZ_Asia_Aqtobe ("<+05>-5")
|
||||
#define TZ_Asia_Ashgabat ("<+05>-5")
|
||||
#define TZ_Asia_Atyrau ("<+05>-5")
|
||||
#define TZ_Asia_Baghdad ("<+03>-3")
|
||||
#define TZ_Asia_Bahrain ("<+03>-3")
|
||||
#define TZ_Asia_Baku ("<+04>-4")
|
||||
#define TZ_Asia_Bangkok ("<+07>-7")
|
||||
#define TZ_Asia_Barnaul ("<+07>-7")
|
||||
#define TZ_Asia_Beirut ("EET-2EEST,M3.5.0/0,M10.5.0/0")
|
||||
#define TZ_Asia_Bishkek ("<+06>-6")
|
||||
#define TZ_Asia_Brunei ("<+08>-8")
|
||||
#define TZ_Asia_Chita ("<+09>-9")
|
||||
#define TZ_Asia_Choibalsan ("<+08>-8")
|
||||
#define TZ_Asia_Colombo ("<+0530>-5:30")
|
||||
#define TZ_Asia_Damascus ("<+03>-3")
|
||||
#define TZ_Asia_Dhaka ("<+06>-6")
|
||||
#define TZ_Asia_Dili ("<+09>-9")
|
||||
#define TZ_Asia_Dubai ("<+04>-4")
|
||||
#define TZ_Asia_Dushanbe ("<+05>-5")
|
||||
#define TZ_Asia_Famagusta ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Asia_Gaza ("EET-2EEST,M3.4.4/50,M10.4.4/50")
|
||||
#define TZ_Asia_Hebron ("EET-2EEST,M3.4.4/50,M10.4.4/50")
|
||||
#define TZ_Asia_Ho_Chi_Minh ("<+07>-7")
|
||||
#define TZ_Asia_Hong_Kong ("HKT-8")
|
||||
#define TZ_Asia_Hovd ("<+07>-7")
|
||||
#define TZ_Asia_Irkutsk ("<+08>-8")
|
||||
#define TZ_Asia_Jakarta ("WIB-7")
|
||||
#define TZ_Asia_Jayapura ("WIT-9")
|
||||
#define TZ_Asia_Jerusalem ("IST-2IDT,M3.4.4/26,M10.5.0")
|
||||
#define TZ_Asia_Kabul ("<+0430>-4:30")
|
||||
#define TZ_Asia_Kamchatka ("<+12>-12")
|
||||
#define TZ_Asia_Karachi ("PKT-5")
|
||||
#define TZ_Asia_Kathmandu ("<+0545>-5:45")
|
||||
#define TZ_Asia_Khandyga ("<+09>-9")
|
||||
#define TZ_Asia_Kolkata ("IST-5:30")
|
||||
#define TZ_Asia_Krasnoyarsk ("<+07>-7")
|
||||
#define TZ_Asia_Kuala_Lumpur ("<+08>-8")
|
||||
#define TZ_Asia_Kuching ("<+08>-8")
|
||||
#define TZ_Asia_Kuwait ("<+03>-3")
|
||||
#define TZ_Asia_Macau ("CST-8")
|
||||
#define TZ_Asia_Magadan ("<+11>-11")
|
||||
#define TZ_Asia_Makassar ("WITA-8")
|
||||
#define TZ_Asia_Manila ("PST-8")
|
||||
#define TZ_Asia_Muscat ("<+04>-4")
|
||||
#define TZ_Asia_Nicosia ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Asia_Novokuznetsk ("<+07>-7")
|
||||
#define TZ_Asia_Novosibirsk ("<+07>-7")
|
||||
#define TZ_Asia_Omsk ("<+06>-6")
|
||||
#define TZ_Asia_Oral ("<+05>-5")
|
||||
#define TZ_Asia_Phnom_Penh ("<+07>-7")
|
||||
#define TZ_Asia_Pontianak ("WIB-7")
|
||||
#define TZ_Asia_Pyongyang ("KST-9")
|
||||
#define TZ_Asia_Qatar ("<+03>-3")
|
||||
#define TZ_Asia_Qyzylorda ("<+05>-5")
|
||||
#define TZ_Asia_Riyadh ("<+03>-3")
|
||||
#define TZ_Asia_Sakhalin ("<+11>-11")
|
||||
#define TZ_Asia_Samarkand ("<+05>-5")
|
||||
#define TZ_Asia_Seoul ("KST-9")
|
||||
#define TZ_Asia_Shanghai ("CST-8")
|
||||
#define TZ_Asia_Singapore ("<+08>-8")
|
||||
#define TZ_Asia_Srednekolymsk ("<+11>-11")
|
||||
#define TZ_Asia_Taipei ("CST-8")
|
||||
#define TZ_Asia_Tashkent ("<+05>-5")
|
||||
#define TZ_Asia_Tbilisi ("<+04>-4")
|
||||
#define TZ_Asia_Tehran ("<+0330>-3:30")
|
||||
#define TZ_Asia_Thimphu ("<+06>-6")
|
||||
#define TZ_Asia_Tokyo ("JST-9")
|
||||
#define TZ_Asia_Tomsk ("<+07>-7")
|
||||
#define TZ_Asia_Ulaanbaatar ("<+08>-8")
|
||||
#define TZ_Asia_Urumqi ("<+06>-6")
|
||||
#define TZ_Asia_UstmNera ("<+10>-10")
|
||||
#define TZ_Asia_Vientiane ("<+07>-7")
|
||||
#define TZ_Asia_Vladivostok ("<+10>-10")
|
||||
#define TZ_Asia_Yakutsk ("<+09>-9")
|
||||
#define TZ_Asia_Yangon ("<+0630>-6:30")
|
||||
#define TZ_Asia_Yekaterinburg ("<+05>-5")
|
||||
#define TZ_Asia_Yerevan ("<+04>-4")
|
||||
#define TZ_Atlantic_Azores ("<-01>1<+00>,M3.5.0/0,M10.5.0/1")
|
||||
#define TZ_Atlantic_Bermuda ("AST4ADT,M3.2.0,M11.1.0")
|
||||
#define TZ_Atlantic_Canary ("WET0WEST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Atlantic_Cape_Verde ("<-01>1")
|
||||
#define TZ_Atlantic_Faroe ("WET0WEST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Atlantic_Madeira ("WET0WEST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Atlantic_Reykjavik ("GMT0")
|
||||
#define TZ_Atlantic_South_Georgia ("<-02>2")
|
||||
#define TZ_Atlantic_Stanley ("<-03>3")
|
||||
#define TZ_Atlantic_St_Helena ("GMT0")
|
||||
#define TZ_Australia_Adelaide ("ACST-9:30ACDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Australia_Brisbane ("AEST-10")
|
||||
#define TZ_Australia_Broken_Hill ("ACST-9:30ACDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Australia_Currie ("AEST-10AEDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Australia_Darwin ("ACST-9:30")
|
||||
#define TZ_Australia_Eucla ("<+0845>-8:45")
|
||||
#define TZ_Australia_Hobart ("AEST-10AEDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Australia_Lindeman ("AEST-10")
|
||||
#define TZ_Australia_Lord_Howe ("<+1030>-10:30<+11>-11,M10.1.0,M4.1.0")
|
||||
#define TZ_Australia_Melbourne ("AEST-10AEDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Australia_Perth ("AWST-8")
|
||||
#define TZ_Australia_Sydney ("AEST-10AEDT,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Europe_Amsterdam ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Andorra ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Astrakhan ("<+04>-4")
|
||||
#define TZ_Europe_Athens ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Belgrade ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Berlin ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Bratislava ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Brussels ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Bucharest ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Budapest ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Busingen ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Chisinau ("EET-2EEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Copenhagen ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Dublin ("IST-1GMT0,M10.5.0,M3.5.0/1")
|
||||
#define TZ_Europe_Gibraltar ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Guernsey ("GMT0BST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Europe_Helsinki ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Isle_of_Man ("GMT0BST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Europe_Istanbul ("<+03>-3")
|
||||
#define TZ_Europe_Jersey ("GMT0BST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Europe_Kaliningrad ("EET-2")
|
||||
#define TZ_Europe_Kiev ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Kirov ("MSK-3")
|
||||
#define TZ_Europe_Lisbon ("WET0WEST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Europe_Ljubljana ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_London ("GMT0BST,M3.5.0/1,M10.5.0")
|
||||
#define TZ_Europe_Luxembourg ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Madrid ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Malta ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Mariehamn ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Minsk ("<+03>-3")
|
||||
#define TZ_Europe_Monaco ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Moscow ("MSK-3")
|
||||
#define TZ_Europe_Oslo ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Paris ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Podgorica ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Prague ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Riga ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Rome ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Samara ("<+04>-4")
|
||||
#define TZ_Europe_San_Marino ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Sarajevo ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Saratov ("<+04>-4")
|
||||
#define TZ_Europe_Simferopol ("MSK-3")
|
||||
#define TZ_Europe_Skopje ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Sofia ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Stockholm ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Tallinn ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Tirane ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Ulyanovsk ("<+04>-4")
|
||||
#define TZ_Europe_Uzhgorod ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Vaduz ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Vatican ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Vienna ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Vilnius ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Volgograd ("MSK-3")
|
||||
#define TZ_Europe_Warsaw ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Zagreb ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Europe_Zaporozhye ("EET-2EEST,M3.5.0/3,M10.5.0/4")
|
||||
#define TZ_Europe_Zurich ("CET-1CEST,M3.5.0,M10.5.0/3")
|
||||
#define TZ_Indian_Antananarivo ("EAT-3")
|
||||
#define TZ_Indian_Chagos ("<+06>-6")
|
||||
#define TZ_Indian_Christmas ("<+07>-7")
|
||||
#define TZ_Indian_Cocos ("<+0630>-6:30")
|
||||
#define TZ_Indian_Comoro ("EAT-3")
|
||||
#define TZ_Indian_Kerguelen ("<+05>-5")
|
||||
#define TZ_Indian_Mahe ("<+04>-4")
|
||||
#define TZ_Indian_Maldives ("<+05>-5")
|
||||
#define TZ_Indian_Mauritius ("<+04>-4")
|
||||
#define TZ_Indian_Mayotte ("EAT-3")
|
||||
#define TZ_Indian_Reunion ("<+04>-4")
|
||||
#define TZ_Pacific_Apia ("<+13>-13")
|
||||
#define TZ_Pacific_Auckland ("NZST-12NZDT,M9.5.0,M4.1.0/3")
|
||||
#define TZ_Pacific_Bougainville ("<+11>-11")
|
||||
#define TZ_Pacific_Chatham ("<+1245>-12:45<+1345>,M9.5.0/2:45,M4.1.0/3:45")
|
||||
#define TZ_Pacific_Chuuk ("<+10>-10")
|
||||
#define TZ_Pacific_Easter ("<-06>6<-05>,M9.1.6/22,M4.1.6/22")
|
||||
#define TZ_Pacific_Efate ("<+11>-11")
|
||||
#define TZ_Pacific_Enderbury ("<+13>-13")
|
||||
#define TZ_Pacific_Fakaofo ("<+13>-13")
|
||||
#define TZ_Pacific_Fiji ("<+12>-12")
|
||||
#define TZ_Pacific_Funafuti ("<+12>-12")
|
||||
#define TZ_Pacific_Galapagos ("<-06>6")
|
||||
#define TZ_Pacific_Gambier ("<-09>9")
|
||||
#define TZ_Pacific_Guadalcanal ("<+11>-11")
|
||||
#define TZ_Pacific_Guam ("ChST-10")
|
||||
#define TZ_Pacific_Honolulu ("HST10")
|
||||
#define TZ_Pacific_Kiritimati ("<+14>-14")
|
||||
#define TZ_Pacific_Kosrae ("<+11>-11")
|
||||
#define TZ_Pacific_Kwajalein ("<+12>-12")
|
||||
#define TZ_Pacific_Majuro ("<+12>-12")
|
||||
#define TZ_Pacific_Marquesas ("<-0930>9:30")
|
||||
#define TZ_Pacific_Midway ("SST11")
|
||||
#define TZ_Pacific_Nauru ("<+12>-12")
|
||||
#define TZ_Pacific_Niue ("<-11>11")
|
||||
#define TZ_Pacific_Norfolk ("<+11>-11<+12>,M10.1.0,M4.1.0/3")
|
||||
#define TZ_Pacific_Noumea ("<+11>-11")
|
||||
#define TZ_Pacific_Pago_Pago ("SST11")
|
||||
#define TZ_Pacific_Palau ("<+09>-9")
|
||||
#define TZ_Pacific_Pitcairn ("<-08>8")
|
||||
#define TZ_Pacific_Pohnpei ("<+11>-11")
|
||||
#define TZ_Pacific_Port_Moresby ("<+10>-10")
|
||||
#define TZ_Pacific_Rarotonga ("<-10>10")
|
||||
#define TZ_Pacific_Saipan ("ChST-10")
|
||||
#define TZ_Pacific_Tahiti ("<-10>10")
|
||||
#define TZ_Pacific_Tarawa ("<+12>-12")
|
||||
#define TZ_Pacific_Tongatapu ("<+13>-13")
|
||||
#define TZ_Pacific_Wake ("<+12>-12")
|
||||
#define TZ_Pacific_Wallis ("<+12>-12")
|
||||
#define TZ_Etc_GMT ("GMT0")
|
||||
#define TZ_Etc_GMTm0 ("GMT0")
|
||||
#define TZ_Etc_GMTm1 ("<+01>-1")
|
||||
#define TZ_Etc_GMTm2 ("<+02>-2")
|
||||
#define TZ_Etc_GMTm3 ("<+03>-3")
|
||||
#define TZ_Etc_GMTm4 ("<+04>-4")
|
||||
#define TZ_Etc_GMTm5 ("<+05>-5")
|
||||
#define TZ_Etc_GMTm6 ("<+06>-6")
|
||||
#define TZ_Etc_GMTm7 ("<+07>-7")
|
||||
#define TZ_Etc_GMTm8 ("<+08>-8")
|
||||
#define TZ_Etc_GMTm9 ("<+09>-9")
|
||||
#define TZ_Etc_GMTm10 ("<+10>-10")
|
||||
#define TZ_Etc_GMTm11 ("<+11>-11")
|
||||
#define TZ_Etc_GMTm12 ("<+12>-12")
|
||||
#define TZ_Etc_GMTm13 ("<+13>-13")
|
||||
#define TZ_Etc_GMTm14 ("<+14>-14")
|
||||
#define TZ_Etc_GMT0 ("GMT0")
|
||||
#define TZ_Etc_GMTp0 ("GMT0")
|
||||
#define TZ_Etc_GMTp1 ("<-01>1")
|
||||
#define TZ_Etc_GMTp2 ("<-02>2")
|
||||
#define TZ_Etc_GMTp3 ("<-03>3")
|
||||
#define TZ_Etc_GMTp4 ("<-04>4")
|
||||
#define TZ_Etc_GMTp5 ("<-05>5")
|
||||
#define TZ_Etc_GMTp6 ("<-06>6")
|
||||
#define TZ_Etc_GMTp7 ("<-07>7")
|
||||
#define TZ_Etc_GMTp8 ("<-08>8")
|
||||
#define TZ_Etc_GMTp9 ("<-09>9")
|
||||
#define TZ_Etc_GMTp10 ("<-10>10")
|
||||
#define TZ_Etc_GMTp11 ("<-11>11")
|
||||
#define TZ_Etc_GMTp12 ("<-12>12")
|
||||
#define TZ_Etc_UCT ("UTC0")
|
||||
#define TZ_Etc_UTC ("UTC0")
|
||||
#define TZ_Etc_Greenwich ("GMT0")
|
||||
#define TZ_Etc_Universal ("UTC0")
|
||||
#define TZ_Etc_Zulu ("UTC0")
|
||||
@@ -60,45 +60,3 @@ SemaphoreHandle_t __get_freertos_mutex_for_ptr(mutex_t *m, bool recursive) {
|
||||
}
|
||||
return nullptr; // Need to make space for more mutex maps!
|
||||
}
|
||||
|
||||
|
||||
// The HW Random code needs a precise sleep_until() in order to assure it
|
||||
// grabs the ROSC bit when it wants. Unfortunately, under FreeRTOS the
|
||||
// sleep_until() becomes imprecise and the "did I get the bit when I wanted"
|
||||
// check in the pico_rand code always fails and you get an infinite loop.
|
||||
|
||||
// This block wraps the 2 get_rand calls to set a flag to convert
|
||||
// sleep_until() (which can do a task swap and cause bad timing) into a
|
||||
// busy wait.
|
||||
|
||||
extern "C" {
|
||||
static bool __inRand = false;
|
||||
|
||||
extern uint64_t __real_get_rand_64();
|
||||
uint64_t __wrap_get_rand_64() {
|
||||
if (__isFreeRTOS) {
|
||||
rp2040.idleOtherCore();
|
||||
__inRand = true;
|
||||
auto r = __real_get_rand_64();
|
||||
__inRand = false;
|
||||
rp2040.resumeOtherCore();
|
||||
return r;
|
||||
} else {
|
||||
return __real_get_rand_64();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t __wrap_get_rand_32() {
|
||||
return (uint32_t) __wrap_get_rand_64();
|
||||
}
|
||||
|
||||
extern void __real_sleep_until(absolute_time_t t);
|
||||
void __wrap_sleep_until(absolute_time_t t) {
|
||||
if (__inRand) {
|
||||
busy_wait_until(t);
|
||||
} else {
|
||||
__real_sleep_until(t);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,15 +29,21 @@
|
||||
#include <pico/cyw43_arch.h>
|
||||
#include <pico/mutex.h>
|
||||
#include <sys/lock.h>
|
||||
#include "_xoshiro.h"
|
||||
|
||||
extern void ethernet_arch_lwip_begin() __attribute__((weak));
|
||||
extern void ethernet_arch_lwip_end() __attribute__((weak));
|
||||
extern void ethernet_arch_lwip_gpio_mask() __attribute__((weak));
|
||||
extern void ethernet_arch_lwip_gpio_unmask() __attribute__((weak));
|
||||
|
||||
auto_init_recursive_mutex(__lwipMutex); // Only for case with no Ethernet or PicoW, but still doing LWIP (PPP?)
|
||||
|
||||
class LWIPMutex {
|
||||
public:
|
||||
LWIPMutex() {
|
||||
if (ethernet_arch_lwip_gpio_mask) {
|
||||
ethernet_arch_lwip_gpio_mask();
|
||||
}
|
||||
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
|
||||
if (rp2040.isPicoW()) {
|
||||
cyw43_arch_lwip_begin();
|
||||
@@ -55,26 +61,36 @@ public:
|
||||
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
|
||||
if (rp2040.isPicoW()) {
|
||||
cyw43_arch_lwip_end();
|
||||
return;
|
||||
} else {
|
||||
#endif
|
||||
if (ethernet_arch_lwip_end) {
|
||||
ethernet_arch_lwip_end();
|
||||
} else {
|
||||
recursive_mutex_exit(&__lwipMutex);
|
||||
}
|
||||
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
|
||||
}
|
||||
#endif
|
||||
if (ethernet_arch_lwip_end) {
|
||||
ethernet_arch_lwip_end();
|
||||
} else {
|
||||
recursive_mutex_exit(&__lwipMutex);
|
||||
if (ethernet_arch_lwip_gpio_unmask) {
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
static XoshiroCpp::Xoshiro256PlusPlus *_lwip_rng = nullptr;
|
||||
// Random number generator for LWIP
|
||||
unsigned long __lwip_rand() {
|
||||
return (unsigned long)(*_lwip_rng)();
|
||||
}
|
||||
|
||||
// Avoid calling lwip_init multiple times
|
||||
extern void __real_lwip_init();
|
||||
void __wrap_lwip_init() {
|
||||
static bool initted = false;
|
||||
if (!initted) {
|
||||
if (!_lwip_rng) {
|
||||
_lwip_rng = new XoshiroCpp::Xoshiro256PlusPlus(get_rand_64());
|
||||
__real_lwip_init();
|
||||
initted = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-1
@@ -27,6 +27,7 @@
|
||||
RP2040 rp2040;
|
||||
extern "C" {
|
||||
volatile bool __otherCoreIdled = false;
|
||||
uint32_t* core1_separate_stack_address = nullptr;
|
||||
};
|
||||
|
||||
extern void setup();
|
||||
@@ -38,12 +39,14 @@ extern void startFreeRTOS() __attribute__((weak));
|
||||
bool __isFreeRTOS;
|
||||
volatile bool __freeRTOSinitted;
|
||||
|
||||
extern void __EnableBluetoothDebug(Print &);
|
||||
|
||||
// Weak empty variant initialization. May be redefined by variant files.
|
||||
void initVariant() __attribute__((weak));
|
||||
void initVariant() { }
|
||||
|
||||
// Optional 2nd core setup and loop
|
||||
bool core1_separate_stack __attribute__((weak)) = false;
|
||||
extern void setup1() __attribute__((weak));
|
||||
extern void loop1() __attribute__((weak));
|
||||
extern "C" void main1() {
|
||||
@@ -117,6 +120,9 @@ extern "C" int main() {
|
||||
#if defined DEBUG_RP2040_PORT
|
||||
if (!__isFreeRTOS) {
|
||||
DEBUG_RP2040_PORT.begin(115200);
|
||||
#if (defined(ENABLE_BLUETOOTH) || defined(ENABLE_BLE)) && defined(DEBUG_RP2040_BLUETOOTH)
|
||||
__EnableBluetoothDebug(DEBUG_RP2040_PORT);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -132,7 +138,12 @@ extern "C" int main() {
|
||||
if (!__isFreeRTOS) {
|
||||
if (setup1 || loop1) {
|
||||
delay(1); // Needed to make Picoprobe upload start 2nd core
|
||||
multicore_launch_core1(main1);
|
||||
if (core1_separate_stack) {
|
||||
core1_separate_stack_address = (uint32_t*)malloc(0x2000);
|
||||
multicore_launch_core1_with_stack(main1, core1_separate_stack_address, 0x2000);
|
||||
} else {
|
||||
multicore_launch_core1(main1);
|
||||
}
|
||||
}
|
||||
setup();
|
||||
while (true) {
|
||||
|
||||
+39
-13
@@ -33,7 +33,9 @@
|
||||
|
||||
extern "C" int errno;
|
||||
|
||||
extern "C" ssize_t _write(int fd, const void *buf, size_t count) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
ssize_t _write(int fd, const void *buf, size_t count) {
|
||||
#if defined DEBUG_RP2040_PORT
|
||||
(void) fd;
|
||||
return DEBUG_RP2040_PORT.write((const char *)buf, count);
|
||||
@@ -45,7 +47,9 @@ extern "C" ssize_t _write(int fd, const void *buf, size_t count) {
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" int _chown(const char *path, uid_t owner, gid_t group) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _chown(const char *path, uid_t owner, gid_t group) {
|
||||
(void) path;
|
||||
(void) owner;
|
||||
(void) group;
|
||||
@@ -53,7 +57,9 @@ extern "C" int _chown(const char *path, uid_t owner, gid_t group) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _close(int fd) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _close(int fd) {
|
||||
(void) fd;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
@@ -72,7 +78,9 @@ extern "C" int _fork(void) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _fstat(int fd, struct stat *st) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _fstat(int fd, struct stat *st) {
|
||||
(void) fd;
|
||||
(void) st;
|
||||
errno = ENOSYS;
|
||||
@@ -115,7 +123,9 @@ extern "C" void __setSystemTime(unsigned long long sec, unsigned long usec) {
|
||||
__timedelta_us = newnow_us - now_us;
|
||||
}
|
||||
|
||||
extern "C" int _isatty(int file) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _isatty(int file) {
|
||||
(void) file;
|
||||
errno = ENOSYS;
|
||||
return 0;
|
||||
@@ -128,14 +138,18 @@ extern "C" int _kill(int pid, int sig) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _link(char *existing, char *newlink) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _link(char *existing, char *newlink) {
|
||||
(void) existing;
|
||||
(void) newlink;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _lseek(int file, int ptr, int dir) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _lseek(int file, int ptr, int dir) {
|
||||
(void) file;
|
||||
(void) ptr;
|
||||
(void) dir;
|
||||
@@ -143,7 +157,9 @@ extern "C" int _lseek(int file, int ptr, int dir) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _open(char *file, int flags, int mode) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _open(char *file, int flags, int mode) {
|
||||
(void) file;
|
||||
(void) flags;
|
||||
(void) mode;
|
||||
@@ -151,7 +167,9 @@ extern "C" int _open(char *file, int flags, int mode) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _read(int file, char *ptr, int len) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _read(int file, char *ptr, int len) {
|
||||
(void) file;
|
||||
(void) ptr;
|
||||
(void) len;
|
||||
@@ -159,7 +177,9 @@ extern "C" int _read(int file, char *ptr, int len) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _readlink(const char *path, char *buf, size_t bufsize) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _readlink(const char *path, char *buf, size_t bufsize) {
|
||||
(void) path;
|
||||
(void) buf;
|
||||
(void) bufsize;
|
||||
@@ -167,14 +187,18 @@ extern "C" int _readlink(const char *path, char *buf, size_t bufsize) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _stat(const char *file, struct stat *st) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _stat(const char *file, struct stat *st) {
|
||||
(void) file;
|
||||
(void) st;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _symlink(const char *path1, const char *path2) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _symlink(const char *path1, const char *path2) {
|
||||
(void) path1;
|
||||
(void) path2;
|
||||
errno = ENOSYS;
|
||||
@@ -187,7 +211,9 @@ extern "C" clock_t _times(struct tms *buf) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern "C" int _unlink(char *name) {
|
||||
extern "C"
|
||||
__attribute((weak))
|
||||
int _unlink(char *name) {
|
||||
(void) name;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
|
||||
@@ -66,10 +66,14 @@ typedef enum {
|
||||
} wl_status_t;
|
||||
|
||||
/* Encryption modes */
|
||||
enum wl_enc_type { /* Values map to 802.11 encryption suites... */
|
||||
enum wl_enc_type { /* Values map to 802.11 Cipher Algorithm Identifier */
|
||||
ENC_TYPE_WEP = 5,
|
||||
ENC_TYPE_TKIP = 2,
|
||||
ENC_TYPE_WPA = ENC_TYPE_TKIP,
|
||||
ENC_TYPE_CCMP = 4,
|
||||
ENC_TYPE_WPA2 = ENC_TYPE_CCMP,
|
||||
ENC_TYPE_GCMP = 6,
|
||||
ENC_TYPE_WPA3 = ENC_TYPE_GCMP,
|
||||
/* ... except these two, 7 and 8 are reserved in 802.11-2007 */
|
||||
ENC_TYPE_NONE = 7,
|
||||
ENC_TYPE_AUTO = 8,
|
||||
|
||||
+4
-2
@@ -30,7 +30,7 @@ Analog Outputs
|
||||
--------------
|
||||
The RP2040 does not have any onboard DACs, so analog outputs are
|
||||
simulated using the standard method of using pulse width modulation
|
||||
(PWM) using the RP20400's hardware PWM units.
|
||||
(PWM) using the RP2040's hardware PWM units.
|
||||
|
||||
While up to 16 PWM channels can be generated, they are not independent
|
||||
and there are significant restrictions as to allowed pins in parallel.
|
||||
@@ -40,7 +40,9 @@ Analog Output Restrictions
|
||||
--------------------------
|
||||
|
||||
The PWM generator source clock restricts the legal combinations of
|
||||
frequency and ranges. For example, at 1MHz only about 6 bits of range
|
||||
frequency and ranges.
|
||||
At a CPU frequency of 133MHz, the 16 bit maximum range decreases by 1 bit for every doubling of the default PWM frequency of 1 kHz.
|
||||
For example, at 1MHz only about 6 bits of range
|
||||
are possible. When you define an ``analogWriteFreq`` and ``analogWriteRange``
|
||||
that can't be fulfilled by the hardware, the frequency will be preserved
|
||||
but the accuracy (range) will be reduced automatically. Your code will
|
||||
|
||||
@@ -13,7 +13,7 @@ Similar to the `BearSSL::WiFiClientSecure` method, sets the receive and transmit
|
||||
Setting Server Certificates
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
TLS servers require a certificate identifying itself and containing its public key, and a private key they will use to encrypt information with. The application author is responsible for generating this certificate and key, either using a self-signed generator or using a commercial certification authority. **Do not re-use the certificates included in the examples provided.**
|
||||
TLS servers require a certificate identifying itself and containing its public key, and a private key they will use to encrypt information with. The application author is responsible for generating this certificate and key, either using a self-signed generator or using a commercial certification authority. **Do not reuse the certificates included in the examples provided.**
|
||||
|
||||
This example command will generate a RSA 2048-bit key and certificate:
|
||||
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'3.6.0'
|
||||
version = u'3.7.1'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'3.6.0'
|
||||
release = u'3.7.1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
+15
-2
@@ -86,6 +86,19 @@ Pico may not have enough time to service the Ethernet port before the timer fire
|
||||
leading to a lock up and hang.
|
||||
|
||||
|
||||
Using Interrupt-Driven Handling
|
||||
-------------------------------
|
||||
|
||||
The WizNet and ENC28J60 devices support generating an interrupt when a packet is received,
|
||||
removing the need for polling and decreasing latency. Simply specify the SPI object to use and the
|
||||
interrupt pin when instantiating the Ethernet object:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#include <W5100lwIP.h>
|
||||
Wiznet5100lwIP eth(SS /* Chip Select*/, SPI /* SPI interface */, 17 /* Interrupt GPIO */ );
|
||||
|
||||
|
||||
Adjusting SPI Speed
|
||||
-------------------
|
||||
|
||||
@@ -114,12 +127,12 @@ For example, to set the W5500 to use a 30MHZ clock:
|
||||
Using the WIZnet W5100S-EVB-Pico
|
||||
--------------------------------
|
||||
|
||||
You can use the onboard Ethernet chip with these drivers by utilizing the following options:
|
||||
You can use the onboard Ethernet chip with these drivers, in interrupt mode, by utilizing the following options:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
#include <W5100lwIP.h>
|
||||
Wiznet5100lwIP eth(17); // Note chip select is **17**
|
||||
Wiznet5100lwIP eth(17, SPI, 21); // Note chip select is **17**
|
||||
|
||||
void setup() {
|
||||
// Set SPI to the onboard Wiznet chip
|
||||
|
||||
+28
-25
@@ -18,12 +18,12 @@ The following diagram shows the flash layout used in Arduino-Pico:
|
||||
|
||||
::
|
||||
|
||||
|---------------------|-------------|----|
|
||||
^ ^ ^
|
||||
Sketch File system EEPROM
|
||||
|----|---------------------|-------------|----|
|
||||
^ ^ ^ ^
|
||||
OTA Sketch File system EEPROM
|
||||
|
||||
The file system size is configurable via the IDE menus, rom 64k up to 15MB
|
||||
(assuming you have an RP2040 boad with that much flash)
|
||||
The file system size is configurable via the IDE menus, from 64k up to 15MB
|
||||
(assuming you have an RP2040 board with that much flash)
|
||||
|
||||
**Note:** to use any of file system functions in the sketch, add the
|
||||
following include to the sketch:
|
||||
@@ -38,14 +38,14 @@ following include to the sketch:
|
||||
Compatible Filesystem APIs
|
||||
--------------------------
|
||||
|
||||
LittleFS is an onboard filesystem that sets asidesome program flash for
|
||||
LittleFS is an onboard filesystem that sets aside some program flash for
|
||||
use as a filesystem without requiring any external hardware.
|
||||
|
||||
SDFS is a filesystem for SD cards, based on [SdFat 2.0](https://github.com/earlephilhower/ESP8266SdFat).
|
||||
It supports FAT16 and FAT32 formatted cards, and requires an external
|
||||
SD card reader.
|
||||
|
||||
SD is the Arduino supported, somewhat old and limited SD card filesystem.
|
||||
SD is the Arduino-supported, somewhat old and limited SD card filesystem.
|
||||
It is recommended to use SDFS for new applications instead of SD.
|
||||
|
||||
All three of these filesystems can open and manipulate ``File`` and ``Dir``
|
||||
@@ -75,22 +75,28 @@ Uploading Files to the LittleFS File System
|
||||
menu item to **Tools** menu for uploading the contents of sketch data
|
||||
directory into a new LittleFS flash file system.
|
||||
|
||||
**IDE 1.x**
|
||||
|
||||
- Download the tool: https://github.com/earlephilhower/arduino-pico-littlefs-plugin/releases
|
||||
- In your Arduino sketchbook directory, create ``tools`` directory if
|
||||
it doesn't exist yet.
|
||||
- Unpack the tool into ``tools`` directory (the path will look like
|
||||
``<home_dir>/Arduino/tools/PicoLittleFS/tool/picolittlefs.jar``)
|
||||
- In your Arduino sketchbook directory, create ``tools`` directory if it doesn't exist yet.
|
||||
- Unpack the tool into ``tools`` directory (the path will look like ``<home_dir>/Arduino/tools/PicoLittleFS/tool/picolittlefs.jar``)
|
||||
If upgrading, overwrite the existing JAR file with the newer version.
|
||||
- Restart Arduino IDE.
|
||||
- Open a sketch (or create a new one and save it).
|
||||
- Go to sketch directory (choose Sketch > Show Sketch Folder).
|
||||
- Create a directory named ``data`` and any files you want in the file
|
||||
system there.
|
||||
- Create a directory named ``data`` and any files you want in the file system there.
|
||||
- Make sure you have selected a board, port, and closed Serial Monitor.
|
||||
- Double check theSerial Monitor is closed. Uploads will fail if the Serial
|
||||
Monitor has control of the serial port.
|
||||
- Select ``Tools > Pico LittleFS Data Upload``. This should start
|
||||
uploading the files into the flash file system.
|
||||
- Double check the Serial Monitor is closed. Uploads will fail if the Serial Monitor has control of the serial port.
|
||||
- Select ``Tools > Pico LittleFS Data Upload``. This should start uploading the files into the flash file system.
|
||||
|
||||
**IDE 2.x**
|
||||
|
||||
- Download the new tool: https://github.com/earlephilhower/arduino-littlefs-upload/releases
|
||||
- Exit the IDE, if running
|
||||
- Copy the VSIX file manually to (Linux/Mac) ``~/.arduinoIDE/plugins/`` (you may need to make this directory yourself beforehand) or to (Windows) ``C:\Users\<username>\.arduinoIDE\``
|
||||
- Restart the IDE
|
||||
- Double check the Serial Monitor is closed. Uploads will fail if the Serial Monitor has control of the serial port.
|
||||
- Enter ``[Ctrl]`` + ``[Shift]`` + ``[P]`` to bring up the command palette, then select/type ``Upload LittleFS to Pico/ESP8266``
|
||||
|
||||
SD Library Information
|
||||
----------------------
|
||||
@@ -131,7 +137,7 @@ before mounting. All filesystems have their own ``*Config`` (i.e.
|
||||
All filesystems allow explicitly enabling/disabling formatting when
|
||||
mounts fail. If you do not call this ``setConfig`` method before
|
||||
perforing ``begin()``, you will get the filesystem's default
|
||||
behavior and configuration. By default, SPIFFS will autoformat the
|
||||
behavior and configuration. By default, LittleFS will autoformat the
|
||||
filesystem if it cannot mount it, while SDFS will not.
|
||||
|
||||
begin
|
||||
@@ -144,11 +150,10 @@ begin
|
||||
|
||||
This method mounts file system. It must be called before any
|
||||
other FS APIs are used. Returns *true* if file system was mounted
|
||||
successfully, false otherwise. With no options it will format SPIFFS
|
||||
if it is unable to mount it on the first try.
|
||||
successfully, false otherwise.
|
||||
|
||||
Note that LittleFS will automatically format the filesystem
|
||||
if one is not detected. This is configurable via ``setConfig``
|
||||
if one is not detected. This is configurable via ``setConfig``.
|
||||
|
||||
end
|
||||
~~~
|
||||
@@ -181,8 +186,8 @@ open
|
||||
|
||||
Opens a file. ``path`` should be an absolute path starting with a slash
|
||||
(e.g. ``/dir/filename.txt``). ``mode`` is a string specifying access
|
||||
mode. It can be one of "r", "w", "a", "r+", "w+", "a+". Meaning of these
|
||||
modes is the same as for ``fopen`` C function.
|
||||
mode. It can be one of "r", "w", "a", "r+", "w+", "a+". The meaning of these
|
||||
modes is the same as for the ``fopen`` C function.
|
||||
|
||||
::
|
||||
|
||||
@@ -258,8 +263,6 @@ openDir
|
||||
or LittleFS.openDir(path)
|
||||
|
||||
Opens a directory given its absolute path. Returns a *Dir* object.
|
||||
Please note the previous discussion on the difference in behavior between
|
||||
LittleFS and SPIFFS for this call.
|
||||
|
||||
remove
|
||||
~~~~~~
|
||||
|
||||
+3
-7
@@ -1,15 +1,11 @@
|
||||
IDE Menus
|
||||
=========
|
||||
|
||||
Model
|
||||
Board
|
||||
-----
|
||||
Use the boards menu to select your model of RP2040 board. There will be two
|
||||
options: `Boardname` and `Boardname (Picoprobe)`. If you want to use a
|
||||
Picoprobe to upload your sketches and not the default automatic UF2 upload,
|
||||
use the `(Picoprobe)` option, otherwise use the normal name. No functional
|
||||
or code changes are done because of this.
|
||||
Use the boards menu to select your model of RP2040 board.
|
||||
|
||||
There is also a `Generic` board which allows you to individually select
|
||||
There is also a `Generic RP2040` board which allows you to individually select
|
||||
things such as flash size or boot2 flash type. Use this if your board isn't
|
||||
yet fully supported and isn't working with the normal `Raspberry Pi Pico`
|
||||
option.
|
||||
|
||||
+5
-11
@@ -26,9 +26,7 @@ Arduino IDE Installation Warning
|
||||
the actual Arduino application because it has issues detecting attached Pico
|
||||
boards. Use the "Windows ZIP" or plain "Windows" executable (EXE) download
|
||||
direct from https://arduino.cc. and allow it to install any device drivers
|
||||
it suggests. Otherwise the Pico board may not be detected. Also, if trying
|
||||
out the 2.0 beta Arduino please install the release 1.8 version beforehand
|
||||
to ensure needed device drivers are present.
|
||||
it suggests. Otherwise the Pico board may not be detected.
|
||||
|
||||
**Note for Linux Users**: If you installed the Arduino IDE using Flatpak, which
|
||||
is common in Pop!_OS, Fedora, and Mint, among others, you may need to configure
|
||||
@@ -141,11 +139,13 @@ Uploading Filesystem Images
|
||||
---------------------------
|
||||
The onboard flash filesystem for the Pico, LittleFS, lets you upload a filesystem image from the sketch directory for your sketch to use. Download the needed plugin from
|
||||
|
||||
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/releases
|
||||
* `IDE 1.x`: https://github.com/earlephilhower/arduino-pico-littlefs-plugin/releases
|
||||
* `IDE 2.x`: https://github.com/earlephilhower/arduino-littlefs-upload/releases
|
||||
|
||||
To install, follow the directions in
|
||||
|
||||
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/blob/master/README.md
|
||||
* `IDE 1.x`: https://github.com/earlephilhower/arduino-pico-littlefs-plugin/blob/master/README.md
|
||||
* `IDE 2.x`: https://github.com/earlephilhower/arduino-littlefs-upload/blob/main/README.md
|
||||
|
||||
For detailed usage information, please check the repo documentation available at
|
||||
|
||||
@@ -159,12 +159,6 @@ So for the first sketch you will need to rebuild (with the ``Upload Method->Pico
|
||||
|
||||
After the initial upload, as long as the running binary was built using the ``Picotool`` upload method, then the normal upload process should work.
|
||||
|
||||
Under MacOS, it may be necessary to install the USB support libraries from a command terminal before the ``Picotool`` upload method can be used:
|
||||
|
||||
.. code::
|
||||
|
||||
brew install libusb
|
||||
|
||||
For Ubuntu and other Linux operating systems you may need to add the following lines to a new `udev` config file(``99-picotool.rules``) to allow normal users to access the special USB device the Pico exports:
|
||||
|
||||
.. code::
|
||||
|
||||
@@ -16,6 +16,22 @@ not necessarily simultaneously!).
|
||||
See the ``Multicore.ino`` example in the ``rp2040`` example directory for a
|
||||
quick introduction.
|
||||
|
||||
Stack Sizes
|
||||
-----------
|
||||
|
||||
When the Pico is running in single core mode, core 0 has the full 8KB of stack
|
||||
space available to it. When using multicore ``setup1``/``loop1`` the 8KB is split
|
||||
into two 4K stacks, one per core. It is possible for core 0's stack to overwrite
|
||||
core 1's stack in this case, if you go beyond the 4K limitation.
|
||||
|
||||
To allocate a separate 8K stack for core 1, resulting in 8K stacks being available
|
||||
for both cores, simply define the following variable in your sketch and set it
|
||||
to ``true``:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
bool core1_separate_stack = true;
|
||||
|
||||
Pausing Cores
|
||||
-------------
|
||||
|
||||
|
||||
+3
-4
@@ -191,7 +191,7 @@ Debug Level
|
||||
Done again by directly adding the needed `build
|
||||
flags <https://github.com/earlephilhower/arduino-pico/blob/05356da2c5552413a442f742e209c6fa92823666/boards.txt#L104-L114>`__.
|
||||
When wanting to define multiple build flags, they must be accumulated in
|
||||
either a sing line or a newline-separated expression.
|
||||
either a single line or a newline-separated expression.
|
||||
|
||||
.. code:: ini
|
||||
|
||||
@@ -363,7 +363,7 @@ For further information on customizing debug options, like the initial breakpoin
|
||||
You can obtain precompiled binaries from `here <https://github.com/blackmagic-debug/blackmagic/issues/1364#issuecomment-1503372723>`__. A flashing guide is available `here <https://primalcortex.wordpress.com/2017/06/13/building-a-black-magic-debug-probe/>`__. You then have to configure the target serial port ("GDB port") in your project per `documentation <https://docs.platformio.org/en/latest/plus/debug-tools/blackmagic.html#debugging-tool-blackmagic>`__.
|
||||
|
||||
.. note::
|
||||
For the pico-debug (`download <https://github.com/majbthrd/pico-debug/releases>`__) debugging way, *which needs to no additional debug probe*, add this snippet to your ``platformio.ini`` and follow the given procedure:
|
||||
For the pico-debug (`download <https://github.com/majbthrd/pico-debug/releases>`__) debugging way, *which needs no additional debug probe*, add this snippet to your ``platformio.ini`` and follow the given procedure:
|
||||
|
||||
.. code:: ini
|
||||
|
||||
@@ -397,5 +397,4 @@ The task "Build Filesystem Image" will take all files in the data directory and
|
||||
The task "Upload Filesystem Image" will upload the filesystem image to the Pico via the specified ``upload_protocol``.
|
||||
|
||||
.. note::
|
||||
Set the space available for the filesystem in the ``platformio.ini`` using e.g., ``board_build.filesystem_size = 0.5m``, or filesystem
|
||||
creation will fail!
|
||||
Set the space available for the filesystem in the ``platformio.ini`` using e.g., ``board_build.filesystem_size = 0.5m``, or filesystem creation will fail!
|
||||
|
||||
@@ -55,3 +55,13 @@ void Serial.ignoreFlowControl(bool ignore)
|
||||
In some cases, the target application will not assert the DTR virtual line, thus preventing writing operations to succeed.
|
||||
|
||||
For this reason, the SerialUSB::ignoreFlowControl() method disables the connection's state verification, enabling the program to write on the port, even though the data might be lost.
|
||||
|
||||
bool Serial.dtr()
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Returns the current state of the DTR virtual line. A USB CDC host (such as the Arduino serial monitor) typically raises the DTR pin when opening the device, and may lower it when closing the device.
|
||||
|
||||
bool Serial.rts()
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Returns the current state of the RTS virtual line.
|
||||
|
||||
+1
-1
@@ -40,6 +40,6 @@ in order to consunme the received data and provide data to transmit.
|
||||
|
||||
|
||||
Examples
|
||||
========
|
||||
~~~~~~~~
|
||||
|
||||
See the SPItoMyself example for a complete Master and Slave application.
|
||||
|
||||
+16
-1
@@ -14,13 +14,28 @@ from the IDE.
|
||||
The Arduino-Pico core includes ported versions of the basic Arduino
|
||||
``Keyboard``, ``Mouse`` and ``Joystick`` libraries. These libraries
|
||||
allow you to emulate a keyboard, a gamepad or mouse (or all together)
|
||||
with the Pico in your sketches.
|
||||
with the Pico in your sketches. These libraries only are available
|
||||
when using the built-in USB, not the Adafruit library.
|
||||
|
||||
See the examples and Arduino Reference at
|
||||
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
|
||||
and
|
||||
https://www.arduino.cc/reference/en/language/functions/usb/mouse
|
||||
|
||||
HID Polling Interval
|
||||
--------------------
|
||||
By default, HID devices will request to be polled every 10ms (i.e. 100x
|
||||
per second). If you have a higher performance need, you can override
|
||||
this value by creating a global variable in your main application, set
|
||||
to the polling period:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
int usb_hid_poll_interval = 1; // Set HID poll interval to 1ms (1kHz)
|
||||
void setup() {
|
||||
....
|
||||
}
|
||||
|
||||
Adafruit TinyUSB Arduino Support
|
||||
--------------------------------
|
||||
Examples are provided in the Adafruit_TinyUSB_Arduino for the more
|
||||
|
||||
+3
-1
@@ -42,7 +42,9 @@ Please note that WiFi on the Pico W is a work-in-progress and there are some imp
|
||||
|
||||
* Multicore is supported, but only core 0 may run ``WiFi`` related code.
|
||||
|
||||
* FreeRTOS is supported only on core 0 and from within ``setup`` and ``loop`, not tasks, due to the requirement for a very different LWIP implementation. PRs always appreciated!
|
||||
* FreeRTOS is supported only on core 0 and from within ``setup`` and ``loop``, not tasks, due to the requirement for a very different LWIP implementation. PRs always appreciated!
|
||||
|
||||
* LEAmDNS (``MDNS``) is not supported in FreeRTOS due to internal IRQ-time memory allocations.
|
||||
|
||||
The WiFi library borrows much work from the `ESP8266 Arduino Core <https://github.com/esp8266/Arduino>`__ , especially the ``WiFiClient`` and ``WiFiServer`` classes.
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ NTP allows the Pico to set its internal clock using the internet, and is
|
||||
required for secure connections because the certificates used have valid
|
||||
date stamps.
|
||||
|
||||
After ``WiFi.begin()`` use ``NTP.begin(s1)`` or ``NTP,begin(s1, s2)`` to
|
||||
After ``WiFi.begin()`` use ``NTP.begin(s1)`` or ``NTP.begin(s1, s2)`` to
|
||||
use one or two NTP servers (common ones are ``pool.ntp.org`` and
|
||||
``time.nist.gov``) .
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ diagram for your board, or it won't work.
|
||||
Other than that, the API is compatible with the Arduino standard.
|
||||
Both master and slave operation are supported.
|
||||
|
||||
Master transmissions are buffered (up to 128 bytes) and only performed
|
||||
Master transmissions are buffered (up to 256 bytes) and only performed
|
||||
on ``endTransmission``, as is standard with modern Arduino Wire implementations.
|
||||
|
||||
For more detailed information, check the `Arduino Wire documentation <https://www.arduino.cc/en/reference/wire>`_ .
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
// BTstack features that can be enabled
|
||||
#define ENABLE_LOG_INFO
|
||||
#define ENABLE_LOG_DEBUG
|
||||
#define ENABLE_LOG_ERROR
|
||||
#define ENABLE_PRINTF_HEXDUMP
|
||||
#define ENABLE_SCO_OVER_HCI
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ extern void interrupts();
|
||||
#define SYS_ARCH_PROTECT(lev) noInterrupts
|
||||
#define SYS_ARCH_UNPROTECT(lev) interrupts
|
||||
|
||||
extern unsigned long get_rand_32(void);
|
||||
#define LWIP_RAND() get_rand_32()
|
||||
extern unsigned long __lwip_rand(void);
|
||||
#define LWIP_RAND() __lwip_rand()
|
||||
|
||||
// Common settings used in most of the pico_w examples
|
||||
// (see https://www.nongnu.org/lwip/2_1_x/group__lwip__opts.html for details)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -209,7 +209,3 @@
|
||||
-Wl,--wrap=cyw43_tcpip_link_status
|
||||
-Wl,--wrap=cyw43_cb_tcpip_init
|
||||
-Wl,--wrap=cyw43_cb_tcpip_deinit
|
||||
|
||||
-Wl,--wrap=get_rand_64
|
||||
-Wl,--wrap=get_rand_32
|
||||
-Wl,--wrap=sleep_until
|
||||
|
||||
Submodule libraries/Adafruit_TinyUSB_Arduino updated: b17ab37a0e...e291865233
@@ -46,7 +46,7 @@ IPAddress netMsk(255, 255, 255, 0);
|
||||
|
||||
|
||||
/** Should I connect to WLAN asap? */
|
||||
boolean connect;
|
||||
bool connect;
|
||||
|
||||
/** Last time I tried to connect to WLAN */
|
||||
unsigned long lastConnectTry = 0;
|
||||
|
||||
@@ -24,7 +24,7 @@ void handleRoot() {
|
||||
}
|
||||
|
||||
/** Redirect to captive portal if we got a request for another domain. Return true in that case so the page handler do not try to handle the request again. */
|
||||
boolean captivePortal() {
|
||||
bool captivePortal() {
|
||||
if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
|
||||
Serial.println("Request redirected to captive portal");
|
||||
server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Is this an IP? */
|
||||
boolean isIp(String str) {
|
||||
bool isIp(String str) {
|
||||
for (size_t i = 0; i < str.length(); i++) {
|
||||
int c = str.charAt(i);
|
||||
if (c != '.' && (c < '0' || c > '9')) {
|
||||
|
||||
@@ -124,6 +124,7 @@ bool EEPROMClass::commit() {
|
||||
flash_range_program((intptr_t)_sector - (intptr_t)XIP_BASE, _data, _size);
|
||||
rp2040.resumeOtherCore();
|
||||
interrupts();
|
||||
_dirty = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,127 +1,110 @@
|
||||
/* Cores */
|
||||
#define configNUM_CORES 2
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
#define configRUN_MULTIPLE_PRIORITIES 1
|
||||
#define configNUM_CORES 2
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
#define configRUN_MULTIPLE_PRIORITIES 1
|
||||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_IDLE_HOOK 1
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
#define configUSE_TICK_HOOK 1
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned long ) F_CPU )
|
||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
||||
#define configMAX_PRIORITIES ( 8 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 164 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 10 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1
|
||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
||||
#define configSTACK_DEPTH_TYPE uint32_t
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_IDLE_HOOK 1
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
#define configUSE_TICK_HOOK 1
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned long ) F_CPU )
|
||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
||||
#define configMAX_PRIORITIES ( 8 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 164 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 10 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1
|
||||
#define configSUPPORT_STATIC_ALLOCATION 1
|
||||
#define configSTACK_DEPTH_TYPE uint32_t
|
||||
#define configUSE_TASK_PREEMPTION_DISABLE 1
|
||||
|
||||
#define configUSE_NEWLIB_REENTRANT 1
|
||||
#define configUSE_NEWLIB_REENTRANT 1
|
||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
|
||||
|
||||
/* Run time stats related definitions. */
|
||||
void vMainConfigureTimerForRunTimeStats(void);
|
||||
unsigned long ulMainGetRunTimeCounterValue(void);
|
||||
extern void vMainConfigureTimerForRunTimeStats(void);
|
||||
extern unsigned long ulMainGetRunTimeCounterValue(void);
|
||||
#define configGENERATE_RUN_TIME_STATS 1
|
||||
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() //vMainConfigureTimerForRunTimeStats()
|
||||
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 1
|
||||
#define configUSE_CO_ROUTINES 1
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
|
||||
/* Software timer definitions. */
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 2 )
|
||||
#define configTIMER_QUEUE_LENGTH 5
|
||||
#define configTIMER_TASK_STACK_DEPTH ( 1024 )
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 2 )
|
||||
#define configTIMER_QUEUE_LENGTH 5
|
||||
#define configTIMER_TASK_STACK_DEPTH ( 1024 )
|
||||
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 1
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_eTaskGetState 1
|
||||
#define INCLUDE_eTaskGetState 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskCleanUpResources 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_xQueueGetMutexHolder 1
|
||||
#define INCLUDE_xTaskAbortDelay 1
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||
#define INCLUDE_xTaskGetHandle 1
|
||||
#define INCLUDE_xTaskGetIdleTaskHandle 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
#define INCLUDE_xTaskResumeFromISR 1
|
||||
#define INCLUDE_xTimerPendFunctionCall 1
|
||||
|
||||
/* This demo makes use of one or more example stats formatting functions. These
|
||||
format the raw data provided by the uxTaskGetSystemState() function in to human
|
||||
readable ASCII form. See the notes in the implementation of vTaskList() within
|
||||
FreeRTOS/Source/tasks.c for limitations. */
|
||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
|
||||
|
||||
#define configUSE_MUTEXES 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_xTaskGetIdleTaskHandle 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
/* Normal assert() semantics without relying on the provision of an assert.h
|
||||
header file. */
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
|
||||
/* Cortex-M specific definitions. */
|
||||
#undef __NVIC_PRIO_BITS
|
||||
#ifdef __NVIC_PRIO_BITS
|
||||
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
|
||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||||
#else
|
||||
#define configPRIO_BITS 3 /* 8 priority levels */
|
||||
#define configPRIO_BITS 3 /* 8 priority levels */
|
||||
#endif
|
||||
|
||||
/* The lowest interrupt priority that can be used in a call to a "set priority"
|
||||
function. */
|
||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
|
||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
|
||||
|
||||
/* The highest interrupt priority that can be used by any interrupt service
|
||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
|
||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
|
||||
|
||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
|
||||
extern void rtosFatalError(void);
|
||||
#define configASSERT( x ) \
|
||||
if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); rtosFatalError(); }
|
||||
|
||||
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
|
||||
standard names - or at least those used in the unmodified vector table. */
|
||||
//#define xPortPendSVHandler PendSV_Handler
|
||||
//#define xPortSysTickHandler SysTick_Handler
|
||||
//#define vPortSVCHandler SVC_Handler
|
||||
|
||||
/* The size of the global output buffer that is available for use when there
|
||||
are multiple command interpreters running at once (for example, one on a UART
|
||||
and one on TCP/IP). This is done to prevent an output buffer being defined by
|
||||
each implementation - which would waste RAM. In this case, there is only one
|
||||
command interpreter running. */
|
||||
#define configCOMMAND_INT_MAX_OUTPUT_SIZE 2048
|
||||
|
||||
|
||||
#define configUSE_DYNAMIC_EXCEPTION_HANDLERS 0
|
||||
#define configSUPPORT_PICO_SYNC_INTEROP 1
|
||||
#define configSUPPORT_PICO_TIME_INTEROP 1
|
||||
|
||||
#define configSUPPORT_PICO_SYNC_INTEROP 1
|
||||
#define configSUPPORT_PICO_TIME_INTEROP 1
|
||||
|
||||
#include "rp2040_config.h"
|
||||
//#include "task.h"
|
||||
|
||||
@@ -252,8 +252,10 @@ public:
|
||||
}
|
||||
|
||||
bool send(void *rpt, int len) {
|
||||
//wait for another report to be sent
|
||||
while (_needToSend);
|
||||
// Wait for another report to be sent
|
||||
while (connected() && _needToSend) {
|
||||
/* noop busy wait */
|
||||
}
|
||||
_needToSend = true;
|
||||
_sendReport = rpt;
|
||||
_sendReportLen = len;
|
||||
|
||||
@@ -134,7 +134,7 @@ bool I2S::setSysClk(int samplerate) { // optimise sys_clk for desired samplerate
|
||||
}
|
||||
|
||||
bool I2S::setMCLKmult(int mult) {
|
||||
if (_running || !_isOutput) {
|
||||
if (_running) {
|
||||
return false;
|
||||
}
|
||||
if ((mult % 64) == 0) {
|
||||
|
||||
@@ -20,9 +20,9 @@ void loop() {
|
||||
Joystick.button(i, true);
|
||||
delay(250);
|
||||
Joystick.button(i, false);
|
||||
delay(10); //we need a short delay here, sending packets with less than 1ms leads to packet loss!
|
||||
delay(10); // We need a short delay here, sending packets with less than 1ms leads to packet loss!
|
||||
}
|
||||
//alternativ with manual send:
|
||||
// Alternative with manual send:
|
||||
Joystick.useManualSend(true);
|
||||
Serial.println("Joystick buttons - manual send");
|
||||
for (uint8_t i = 1; i <= 32; i++) {
|
||||
@@ -33,8 +33,8 @@ void loop() {
|
||||
}
|
||||
Joystick.useManualSend(false);
|
||||
|
||||
//iterate all joystick axis
|
||||
//Note: although you can use 0-1023 here (10bit), internally 8bits are used (-127 to 127)
|
||||
// Iterate all joystick axis
|
||||
// Note: although you can use 0-1023 here (10bit), internally 8bits are used (-127 to 127)
|
||||
Serial.println("Joystick X");
|
||||
for (uint16_t i = 0; i < 1023; i++) {
|
||||
Joystick.X(i);
|
||||
@@ -71,8 +71,8 @@ void loop() {
|
||||
delay(20);
|
||||
} Joystick.hat(-1);
|
||||
|
||||
//use int8 mode for the axis.
|
||||
//Note: hat is not used differently.
|
||||
// Use int8 mode for the axis.
|
||||
// Note: hat is not used differently.
|
||||
Serial.println("Now all axis in 8bit mode, -127 to 127");
|
||||
Joystick.use8bit(true);
|
||||
Serial.println("Joystick X");
|
||||
|
||||
+6
-6
@@ -20,9 +20,9 @@ void loop() {
|
||||
JoystickBLE.button(i, true);
|
||||
delay(250);
|
||||
JoystickBLE.button(i, false);
|
||||
delay(10); //we need a short delay here, sending packets with less than 1ms leads to packet loss!
|
||||
delay(10); // We need a short delay here, sending packets with less than 1ms leads to packet loss!
|
||||
}
|
||||
//alternativ with manual send:
|
||||
// Alternative with manual send:
|
||||
JoystickBLE.useManualSend(true);
|
||||
Serial.println("Joystick buttons - manual send");
|
||||
for (uint8_t i = 1; i <= 32; i++) {
|
||||
@@ -33,8 +33,8 @@ void loop() {
|
||||
}
|
||||
JoystickBLE.useManualSend(false);
|
||||
|
||||
//iterate all joystick axis
|
||||
//Note: although you can use 0-1023 here (10bit), internally 8bits are used (-127 to 127)
|
||||
// Iterate all joystick axis
|
||||
// Note: although you can use 0-1023 here (10bit), internally 8bits are used (-127 to 127)
|
||||
Serial.println("Joystick X");
|
||||
for (uint16_t i = 0; i < 1023; i++) {
|
||||
JoystickBLE.X(i);
|
||||
@@ -71,8 +71,8 @@ void loop() {
|
||||
delay(20);
|
||||
} JoystickBLE.hat(-1);
|
||||
|
||||
//use int8 mode for the axis.
|
||||
//Note: hat is not used differently.
|
||||
// Use int8 mode for the axis.
|
||||
// Note: hat is not used differently.
|
||||
Serial.println("Now all axis in 8bit mode, -127 to 127");
|
||||
JoystickBLE.use8bit(true);
|
||||
Serial.println("Joystick X");
|
||||
|
||||
@@ -20,9 +20,9 @@ void loop() {
|
||||
JoystickBT.button(i, true);
|
||||
delay(250);
|
||||
JoystickBT.button(i, false);
|
||||
delay(10); //we need a short delay here, sending packets with less than 1ms leads to packet loss!
|
||||
delay(10); // We need a short delay here, sending packets with less than 1ms leads to packet loss!
|
||||
}
|
||||
//alternativ with manual send:
|
||||
// Alternative with manual send:
|
||||
JoystickBT.useManualSend(true);
|
||||
Serial.println("Joystick buttons - manual send");
|
||||
for (uint8_t i = 1; i <= 32; i++) {
|
||||
@@ -33,8 +33,8 @@ void loop() {
|
||||
}
|
||||
JoystickBT.useManualSend(false);
|
||||
|
||||
//iterate all joystick axis
|
||||
//Note: although you can use 0-1023 here (10bit), internally 8bits are used (-127 to 127)
|
||||
// Iterate all joystick axis
|
||||
// Note: although you can use 0-1023 here (10bit), internally 8bits are used (-127 to 127)
|
||||
Serial.println("Joystick X");
|
||||
for (uint16_t i = 0; i < 1023; i++) {
|
||||
JoystickBT.X(i);
|
||||
@@ -71,8 +71,8 @@ void loop() {
|
||||
delay(20);
|
||||
} JoystickBT.hat(-1);
|
||||
|
||||
//use int8 mode for the axis.
|
||||
//Note: hat is not used differently.
|
||||
// Use int8 mode for the axis.
|
||||
// Note: hat is not used differently.
|
||||
Serial.println("Now all axis in 8bit mode, -127 to 127");
|
||||
JoystickBT.use8bit(true);
|
||||
Serial.println("Joystick X");
|
||||
|
||||
@@ -161,7 +161,7 @@ bool MDNSResponder::_allocUDPContext(void) {
|
||||
|
||||
if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT)) {
|
||||
m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
|
||||
m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
|
||||
m_pUDPContext->onRx([this] { this->_callProcess(); });
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,6 @@ public:
|
||||
if (!_mounted) {
|
||||
return false;
|
||||
}
|
||||
info.maxOpenFiles = _maxOpenFds;
|
||||
info.blockSize = _blockSize;
|
||||
info.pageSize = _pageSize;
|
||||
info.maxOpenFiles = _maxOpenFds;
|
||||
|
||||
@@ -32,6 +32,8 @@ PWMAudio::PWMAudio(pin_size_t pin, bool stereo) {
|
||||
_buffers = 8;
|
||||
_bufferWords = 0;
|
||||
_stereo = stereo;
|
||||
_sampleRate = 48000;
|
||||
_pacer = -1;
|
||||
}
|
||||
|
||||
PWMAudio::~PWMAudio() {
|
||||
@@ -63,7 +65,7 @@ bool PWMAudio::setStereo(bool stereo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PWMAudio::setFrequency(int newFreq) {
|
||||
bool PWMAudio::setPWMFrequency(int newFreq) {
|
||||
_freq = newFreq;
|
||||
|
||||
// Figure out the scale factor for PWM values
|
||||
@@ -92,6 +94,17 @@ bool PWMAudio::setFrequency(int newFreq) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PWMAudio::setFrequency(int frequency) {
|
||||
if (_pacer < 0) {
|
||||
return false;
|
||||
}
|
||||
uint16_t _pacer_D, _pacer_N;
|
||||
/*Flip fraction(N for D, D for N) because we are using it as sys_clk * fraction(mechanic of dma_timer_set_fraction) for smaller than sys_clk values*/
|
||||
find_pacer_fraction(frequency, &_pacer_D, &_pacer_N);
|
||||
dma_timer_set_fraction(_pacer, _pacer_N, _pacer_D);
|
||||
return true;
|
||||
}
|
||||
|
||||
void PWMAudio::onTransmit(void(*fn)(void)) {
|
||||
_cb = fn;
|
||||
if (_running) {
|
||||
@@ -117,12 +130,25 @@ bool PWMAudio::begin() {
|
||||
_bufferWords = 16;
|
||||
}
|
||||
|
||||
setFrequency(_freq);
|
||||
setPWMFrequency(_freq);
|
||||
|
||||
/*Calculate and set the DMA pacer timer. This timer will pull data on a fixed sample rate. So the actual PWM frequency can be higher or lower.*/
|
||||
_pacer = dma_claim_unused_timer(false);
|
||||
/*When no unused timer is found, return*/
|
||||
if (_pacer < 0) {
|
||||
return false;
|
||||
}
|
||||
uint16_t _pacer_D = 0;
|
||||
uint16_t _pacer_N = 0;
|
||||
/*Flip fraction(N for D, D for N) because we are using it as sys_clk * fraction(mechanic of dma_timer_set_fraction) for smaller than sys_clk values*/
|
||||
find_pacer_fraction(_sampleRate, &_pacer_D, &_pacer_N);
|
||||
dma_timer_set_fraction(_pacer, _pacer_N, _pacer_D);
|
||||
int _pacer_dreq = dma_get_timer_dreq(_pacer);
|
||||
|
||||
uint32_t ccAddr = PWM_BASE + PWM_CH0_CC_OFFSET + pwm_gpio_to_slice_num(_pin) * 20;
|
||||
|
||||
_arb = new AudioBufferManager(_buffers, _bufferWords, 0x80008000, OUTPUT, DMA_SIZE_32);
|
||||
if (!_arb->begin(pwm_get_dreq(pwm_gpio_to_slice_num(_pin)), (volatile void*)ccAddr)) {
|
||||
if (!_arb->begin(_pacer_dreq, (volatile void*)ccAddr)) {
|
||||
_running = false;
|
||||
delete _arb;
|
||||
_arb = nullptr;
|
||||
@@ -143,6 +169,9 @@ void PWMAudio::end() {
|
||||
}
|
||||
delete _arb;
|
||||
_arb = nullptr;
|
||||
|
||||
dma_timer_unclaim(_pacer);
|
||||
_pacer = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,3 +248,44 @@ size_t PWMAudio::write(const uint8_t *buffer, size_t size) {
|
||||
}
|
||||
return writtenSize;
|
||||
}
|
||||
|
||||
void PWMAudio::find_pacer_fraction(int target, uint16_t *numerator, uint16_t *denominator) {
|
||||
const uint16_t max = 0xFFFF;
|
||||
|
||||
/*Cache last results so we dont have to recalculate*/
|
||||
static int last_target;
|
||||
static uint16_t bestNum;
|
||||
static uint16_t bestDenom;
|
||||
/*Check if we can load the previous values*/
|
||||
if (target == last_target) {
|
||||
*numerator = bestNum;
|
||||
*denominator = bestDenom;
|
||||
return;
|
||||
}
|
||||
|
||||
float targetRatio = (float)F_CPU / target;
|
||||
float lowestError = HUGE_VALF;
|
||||
|
||||
for (uint16_t denom = 1; denom < max; denom++) {
|
||||
uint16_t num = (int)((targetRatio * denom) + 0.5f); /*Calculate numerator, rounding to nearest integer*/
|
||||
|
||||
/*Check if numerator is within bounds*/
|
||||
if (num > 0 && num < max) {
|
||||
float actualRatio = (float)num / denom;
|
||||
float error = fabsf(actualRatio - targetRatio);
|
||||
|
||||
if (error < lowestError) {
|
||||
bestNum = num;
|
||||
bestDenom = denom;
|
||||
lowestError = error;
|
||||
if (error == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
last_target = target;
|
||||
*numerator = bestNum;
|
||||
*denominator = bestDenom;
|
||||
}
|
||||
@@ -29,12 +29,21 @@ public:
|
||||
virtual ~PWMAudio();
|
||||
|
||||
bool setBuffers(size_t buffers, size_t bufferWords);
|
||||
bool setFrequency(int newFreq);
|
||||
/*Sets the frequency of the PWM in hz*/
|
||||
bool setPWMFrequency(int newFreq);
|
||||
/*Sets the sample rate frequency in hz*/
|
||||
bool setFrequency(int frequency);
|
||||
bool setPin(pin_size_t pin);
|
||||
bool setStereo(bool stereo = true);
|
||||
|
||||
bool begin(long sampleRate) {
|
||||
setFrequency(sampleRate);
|
||||
_sampleRate = sampleRate;
|
||||
return begin();
|
||||
}
|
||||
|
||||
bool begin(long sampleRate, long PWMfrequency) {
|
||||
setPWMFrequency(PWMfrequency);
|
||||
_sampleRate = sampleRate;
|
||||
return begin();
|
||||
}
|
||||
|
||||
@@ -70,6 +79,9 @@ private:
|
||||
bool _stereo;
|
||||
|
||||
int _freq;
|
||||
int _sampleRate;
|
||||
|
||||
int _pacer;
|
||||
|
||||
size_t _buffers;
|
||||
size_t _bufferWords;
|
||||
@@ -84,4 +96,7 @@ private:
|
||||
void (*_cb)();
|
||||
|
||||
AudioBufferManager *_arb;
|
||||
|
||||
/*An accurate but brute force method to find 16bit numerator and denominator.*/
|
||||
void find_pacer_fraction(int target, uint16_t *numerator, uint16_t *denominator);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
SD card test
|
||||
|
||||
This example shows how use the utility libraries on which the'
|
||||
SD library is based in order to get info about your SD card.
|
||||
Very useful for testing a card when you're not sure whether its working or not.
|
||||
|
||||
The circuit:
|
||||
SD card attached to SPI bus as follows on RP2040:
|
||||
************ SPI0 ************
|
||||
** MISO (AKA RX) - pin 0, 4, or 16
|
||||
** MOSI (AKA TX) - pin 3, 7, or 19
|
||||
** CS - pin 1, 5, or 17
|
||||
** SCK - pin 2, 6, or 18
|
||||
************ SPI1 ************
|
||||
** MISO (AKA RX) - pin 8 or 12
|
||||
** MOSI (AKA TX) - pin 11 or 15
|
||||
** CS - pin 9 or 13
|
||||
** SCK - pin 10 or 14
|
||||
|
||||
created 28 Mar 2011
|
||||
by Limor Fried
|
||||
modified 9 Apr 2012
|
||||
by Tom Igoe
|
||||
modified 26 Dec 2023
|
||||
by Richard Teel from code provided by Renzo Mischianti
|
||||
SOURCE: https://mischianti.org/raspberry-pi-pico-and-rp2040-boards-how-to-use-sd-card-5/
|
||||
*/
|
||||
|
||||
// This are GP pins for SPI0 on the Raspberry Pi Pico board, and connect
|
||||
// to different *board* level pinouts. Check the PCB while wiring.
|
||||
// Only certain pins can be used by the SPI hardware, so if you change
|
||||
// these be sure they are legal or the program will crash.
|
||||
// See: https://datasheets.raspberrypi.com/picow/PicoW-A4-Pinout.pdf
|
||||
const int _MISO = 4; // AKA SPI RX
|
||||
const int _MOSI = 7; // AKA SPI TX
|
||||
const int _CS = 5;
|
||||
const int _SCK = 6;
|
||||
|
||||
// include the SD library:
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
|
||||
File root;
|
||||
|
||||
void setup() {
|
||||
// Open serial communications and wait for port to open:
|
||||
Serial.begin(115200);
|
||||
|
||||
while (!Serial) {
|
||||
delay(1); // wait for serial port to connect. Needed for native USB port only
|
||||
}
|
||||
|
||||
Serial.println("\nInitializing SD card...");
|
||||
|
||||
bool sdInitialized = false;
|
||||
// Ensure the SPI pinout the SD card is connected to is configured properly
|
||||
// Select the correct SPI based on _MISO pin for the RP2040
|
||||
if (_MISO == 0 || _MISO == 4 || _MISO == 16) {
|
||||
SPI.setRX(_MISO);
|
||||
SPI.setTX(_MOSI);
|
||||
SPI.setSCK(_SCK);
|
||||
sdInitialized = SD.begin(_CS);
|
||||
} else if (_MISO == 8 || _MISO == 12) {
|
||||
SPI1.setRX(_MISO);
|
||||
SPI1.setTX(_MOSI);
|
||||
SPI1.setSCK(_SCK);
|
||||
sdInitialized = SD.begin(_CS, SPI1);
|
||||
} else {
|
||||
Serial.println(F("ERROR: Unknown SPI Configuration"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sdInitialized) {
|
||||
Serial.println("initialization failed. Things to check:");
|
||||
Serial.println("* is a card inserted?");
|
||||
Serial.println("* is your wiring correct?");
|
||||
Serial.println("* did you change the chipSelect pin to match your shield or module?");
|
||||
return;
|
||||
} else {
|
||||
Serial.println("Wiring is correct and a card is present.");
|
||||
}
|
||||
// 0 - SD V1, 1 - SD V2, or 3 - SDHC/SDXC
|
||||
// print the type of card
|
||||
Serial.println();
|
||||
Serial.print("Card type: ");
|
||||
switch (SD.type()) {
|
||||
case 0:
|
||||
Serial.println("SD1");
|
||||
break;
|
||||
case 1:
|
||||
Serial.println("SD2");
|
||||
break;
|
||||
case 3:
|
||||
Serial.println("SDHC/SDXC");
|
||||
break;
|
||||
default:
|
||||
Serial.println("Unknown");
|
||||
}
|
||||
|
||||
Serial.print("Cluster size: ");
|
||||
Serial.println(SD.clusterSize());
|
||||
Serial.print("Blocks x Cluster: ");
|
||||
Serial.println(SD.blocksPerCluster());
|
||||
Serial.print("Blocks size: ");
|
||||
Serial.println(SD.blockSize());
|
||||
|
||||
Serial.print("Total Blocks: ");
|
||||
Serial.println(SD.totalBlocks());
|
||||
Serial.println();
|
||||
|
||||
Serial.print("Total Cluster: ");
|
||||
Serial.println(SD.totalClusters());
|
||||
Serial.println();
|
||||
|
||||
// print the type and size of the first FAT-type volume
|
||||
uint32_t volumesize;
|
||||
Serial.print("Volume type is: FAT");
|
||||
Serial.println(SD.fatType(), DEC);
|
||||
|
||||
volumesize = SD.totalClusters();
|
||||
volumesize *= SD.clusterSize();
|
||||
volumesize /= 1000;
|
||||
Serial.print("Volume size (Kb): ");
|
||||
Serial.println(volumesize);
|
||||
Serial.print("Volume size (Mb): ");
|
||||
volumesize /= 1024;
|
||||
Serial.println(volumesize);
|
||||
Serial.print("Volume size (Gb): ");
|
||||
Serial.println((float)volumesize / 1024.0);
|
||||
|
||||
Serial.print("Card size: ");
|
||||
Serial.println((float)SD.size() / 1000);
|
||||
|
||||
FSInfo fs_info;
|
||||
SDFS.info(fs_info);
|
||||
|
||||
Serial.print("Total bytes: ");
|
||||
Serial.println(fs_info.totalBytes);
|
||||
|
||||
Serial.print("Used bytes: ");
|
||||
Serial.println(fs_info.usedBytes);
|
||||
|
||||
root = SD.open("/");
|
||||
printDirectory(root, 0);
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
// nothing happens after setup finishes.
|
||||
}
|
||||
|
||||
void printDirectory(File dir, int numTabs) {
|
||||
while (true) {
|
||||
|
||||
File entry = dir.openNextFile();
|
||||
if (!entry) {
|
||||
// no more files
|
||||
break;
|
||||
}
|
||||
for (uint8_t i = 0; i < numTabs; i++) {
|
||||
Serial.print('\t');
|
||||
}
|
||||
Serial.print(entry.name());
|
||||
if (entry.isDirectory()) {
|
||||
Serial.println("/");
|
||||
printDirectory(entry, numTabs + 1);
|
||||
} else {
|
||||
// files have sizes, directories do not
|
||||
Serial.print("\t\t");
|
||||
Serial.print(entry.size(), DEC);
|
||||
time_t cr = entry.getCreationTime();
|
||||
time_t lw = entry.getLastWrite();
|
||||
struct tm* tmstruct = localtime(&cr);
|
||||
Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
|
||||
tmstruct = localtime(&lw);
|
||||
Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
|
||||
}
|
||||
entry.close();
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,17 @@
|
||||
directory on a SD card
|
||||
|
||||
The circuit:
|
||||
SD card attached to SPI bus as follows:
|
||||
** MISO - pin 4
|
||||
** MOSI - pin 7
|
||||
** CS - pin 5
|
||||
** SCK - pin 6
|
||||
SD card attached to SPI bus as follows on RP2040:
|
||||
************ SPI0 ************
|
||||
** MISO (AKA RX) - pin 0, 4, or 16
|
||||
** MOSI (AKA TX) - pin 3, 7, or 19
|
||||
** CS - pin 1, 5, or 17
|
||||
** SCK - pin 2, 6, or 18
|
||||
************ SPI1 ************
|
||||
** MISO (AKA RX) - pin 8 or 12
|
||||
** MOSI (AKA TX) - pin 11 or 15
|
||||
** CS - pin 9 or 13
|
||||
** SCK - pin 10 or 14
|
||||
|
||||
created Nov 2010
|
||||
by David A. Mellis
|
||||
@@ -17,6 +23,10 @@
|
||||
by Tom Igoe
|
||||
modified 2 Feb 2014
|
||||
by Scott Fitzgerald
|
||||
modified 12 Feb 2023
|
||||
by Earle F. Philhower, III
|
||||
modified 26 Dec 2023
|
||||
by Richard Teel
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
@@ -27,8 +37,8 @@
|
||||
// Only certain pins can be used by the SPI hardware, so if you change
|
||||
// these be sure they are legal or the program will crash.
|
||||
// See: https://datasheets.raspberrypi.com/picow/PicoW-A4-Pinout.pdf
|
||||
const int _MISO = 4;
|
||||
const int _MOSI = 7;
|
||||
const int _MISO = 4; // AKA SPI RX
|
||||
const int _MOSI = 7; // AKA SPI TX
|
||||
const int _CS = 5;
|
||||
const int _SCK = 6;
|
||||
|
||||
@@ -41,14 +51,31 @@ void setup() {
|
||||
// Open serial communications and wait for port to open:
|
||||
Serial.begin(115200);
|
||||
|
||||
Serial.print("Initializing SD card...");
|
||||
while (!Serial) {
|
||||
delay(1); // wait for serial port to connect. Needed for native USB port only
|
||||
}
|
||||
|
||||
Serial.println("\nInitializing SD card...");
|
||||
|
||||
bool sdInitialized = false;
|
||||
// Ensure the SPI pinout the SD card is connected to is configured properly
|
||||
SPI.setRX(_MISO);
|
||||
SPI.setTX(_MOSI);
|
||||
SPI.setSCK(_SCK);
|
||||
// Select the correct SPI based on _MISO pin for the RP2040
|
||||
if (_MISO == 0 || _MISO == 4 || _MISO == 16) {
|
||||
SPI.setRX(_MISO);
|
||||
SPI.setTX(_MOSI);
|
||||
SPI.setSCK(_SCK);
|
||||
sdInitialized = SD.begin(_CS);
|
||||
} else if (_MISO == 8 || _MISO == 12) {
|
||||
SPI1.setRX(_MISO);
|
||||
SPI1.setTX(_MOSI);
|
||||
SPI1.setSCK(_SCK);
|
||||
sdInitialized = SD.begin(_CS, SPI1);
|
||||
} else {
|
||||
Serial.println(F("ERROR: Unknown SPI Configuration"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SD.begin(_CS)) {
|
||||
if (!sdInitialized) {
|
||||
Serial.println("initialization failed!");
|
||||
return;
|
||||
}
|
||||
@@ -68,8 +95,8 @@ void loop() {
|
||||
void printDirectory(File dir, int numTabs) {
|
||||
while (true) {
|
||||
|
||||
File entry = dir.openNextFile();
|
||||
if (! entry) {
|
||||
File entry = dir.openNextFile();
|
||||
if (!entry) {
|
||||
// no more files
|
||||
break;
|
||||
}
|
||||
@@ -86,7 +113,7 @@ void printDirectory(File dir, int numTabs) {
|
||||
Serial.print(entry.size(), DEC);
|
||||
time_t cr = entry.getCreationTime();
|
||||
time_t lw = entry.getLastWrite();
|
||||
struct tm * tmstruct = localtime(&cr);
|
||||
struct tm* tmstruct = localtime(&cr);
|
||||
Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
|
||||
tmstruct = localtime(&lw);
|
||||
Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
|
||||
|
||||
+23
-23
@@ -31,13 +31,13 @@
|
||||
|
||||
class SDClass {
|
||||
public:
|
||||
boolean begin(uint8_t csPin, HardwareSPI &spi) {
|
||||
bool begin(uint8_t csPin, HardwareSPI &spi) {
|
||||
SDFS.setConfig(SDFSConfig(csPin, SPI_HALF_SPEED, spi));
|
||||
return (boolean)SDFS.begin();
|
||||
return SDFS.begin();
|
||||
}
|
||||
boolean begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED, HardwareSPI &spi = SPI) {
|
||||
bool begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED, HardwareSPI &spi = SPI) {
|
||||
SDFS.setConfig(SDFSConfig(csPin, cfg, spi));
|
||||
return (boolean)SDFS.begin();
|
||||
return SDFS.begin();
|
||||
}
|
||||
|
||||
void end(bool endSPI = true) {
|
||||
@@ -63,43 +63,43 @@ public:
|
||||
return open(filename.c_str(), mode);
|
||||
}
|
||||
|
||||
boolean exists(const char *filepath) {
|
||||
return (boolean)SDFS.exists(filepath);
|
||||
bool exists(const char *filepath) {
|
||||
return SDFS.exists(filepath);
|
||||
}
|
||||
|
||||
boolean exists(const String &filepath) {
|
||||
return (boolean)SDFS.exists(filepath.c_str());
|
||||
bool exists(const String &filepath) {
|
||||
return SDFS.exists(filepath.c_str());
|
||||
}
|
||||
|
||||
boolean rename(const char* filepathfrom, const char* filepathto) {
|
||||
return (boolean)SDFS.rename(filepathfrom, filepathto);
|
||||
bool rename(const char* filepathfrom, const char* filepathto) {
|
||||
return SDFS.rename(filepathfrom, filepathto);
|
||||
}
|
||||
|
||||
boolean rename(const String &filepathfrom, const String &filepathto) {
|
||||
return (boolean)rename(filepathfrom.c_str(), filepathto.c_str());
|
||||
bool rename(const String &filepathfrom, const String &filepathto) {
|
||||
return rename(filepathfrom.c_str(), filepathto.c_str());
|
||||
}
|
||||
|
||||
boolean mkdir(const char *filepath) {
|
||||
return (boolean)SDFS.mkdir(filepath);
|
||||
bool mkdir(const char *filepath) {
|
||||
return SDFS.mkdir(filepath);
|
||||
}
|
||||
|
||||
boolean mkdir(const String &filepath) {
|
||||
return (boolean)SDFS.mkdir(filepath.c_str());
|
||||
bool mkdir(const String &filepath) {
|
||||
return SDFS.mkdir(filepath.c_str());
|
||||
}
|
||||
|
||||
boolean remove(const char *filepath) {
|
||||
return (boolean)SDFS.remove(filepath);
|
||||
bool remove(const char *filepath) {
|
||||
return SDFS.remove(filepath);
|
||||
}
|
||||
|
||||
boolean remove(const String &filepath) {
|
||||
bool remove(const String &filepath) {
|
||||
return remove(filepath.c_str());
|
||||
}
|
||||
|
||||
boolean rmdir(const char *filepath) {
|
||||
return (boolean)SDFS.rmdir(filepath);
|
||||
bool rmdir(const char *filepath) {
|
||||
return SDFS.rmdir(filepath);
|
||||
}
|
||||
|
||||
boolean rmdir(const String &filepath) {
|
||||
bool rmdir(const String &filepath) {
|
||||
return rmdir(filepath.c_str());
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
}
|
||||
|
||||
size_t totalBlocks() {
|
||||
return (totalClusters() / blocksPerCluster());
|
||||
return (totalClusters() * blocksPerCluster());
|
||||
}
|
||||
|
||||
size_t clusterSize() {
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
return _fs.vol()->clusterCount();
|
||||
}
|
||||
size_t totalBlocks() {
|
||||
return (totalClusters() / blocksPerCluster());
|
||||
return (totalClusters() * blocksPerCluster());
|
||||
}
|
||||
size_t clusterSize() {
|
||||
return _fs.vol()->bytesPerCluster();
|
||||
|
||||
@@ -18,6 +18,7 @@ beginTransaction KEYWORD2
|
||||
endTransaction KEYWORD2
|
||||
SPISettings KEYWORD2
|
||||
transfer KEYWORD2
|
||||
transfer16 KEYWORD2
|
||||
setBitOrder KEYWORD2
|
||||
setDataMode KEYWORD2
|
||||
setClockDivider KEYWORD2
|
||||
|
||||
+23
-13
@@ -37,7 +37,7 @@ SPIClassRP2040::SPIClassRP2040(spi_inst_t *spi, pin_size_t rx, pin_size_t cs, pi
|
||||
_spi = spi;
|
||||
_running = false;
|
||||
_initted = false;
|
||||
_spis = SPISettings();
|
||||
_spis = SPISettings(0, LSBFIRST, SPI_MODE0); // Ensure spi_init called by setting current freq to 0
|
||||
_RX = rx;
|
||||
_TX = tx;
|
||||
_SCK = sck;
|
||||
@@ -110,8 +110,8 @@ byte SPIClassRP2040::transfer(uint8_t data) {
|
||||
return 0;
|
||||
}
|
||||
data = (_spis.getBitOrder() == MSBFIRST) ? data : reverseByte(data);
|
||||
spi_set_format(_spi, 8, cpol(), cpha(), SPI_MSB_FIRST);
|
||||
DEBUGSPI("SPI::transfer(%02x), cpol=%d, cpha=%d\n", data, cpol(), cpha());
|
||||
hw_write_masked(&spi_get_hw(_spi)->cr0, (8 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); // Fast set to 8-bits
|
||||
spi_write_read_blocking(_spi, &data, &ret, 1);
|
||||
ret = (_spis.getBitOrder() == MSBFIRST) ? ret : reverseByte(ret);
|
||||
DEBUGSPI("SPI: read back %02x\n", ret);
|
||||
@@ -124,8 +124,8 @@ uint16_t SPIClassRP2040::transfer16(uint16_t data) {
|
||||
return 0;
|
||||
}
|
||||
data = (_spis.getBitOrder() == MSBFIRST) ? data : reverse16Bit(data);
|
||||
spi_set_format(_spi, 16, cpol(), cpha(), SPI_MSB_FIRST);
|
||||
DEBUGSPI("SPI::transfer16(%04x), cpol=%d, cpha=%d\n", data, cpol(), cpha());
|
||||
hw_write_masked(&spi_get_hw(_spi)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); // Fast set to 16-bits
|
||||
spi_write16_read16_blocking(_spi, &data, &ret, 1);
|
||||
ret = (_spis.getBitOrder() == MSBFIRST) ? ret : reverse16Bit(ret);
|
||||
DEBUGSPI("SPI: read back %02x\n", ret);
|
||||
@@ -147,14 +147,14 @@ void SPIClassRP2040::transfer(const void *txbuf, void *rxbuf, size_t count) {
|
||||
return;
|
||||
}
|
||||
|
||||
hw_write_masked(&spi_get_hw(_spi)->cr0, (8 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); // Fast set to 8-bits
|
||||
|
||||
DEBUGSPI("SPI::transfer(%p, %p, %d)\n", txbuf, rxbuf, count);
|
||||
const uint8_t *txbuff = reinterpret_cast<const uint8_t *>(txbuf);
|
||||
uint8_t *rxbuff = reinterpret_cast<uint8_t *>(rxbuf);
|
||||
|
||||
// MSB version is easy!
|
||||
if (_spis.getBitOrder() == MSBFIRST) {
|
||||
spi_set_format(_spi, 8, cpol(), cpha(), SPI_MSB_FIRST);
|
||||
|
||||
if (rxbuf == nullptr) { // transmit only!
|
||||
spi_write_blocking(_spi, txbuff, count);
|
||||
return;
|
||||
@@ -184,14 +184,18 @@ void SPIClassRP2040::beginTransaction(SPISettings settings) {
|
||||
if (_initted && settings == _spis) {
|
||||
DEBUGSPI("SPI: Reusing existing initted SPI\n");
|
||||
} else {
|
||||
_spis = settings;
|
||||
if (_initted) {
|
||||
DEBUGSPI("SPI: deinitting currently active SPI\n");
|
||||
spi_deinit(_spi);
|
||||
/* Only de-init if the clock changes frequency */
|
||||
if (settings.getClockFreq() != _spis.getClockFreq()) {
|
||||
if (_initted) {
|
||||
DEBUGSPI("SPI: deinitting currently active SPI\n");
|
||||
spi_deinit(_spi);
|
||||
}
|
||||
DEBUGSPI("SPI: initting SPI\n");
|
||||
spi_init(_spi, settings.getClockFreq());
|
||||
DEBUGSPI("SPI: actual baudrate=%u\n", spi_get_baudrate(_spi));
|
||||
}
|
||||
DEBUGSPI("SPI: initting SPI\n");
|
||||
spi_init(_spi, _spis.getClockFreq());
|
||||
DEBUGSPI("SPI: actual baudrate=%u\n", spi_get_baudrate(_spi));
|
||||
_spis = settings;
|
||||
spi_set_format(_spi, 8, cpol(), cpha(), SPI_MSB_FIRST);
|
||||
_initted = true;
|
||||
}
|
||||
// Disable any IRQs that are being used for SPI
|
||||
@@ -204,7 +208,7 @@ void SPIClassRP2040::beginTransaction(SPISettings settings) {
|
||||
io_rw_32 *en_reg = &irq_ctrl_base->inte[gpio / 8];
|
||||
uint32_t val = ((*en_reg) >> (4 * (gpio % 8))) & 0xf;
|
||||
_usingIRQs.insert_or_assign(gpio, val);
|
||||
DEBUGSPI("SPI: GPIO %d = %d\n", gpio, val);
|
||||
DEBUGSPI("SPI: GPIO %d = %lu\n", gpio, val);
|
||||
(*en_reg) ^= val << (4 * (gpio % 8));
|
||||
}
|
||||
DEBUGSPI("SPI: IRQ masks after = %08x %08x %08x %08x\n", (unsigned)irq_ctrl_base->inte[0], (unsigned)irq_ctrl_base->inte[1], (unsigned)irq_ctrl_base->inte[2], (unsigned)irq_ctrl_base->inte[3]);
|
||||
@@ -337,6 +341,7 @@ void SPIClassRP2040::end() {
|
||||
}
|
||||
gpio_set_function(_SCK, GPIO_FUNC_SIO);
|
||||
gpio_set_function(_TX, GPIO_FUNC_SIO);
|
||||
_spis = SPISettings(0, LSBFIRST, SPI_MODE0);
|
||||
}
|
||||
|
||||
void SPIClassRP2040::setBitOrder(BitOrder order) {
|
||||
@@ -362,5 +367,10 @@ void SPIClassRP2040::setClockDivider(uint8_t uc_div) {
|
||||
#define __SPI1_DEVICE spi1
|
||||
#endif
|
||||
|
||||
#ifdef PIN_SPI0_MISO
|
||||
SPIClassRP2040 SPI(__SPI0_DEVICE, PIN_SPI0_MISO, PIN_SPI0_SS, PIN_SPI0_SCK, PIN_SPI0_MOSI);
|
||||
#endif
|
||||
|
||||
#ifdef PIN_SPI1_MISO
|
||||
SPIClassRP2040 SPI1(__SPI1_DEVICE, PIN_SPI1_MISO, PIN_SPI1_SS, PIN_SPI1_SCK, PIN_SPI1_MOSI);
|
||||
#endif
|
||||
|
||||
@@ -262,15 +262,15 @@ void HTTPServer::setContentLength(const size_t contentLength) {
|
||||
_contentLength = contentLength;
|
||||
}
|
||||
|
||||
void HTTPServer::enableDelay(boolean value) {
|
||||
void HTTPServer::enableDelay(bool value) {
|
||||
_nullDelay = value;
|
||||
}
|
||||
|
||||
void HTTPServer::enableCORS(boolean value) {
|
||||
void HTTPServer::enableCORS(bool value) {
|
||||
_corsEnabled = value;
|
||||
}
|
||||
|
||||
void HTTPServer::enableCrossOrigin(boolean value) {
|
||||
void HTTPServer::enableCrossOrigin(bool value) {
|
||||
enableCORS(value);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,9 +146,9 @@ public:
|
||||
send(code, content_type, (const char *)content, contentLength);
|
||||
}
|
||||
|
||||
void enableDelay(boolean value);
|
||||
void enableCORS(boolean value = true);
|
||||
void enableCrossOrigin(boolean value = true);
|
||||
void enableDelay(bool value);
|
||||
void enableCORS(bool value = true);
|
||||
void enableCrossOrigin(bool value = true);
|
||||
|
||||
void setContentLength(const size_t contentLength);
|
||||
void sendHeader(const String& name, const String& value, bool first = false);
|
||||
@@ -235,7 +235,7 @@ protected:
|
||||
String value;
|
||||
};
|
||||
|
||||
boolean _corsEnabled;
|
||||
bool _corsEnabled;
|
||||
|
||||
WiFiClient *_currentClient;
|
||||
HTTPMethod _currentMethod;
|
||||
@@ -243,7 +243,7 @@ protected:
|
||||
uint8_t _currentVersion;
|
||||
HTTPClientStatus _currentStatus;
|
||||
unsigned long _statusChange;
|
||||
boolean _nullDelay;
|
||||
bool _nullDelay;
|
||||
|
||||
RequestHandler* _currentHandler;
|
||||
RequestHandler* _firstHandler;
|
||||
|
||||
@@ -339,7 +339,7 @@ int HTTPServer::_uploadReadByte(WiFiClient* client) {
|
||||
// keep trying until you either read a valid byte or timeout
|
||||
unsigned long startMillis = millis();
|
||||
unsigned long timeoutIntervalMillis = client->getTimeout();
|
||||
boolean timedOut = false;
|
||||
bool timedOut = false;
|
||||
for (;;) {
|
||||
if (!client->connected()) {
|
||||
return -1;
|
||||
|
||||
@@ -90,7 +90,7 @@ void WebServerTemplate<ServerType, DefaultPort>::handleClient() {
|
||||
_currentClient = nullptr;
|
||||
}
|
||||
|
||||
_currentClient = new ClientType(_server.available());
|
||||
_currentClient = new ClientType(_server.accept());
|
||||
if (!_currentClient) {
|
||||
if (_nullDelay) {
|
||||
delay(1);
|
||||
|
||||
@@ -34,7 +34,7 @@ void loop() {
|
||||
delay(1000);
|
||||
Serial.printf("--loop %d\n", ++i);
|
||||
delay(10);
|
||||
WiFiClient client = server.available();
|
||||
WiFiClient client = server.accept();
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <pico/cyw43_arch.h>
|
||||
#include <cyw43.h>
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/icmp.h"
|
||||
#include "lwip/inet_chksum.h"
|
||||
@@ -31,7 +29,14 @@
|
||||
|
||||
// This is the real WiFi network object, we just tickle it to do our magic
|
||||
#include <LwipEthernet.h>
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
#include <pico/cyw43_arch.h>
|
||||
static CYW43lwIP _wifi(1);
|
||||
#elif defined(ESPHOSTSPI)
|
||||
static ESPHostLwIP _wifi;
|
||||
#else
|
||||
static NoDriverLwIP _wifi;
|
||||
#endif
|
||||
|
||||
WiFiClass::WiFiClass() {
|
||||
}
|
||||
@@ -75,7 +80,6 @@ int WiFiClass::beginBSSID(const char* ssid, const uint8_t *bssid) {
|
||||
return begin(ssid, nullptr, bssid);
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
/* Start WiFi connection with passphrase
|
||||
the most secure supported mode will be automatically selected
|
||||
|
||||
@@ -98,11 +102,11 @@ int WiFiClass::begin(const char* ssid, const char *passphrase, const uint8_t *bs
|
||||
} else {
|
||||
bzero(_bssid, sizeof(_bssid));
|
||||
}
|
||||
_wifi.setSTA();
|
||||
_wifi.setSSID(_ssid.c_str());
|
||||
_wifi.setBSSID(_bssid);
|
||||
_wifi.setPassword(passphrase);
|
||||
_wifi.setTimeout(_timeout);
|
||||
_wifi.setSTA();
|
||||
_apMode = false;
|
||||
_wifiHWInitted = true;
|
||||
uint32_t start = millis(); // The timeout starts from network init, not network link up
|
||||
@@ -137,15 +141,11 @@ uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase) {
|
||||
|
||||
_ssid = ssid;
|
||||
_password = passphrase;
|
||||
_wifi.setAP();
|
||||
_wifi.setSSID(_ssid.c_str());
|
||||
_wifi.setPassword(passphrase);
|
||||
_wifi.setTimeout(_timeout);
|
||||
_wifi.setAP();
|
||||
_apMode = true;
|
||||
if (!_wifi.begin()) {
|
||||
return WL_IDLE_STATUS;
|
||||
}
|
||||
noLowPowerMode();
|
||||
IPAddress gw = _wifi.gatewayIP();
|
||||
if (!gw.isSet()) {
|
||||
gw = IPAddress(192, 168, 42, 1);
|
||||
@@ -155,6 +155,10 @@ uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase) {
|
||||
mask = IPAddress(255, 255, 255, 0);
|
||||
}
|
||||
config(gw);
|
||||
if (!_wifi.begin()) {
|
||||
return WL_IDLE_STATUS;
|
||||
}
|
||||
noLowPowerMode();
|
||||
_dhcpServer = (dhcp_server_t *)malloc(sizeof(dhcp_server_t));
|
||||
if (!_dhcpServer) {
|
||||
// OOM
|
||||
@@ -166,8 +170,8 @@ uint8_t WiFiClass::beginAP(const char *ssid, const char* passphrase) {
|
||||
|
||||
return WL_CONNECTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
uint8_t WiFiClass::softAPgetStationNum() {
|
||||
if (!_apMode || !_wifiHWInitted) {
|
||||
return 0;
|
||||
@@ -182,10 +186,10 @@ uint8_t WiFiClass::softAPgetStationNum() {
|
||||
free(macs);
|
||||
return m;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool WiFiClass::connected() {
|
||||
return (_apMode && _wifiHWInitted) || (_wifi.connected() && localIP().isSet() && (cyw43_wifi_link_status(&cyw43_state, _apMode ? 1 : 0) == CYW43_LINK_JOIN));
|
||||
return (_apMode && _wifiHWInitted) || (_wifi.connected() && localIP().isSet());
|
||||
}
|
||||
|
||||
/* Change Ip configuration settings disabling the dhcp client
|
||||
@@ -193,7 +197,7 @@ bool WiFiClass::connected() {
|
||||
param local_ip: Static ip configuration
|
||||
*/
|
||||
void WiFiClass::config(IPAddress local_ip) {
|
||||
ip4_addr_set_u32(ip_2_ip4(&_wifi.getNetIf()->ip_addr), local_ip.v4());
|
||||
_wifi.config(local_ip);
|
||||
}
|
||||
|
||||
/* Change Ip configuration settings disabling the dhcp client
|
||||
@@ -202,8 +206,7 @@ void WiFiClass::config(IPAddress local_ip) {
|
||||
param dns_server: IP configuration for DNS server 1
|
||||
*/
|
||||
void WiFiClass::config(IPAddress local_ip, IPAddress dns_server) {
|
||||
ip4_addr_set_u32(ip_2_ip4(&_wifi.getNetIf()->ip_addr), local_ip.v4());
|
||||
dns_setserver(0, dns_server);
|
||||
_wifi.config(local_ip, dns_server);
|
||||
}
|
||||
|
||||
/* Change Ip configuration settings disabling the dhcp client
|
||||
@@ -213,9 +216,7 @@ void WiFiClass::config(IPAddress local_ip, IPAddress dns_server) {
|
||||
param gateway : Static gateway configuration
|
||||
*/
|
||||
void WiFiClass::config(IPAddress local_ip, IPAddress dns_server, IPAddress gateway) {
|
||||
ip4_addr_set_u32(ip_2_ip4(&_wifi.getNetIf()->ip_addr), local_ip.v4());
|
||||
dns_setserver(0, dns_server);
|
||||
ip4_addr_set_u32(ip_2_ip4(&_wifi.getNetIf()->gw), gateway.v4());
|
||||
_wifi.config(local_ip, dns_server, gateway);
|
||||
}
|
||||
|
||||
/* Change Ip configuration settings disabling the dhcp client
|
||||
@@ -273,7 +274,6 @@ int WiFiClass::disconnect(bool wifi_off __unused) {
|
||||
}
|
||||
if (_wifiHWInitted) {
|
||||
_wifiHWInitted = false;
|
||||
cyw43_wifi_leave(&cyw43_state, _apMode ? 1 : 0);
|
||||
_wifi.end();
|
||||
}
|
||||
return WL_DISCONNECTED;
|
||||
@@ -291,12 +291,13 @@ void WiFiClass::end(void) {
|
||||
return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH
|
||||
*/
|
||||
uint8_t* WiFiClass::macAddress(uint8_t* mac) {
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
if (!_wifiHWInitted) {
|
||||
_apMode = false;
|
||||
cyw43_wifi_set_up(&cyw43_state, _apMode ? 1 : 0, true, CYW43_COUNTRY_WORLDWIDE);
|
||||
}
|
||||
cyw43_wifi_get_mac(&cyw43_state, _apMode ? 1 : 0, mac);
|
||||
return mac;
|
||||
#endif
|
||||
return _wifi.macAddress(_apMode, mac);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -326,6 +327,15 @@ IPAddress WiFiClass::gatewayIP() {
|
||||
return _wifi.gatewayIP();
|
||||
}
|
||||
|
||||
/*
|
||||
Get the DNS ip address.
|
||||
|
||||
return: IPAddress DNS Server IP
|
||||
*/
|
||||
IPAddress WiFiClass::dnsIP(uint8_t dns_no) {
|
||||
return _wifi.dnsIP(dns_no);
|
||||
}
|
||||
|
||||
/*
|
||||
Return the current SSID associated with the network
|
||||
|
||||
@@ -342,30 +352,11 @@ const String &WiFiClass::SSID() {
|
||||
return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH
|
||||
*/
|
||||
uint8_t* WiFiClass::BSSID(uint8_t* bssid) {
|
||||
#ifndef CYW43_IOCTL_GET_BSSID
|
||||
#define CYW43_IOCTL_GET_BSSID ( (uint32_t)23 * 2 )
|
||||
#endif
|
||||
|
||||
if (_wifi.connected()) {
|
||||
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_BSSID, WL_MAC_ADDR_LENGTH, bssid, CYW43_ITF_STA);
|
||||
} else {
|
||||
memset(bssid, 0, WL_MAC_ADDR_LENGTH);
|
||||
}
|
||||
return bssid;
|
||||
return _wifi.BSSID(bssid);
|
||||
}
|
||||
|
||||
int WiFiClass::channel() {
|
||||
#ifndef CYW43_IOCTL_GET_CHANNEL
|
||||
#define CYW43_IOCTL_GET_CHANNEL 0x3a
|
||||
#endif
|
||||
|
||||
int32_t channel;
|
||||
if (_wifi.connected()) {
|
||||
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_CHANNEL, sizeof channel, (uint8_t *)&channel, CYW43_ITF_STA);
|
||||
} else {
|
||||
channel = -1;
|
||||
}
|
||||
return channel;
|
||||
return _wifi.channel();
|
||||
}
|
||||
|
||||
|
||||
@@ -376,17 +367,7 @@ int WiFiClass::channel() {
|
||||
return: signed value
|
||||
*/
|
||||
int32_t WiFiClass::RSSI() {
|
||||
#ifndef CYW43_IOCTL_GET_RSSI
|
||||
#define CYW43_IOCTL_GET_RSSI 0xFE
|
||||
#endif
|
||||
|
||||
int32_t rssi;
|
||||
if (_wifi.connected()) {
|
||||
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_RSSI, sizeof rssi, (uint8_t *)&rssi, CYW43_ITF_STA);
|
||||
} else {
|
||||
rssi = -255;
|
||||
}
|
||||
return rssi;
|
||||
return _wifi.RSSI();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -395,31 +376,10 @@ int32_t WiFiClass::RSSI() {
|
||||
return: one value of wl_enc_type enum
|
||||
*/
|
||||
uint8_t WiFiClass::encryptionType() {
|
||||
// TODO - Driver does not return this?!
|
||||
if (_password == nullptr) {
|
||||
return ENC_TYPE_NONE;
|
||||
}
|
||||
return ENC_TYPE_AUTO;
|
||||
}
|
||||
|
||||
//TODO - this can be in the class
|
||||
static uint64_t _to64(uint8_t b[8]) {
|
||||
uint64_t x = 0;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
x <<= 8LL;
|
||||
x |= b[i] & 255;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
int WiFiClass::_scanCB(void *env, const cyw43_ev_scan_result_t *result) {
|
||||
WiFiClass *w = (WiFiClass *)env;
|
||||
if (result) {
|
||||
cyw43_ev_scan_result_t s;
|
||||
memcpy(&s, result, sizeof(s));
|
||||
w->_scan.insert_or_assign(_to64(s.bssid), s);
|
||||
}
|
||||
return 0;
|
||||
return _wifi.encryptionType();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -428,39 +388,22 @@ int WiFiClass::_scanCB(void *env, const cyw43_ev_scan_result_t *result) {
|
||||
return: Number of discovered networks
|
||||
*/
|
||||
int8_t WiFiClass::scanNetworks(bool async) {
|
||||
cyw43_wifi_scan_options_t scan_options;
|
||||
memset(&scan_options, 0, sizeof(scan_options));
|
||||
_scan.clear();
|
||||
if (!_wifiHWInitted) {
|
||||
_apMode = false;
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
cyw43_arch_enable_sta_mode();
|
||||
#endif
|
||||
_wifiHWInitted = true;
|
||||
}
|
||||
int err = cyw43_wifi_scan(&cyw43_state, &scan_options, this, _scanCB);
|
||||
if (err) {
|
||||
return 0;
|
||||
}
|
||||
if (!async) {
|
||||
uint32_t now = millis();
|
||||
while (cyw43_wifi_scan_active(&cyw43_state) && (millis() - now < 10000)) {
|
||||
delay(10);
|
||||
}
|
||||
return _scan.size();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return _wifi.scanNetworks(async);
|
||||
}
|
||||
|
||||
int8_t WiFiClass::scanComplete() {
|
||||
if (cyw43_wifi_scan_active(&cyw43_state)) {
|
||||
return -1;
|
||||
} else {
|
||||
return _scan.size();
|
||||
}
|
||||
return _wifi.scanComplete();
|
||||
}
|
||||
|
||||
void WiFiClass::scanDelete() {
|
||||
_scan.clear();
|
||||
_wifi.scanDelete();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -471,14 +414,7 @@ void WiFiClass::scanDelete() {
|
||||
return: ssid string of the specified item on the networks scanned list
|
||||
*/
|
||||
const char*WiFiClass::SSID(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
return (const char *)it->second.ssid;
|
||||
return _wifi.SSID(networkItem);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -489,44 +425,15 @@ const char*WiFiClass::SSID(uint8_t networkItem) {
|
||||
return: encryption type (enum wl_enc_type) of the specified item on the networks scanned list
|
||||
*/
|
||||
uint8_t WiFiClass::encryptionType(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return ENC_TYPE_UNKNOWN;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
// TODO - the driver returns a small integer but does not actually provide a way of mapping that to the proper enc type. My best guesses here...
|
||||
switch (it->second.auth_mode) {
|
||||
case 0: return ENC_TYPE_NONE;
|
||||
case 3: return ENC_TYPE_TKIP;
|
||||
case 5: return ENC_TYPE_CCMP;
|
||||
case 7: return ENC_TYPE_AUTO;
|
||||
}
|
||||
return ENC_TYPE_UNKNOWN;
|
||||
return _wifi.encryptionType(networkItem);
|
||||
}
|
||||
|
||||
uint8_t* WiFiClass::BSSID(uint8_t networkItem, uint8_t* bssid) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
memcpy(bssid, it->second.bssid, 6);
|
||||
return bssid;
|
||||
return _wifi.BSSID(networkItem, bssid);
|
||||
}
|
||||
|
||||
uint8_t WiFiClass::channel(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return 255;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
return it->second.channel;
|
||||
return _wifi.channel(networkItem);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -537,14 +444,7 @@ uint8_t WiFiClass::channel(uint8_t networkItem) {
|
||||
return: signed value of RSSI of the specified item on the networks scanned list
|
||||
*/
|
||||
int32_t WiFiClass::RSSI(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return -9999;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
return it->second.rssi;
|
||||
return _wifi.RSSI(networkItem);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -556,14 +456,7 @@ uint8_t WiFiClass::status() {
|
||||
if (_apMode && _wifiHWInitted) {
|
||||
return WL_CONNECTED;
|
||||
}
|
||||
switch (cyw43_wifi_link_status(&cyw43_state, _apMode ? 1 : 0)) {
|
||||
case CYW43_LINK_DOWN: return WL_IDLE_STATUS;
|
||||
case CYW43_LINK_JOIN: return localIP().isSet() ? WL_CONNECTED : WL_DISCONNECTED;
|
||||
case CYW43_LINK_FAIL: return WL_CONNECT_FAILED;
|
||||
case CYW43_LINK_NONET: return WL_CONNECT_FAILED;
|
||||
case CYW43_LINK_BADAUTH: return WL_CONNECT_FAILED;
|
||||
}
|
||||
return WL_NO_MODULE;
|
||||
return _wifi.status();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -593,6 +486,7 @@ unsigned long WiFiClass::getTime() {
|
||||
return millis();
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
void WiFiClass::aggressiveLowPowerMode() {
|
||||
cyw43_wifi_pm(&cyw43_state, CYW43_AGGRESSIVE_PM);
|
||||
}
|
||||
@@ -600,10 +494,11 @@ void WiFiClass::aggressiveLowPowerMode() {
|
||||
void WiFiClass::defaultLowPowerMode() {
|
||||
cyw43_wifi_pm(&cyw43_state, CYW43_DEFAULT_PM);
|
||||
}
|
||||
#endif
|
||||
|
||||
// The difference between the default CYW43_DEFAULT_PM (0xA11142) and not low power (0xA11140) is that it changed from "Powersave mode on specified interface with High throughput" to "No Powersave mode". All other parameters stayed the same.
|
||||
void WiFiClass::noLowPowerMode() {
|
||||
cyw43_wifi_pm(&cyw43_state, 0xA11140);
|
||||
_wifi.noLowPowerMode();
|
||||
}
|
||||
|
||||
int WiFiClass::ping(const char* hostname, uint8_t ttl) {
|
||||
|
||||
@@ -23,13 +23,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
#include <lwIP_CYW43.h>
|
||||
#elif defined(ESPHOSTSPI)
|
||||
#include <lwIP_ESPHost.h>
|
||||
#else
|
||||
#include "utility/lwIP_nodriver.h"
|
||||
#endif
|
||||
#include "WiFi.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <map>
|
||||
|
||||
#include <cyw43.h>
|
||||
#include "dhcpserver/dhcpserver.h"
|
||||
|
||||
#define WIFI_FIRMWARE_LATEST_VERSION PICO_SDK_VERSION_STRING
|
||||
@@ -136,7 +141,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
uint8_t softAPgetStationNum();
|
||||
#endif
|
||||
|
||||
IPAddress softAPIP() {
|
||||
return localIP();
|
||||
@@ -261,6 +268,13 @@ public:
|
||||
*/
|
||||
IPAddress gatewayIP();
|
||||
|
||||
/*
|
||||
Get the DNS ip address.
|
||||
|
||||
return: IPAddress DNS Server IP
|
||||
*/
|
||||
IPAddress dnsIP(uint8_t dns_no = 0);
|
||||
|
||||
/*
|
||||
Return the current SSID associated with the network
|
||||
|
||||
@@ -374,8 +388,10 @@ public:
|
||||
|
||||
unsigned long getTime();
|
||||
|
||||
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
|
||||
void aggressiveLowPowerMode();
|
||||
void defaultLowPowerMode();
|
||||
#endif
|
||||
void noLowPowerMode();
|
||||
|
||||
int ping(const char* hostname, uint8_t ttl = 128);
|
||||
@@ -404,10 +420,6 @@ private:
|
||||
bool _wifiHWInitted = false;
|
||||
bool _apMode = false;
|
||||
|
||||
// WiFi Scan callback
|
||||
std::map<uint64_t, cyw43_ev_scan_result_t> _scan;
|
||||
static int _scanCB(void *env, const cyw43_ev_scan_result_t *result);
|
||||
|
||||
// DHCP for AP mode
|
||||
dhcp_server_t *_dhcpServer = nullptr;
|
||||
|
||||
|
||||
@@ -58,6 +58,15 @@ bool WiFiMulti::addAP(const char *ssid, const char *pass) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void WiFiMulti::clearAPList() {
|
||||
while (!_list.empty()) {
|
||||
struct _AP ap = _list.front();
|
||||
_list.pop_front();
|
||||
free(ap.ssid);
|
||||
free(ap.pass);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t WiFiMulti::run(uint32_t to) {
|
||||
struct _scanAP {
|
||||
char *ssid;
|
||||
|
||||
@@ -32,6 +32,8 @@ public:
|
||||
|
||||
bool addAP(const char *ssid, const char *pass = nullptr);
|
||||
|
||||
void clearAPList();
|
||||
|
||||
uint8_t run(uint32_t to = 10000);
|
||||
|
||||
private:
|
||||
|
||||
@@ -163,10 +163,18 @@ void WiFiServer::close() {
|
||||
_listen_pcb = nullptr;
|
||||
}
|
||||
|
||||
void WiFiServer::end() {
|
||||
close();
|
||||
}
|
||||
|
||||
void WiFiServer::stop() {
|
||||
close();
|
||||
}
|
||||
|
||||
WiFiServer::operator bool() {
|
||||
return (status() != CLOSED);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* slist_append_tail(T* head, T* item) {
|
||||
if (!head) {
|
||||
|
||||
@@ -75,10 +75,10 @@ protected:
|
||||
|
||||
public:
|
||||
WiFiServer(const IPAddress& addr, uint16_t port);
|
||||
WiFiServer(uint16_t port);
|
||||
WiFiServer(uint16_t port = 23);
|
||||
virtual ~WiFiServer() {}
|
||||
WiFiClient accept(); // https://www.arduino.cc/en/Reference/EthernetServerAccept
|
||||
WiFiClient available(uint8_t* status = nullptr);
|
||||
WiFiClient available(uint8_t* status = nullptr) __attribute__((deprecated("Use accept().")));
|
||||
|
||||
bool hasClient();
|
||||
// hasClientData():
|
||||
@@ -95,8 +95,10 @@ public:
|
||||
bool getNoDelay();
|
||||
uint8_t status();
|
||||
uint16_t port() const;
|
||||
void end();
|
||||
void close();
|
||||
void stop();
|
||||
explicit operator bool();
|
||||
|
||||
using ClientType = WiFiClient;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class WiFiClientSecure;
|
||||
class WiFiServerSecure : public WiFiServer {
|
||||
public:
|
||||
WiFiServerSecure(IPAddress addr, uint16_t port);
|
||||
WiFiServerSecure(uint16_t port);
|
||||
WiFiServerSecure(uint16_t port = 22);
|
||||
WiFiServerSecure(const WiFiServerSecure &rhs);
|
||||
virtual ~WiFiServerSecure();
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
// If awaiting connection available and authenticated (i.e. client cert), return it.
|
||||
WiFiClientSecure accept(); // https://www.arduino.cc/en/Reference/EthernetServerAccept
|
||||
WiFiClientSecure available(uint8_t* status = nullptr);
|
||||
WiFiClientSecure available(uint8_t* status = nullptr) __attribute__((deprecated("Use accept().")));
|
||||
|
||||
WiFiServerSecure& operator=(const WiFiServerSecure&) = default;
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
#pragma once
|
||||
|
||||
#include <LwipIntfDev.h>
|
||||
#include "nodriver.h"
|
||||
|
||||
class NoDriverLwIP : public LwipIntfDev<NoDriver> {
|
||||
public:
|
||||
|
||||
NoDriverLwIP() :
|
||||
LwipIntfDev<NoDriver>() {
|
||||
}
|
||||
|
||||
bool initHW(bool apMode) {
|
||||
(void) apMode;
|
||||
return false;
|
||||
}
|
||||
|
||||
void setSSID(const char *p) {
|
||||
(void) p;
|
||||
}
|
||||
|
||||
void setBSSID(const uint8_t *bssid) {
|
||||
(void) bssid;
|
||||
}
|
||||
|
||||
void setPassword(const char *p) {
|
||||
(void) p;
|
||||
}
|
||||
|
||||
void setSTA() {
|
||||
}
|
||||
|
||||
void setAP() {
|
||||
}
|
||||
|
||||
void setTimeout(int timeout) {
|
||||
(void) timeout;
|
||||
}
|
||||
|
||||
void end() {
|
||||
}
|
||||
|
||||
bool connected() {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* macAddress(bool apMode, uint8_t *mac) {
|
||||
(void) apMode;
|
||||
return mac;
|
||||
}
|
||||
|
||||
uint8_t* BSSID(uint8_t *bssid) {
|
||||
return bssid;
|
||||
}
|
||||
|
||||
int32_t RSSI() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int channel() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint8_t encryptionType() {
|
||||
return ENC_TYPE_AUTO;
|
||||
}
|
||||
|
||||
int8_t scanNetworks(bool async = false) {
|
||||
(void) async;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t scanComplete() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void scanDelete() {
|
||||
}
|
||||
|
||||
const char* SSID(uint8_t networkItem) {
|
||||
(void) networkItem;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8_t encryptionType(uint8_t networkItem) {
|
||||
(void) networkItem;
|
||||
return ENC_TYPE_AUTO;
|
||||
}
|
||||
|
||||
uint8_t* BSSID(uint8_t networkItem, uint8_t *bssid) {
|
||||
(void) networkItem;
|
||||
return bssid;
|
||||
}
|
||||
|
||||
uint8_t channel(uint8_t networkItem) {
|
||||
(void) networkItem;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t RSSI(uint8_t networkItem) {
|
||||
(void) networkItem;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t status() {
|
||||
return WL_NO_MODULE;
|
||||
}
|
||||
|
||||
void noLowPowerMode() {
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
|
||||
class NoDriver {
|
||||
public:
|
||||
|
||||
NoDriver(int8_t cs, arduino::SPIClass& spi, int8_t intrpin) {
|
||||
(void) cs;
|
||||
(void) spi;
|
||||
(void) intrpin;
|
||||
}
|
||||
|
||||
bool begin(const uint8_t* address, netif *netif) {
|
||||
(void) address;
|
||||
(void) netif;
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t sendFrame(const uint8_t* data, uint16_t datalen) {
|
||||
(void) data;
|
||||
(void) datalen;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t readFrame(uint8_t* buffer, uint16_t bufsize) {
|
||||
(void) buffer;
|
||||
(void) bufsize;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t readFrameSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void discardFrame(uint16_t ign) {
|
||||
(void) ign;
|
||||
}
|
||||
|
||||
uint16_t readFrameData(uint8_t *ign1, uint16_t ign2) {
|
||||
(void) ign1;
|
||||
(void) ign2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool interruptIsPossible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
constexpr bool needsSPI() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
@@ -262,6 +262,9 @@ size_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit) {
|
||||
|
||||
_buffLen = i2c_read_blocking_until(_i2c, address, _buff, quantity, !stopBit, make_timeout_time_ms(_timeout));
|
||||
if ((_buffLen == PICO_ERROR_GENERIC) || (_buffLen == PICO_ERROR_TIMEOUT)) {
|
||||
if (_buffLen == PICO_ERROR_TIMEOUT) {
|
||||
_handleTimeout(_reset_with_timeout);
|
||||
}
|
||||
_buffLen = 0;
|
||||
}
|
||||
_buffOff = 0;
|
||||
@@ -335,12 +338,32 @@ stop:
|
||||
return ack;
|
||||
}
|
||||
|
||||
void TwoWire::_handleTimeout(bool reset) {
|
||||
_timeoutFlag = true;
|
||||
|
||||
if (reset) {
|
||||
if (_slave) {
|
||||
uint8_t prev_addr = _addr;
|
||||
int prev_clkHz = _clkHz;
|
||||
end();
|
||||
setClock(prev_clkHz);
|
||||
begin(prev_addr);
|
||||
} else {
|
||||
int prev_clkHz = _clkHz;
|
||||
end();
|
||||
setClock(prev_clkHz);
|
||||
begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Errors:
|
||||
// 0 : Success
|
||||
// 1 : Data too long
|
||||
// 2 : NACK on transmit of address
|
||||
// 3 : NACK on transmit of data
|
||||
// 4 : Other error
|
||||
// 5 : Timeout
|
||||
uint8_t TwoWire::endTransmission(bool stopBit) {
|
||||
if (!_running || !_txBegun) {
|
||||
return 4;
|
||||
@@ -352,6 +375,10 @@ uint8_t TwoWire::endTransmission(bool stopBit) {
|
||||
} else {
|
||||
auto len = _buffLen;
|
||||
auto ret = i2c_write_blocking_until(_i2c, _addr, _buff, _buffLen, !stopBit, make_timeout_time_ms(_timeout));
|
||||
if (ret == PICO_ERROR_TIMEOUT) {
|
||||
_handleTimeout(_reset_with_timeout);
|
||||
return 5;
|
||||
}
|
||||
_buffLen = 0;
|
||||
return (ret == len) ? 0 : 4;
|
||||
}
|
||||
@@ -422,6 +449,20 @@ void TwoWire::onRequest(void(*function)(void)) {
|
||||
_onRequestCallback = function;
|
||||
}
|
||||
|
||||
void TwoWire::setTimeout(uint32_t timeout, bool reset_with_timeout) {
|
||||
_timeoutFlag = false;
|
||||
Stream::setTimeout(timeout);
|
||||
_reset_with_timeout = reset_with_timeout;
|
||||
}
|
||||
|
||||
bool TwoWire::getTimeoutFlag() {
|
||||
return _timeoutFlag;
|
||||
}
|
||||
|
||||
void TwoWire::clearTimeoutFlag() {
|
||||
_timeoutFlag = false;
|
||||
}
|
||||
|
||||
#ifndef __WIRE0_DEVICE
|
||||
#define __WIRE0_DEVICE i2c0
|
||||
#endif
|
||||
@@ -429,5 +470,10 @@ void TwoWire::onRequest(void(*function)(void)) {
|
||||
#define __WIRE1_DEVICE i2c1
|
||||
#endif
|
||||
|
||||
#ifdef PIN_WIRE0_SDA
|
||||
TwoWire Wire(__WIRE0_DEVICE, PIN_WIRE0_SDA, PIN_WIRE0_SCL);
|
||||
#endif
|
||||
|
||||
#ifdef PIN_WIRE1_SDA
|
||||
TwoWire Wire1(__WIRE1_DEVICE, PIN_WIRE1_SDA, PIN_WIRE1_SCL);
|
||||
#endif
|
||||
|
||||
@@ -82,6 +82,10 @@ public:
|
||||
}
|
||||
using Print::write;
|
||||
|
||||
void setTimeout(uint32_t timeout = 25, bool reset_with_timeout = false); // sets the maximum number of milliseconds to wait
|
||||
bool getTimeoutFlag(void);
|
||||
void clearTimeoutFlag(void);
|
||||
|
||||
// IRQ callback
|
||||
void onIRQ();
|
||||
|
||||
@@ -96,6 +100,10 @@ private:
|
||||
uint8_t _addr;
|
||||
bool _txBegun;
|
||||
|
||||
bool _timeoutFlag;
|
||||
bool _reset_with_timeout;
|
||||
void _handleTimeout(bool reset);
|
||||
|
||||
uint8_t _buff[WIRE_BUFFER_SIZE];
|
||||
int _buffLen;
|
||||
int _buffOff;
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
WiFiClass methods implementations for the CYG43 chip
|
||||
|
||||
Copyright (c) 2022 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "lwIP_CYW43.h"
|
||||
#include <pico/cyw43_arch.h>
|
||||
|
||||
CYW43lwIP::CYW43lwIP(int8_t cs) : LwipIntfDev<CYW43>(cs) {
|
||||
|
||||
}
|
||||
|
||||
void CYW43lwIP::end() {
|
||||
cyw43_wifi_leave(&cyw43_state, _ap ? 1 : 0);
|
||||
LwipIntfDev<CYW43>::end();
|
||||
}
|
||||
|
||||
bool CYW43lwIP::connected() {
|
||||
return (LwipIntfDev<CYW43>::connected() && (cyw43_wifi_link_status(&cyw43_state, 0) == CYW43_LINK_JOIN));
|
||||
}
|
||||
|
||||
uint8_t* CYW43lwIP::macAddress(bool apMode, uint8_t* mac) {
|
||||
cyw43_wifi_get_mac(&cyw43_state, apMode ? 1 : 0, mac);
|
||||
return mac;
|
||||
}
|
||||
|
||||
uint8_t* CYW43lwIP::BSSID(uint8_t* bssid) {
|
||||
#ifndef CYW43_IOCTL_GET_BSSID
|
||||
#define CYW43_IOCTL_GET_BSSID ( (uint32_t)23 * 2 )
|
||||
#endif
|
||||
|
||||
if (connected()) {
|
||||
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_BSSID, WL_MAC_ADDR_LENGTH, bssid, CYW43_ITF_STA);
|
||||
} else {
|
||||
memset(bssid, 0, WL_MAC_ADDR_LENGTH);
|
||||
}
|
||||
return bssid;
|
||||
}
|
||||
|
||||
int CYW43lwIP::channel() {
|
||||
#ifndef CYW43_IOCTL_GET_CHANNEL
|
||||
#define CYW43_IOCTL_GET_CHANNEL 0x3a
|
||||
#endif
|
||||
|
||||
int32_t channel;
|
||||
if (connected()) {
|
||||
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_CHANNEL, sizeof channel, (uint8_t *)&channel, CYW43_ITF_STA);
|
||||
} else {
|
||||
channel = -1;
|
||||
}
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Return the current RSSI /Received Signal Strength in dBm)
|
||||
associated with the network
|
||||
|
||||
return: signed value
|
||||
*/
|
||||
int32_t CYW43lwIP::RSSI() {
|
||||
#ifndef CYW43_IOCTL_GET_RSSI
|
||||
#define CYW43_IOCTL_GET_RSSI 0xFE
|
||||
#endif
|
||||
|
||||
int32_t rssi;
|
||||
if (connected()) {
|
||||
cyw43_ioctl(&cyw43_state, CYW43_IOCTL_GET_RSSI, sizeof rssi, (uint8_t *)&rssi, CYW43_ITF_STA);
|
||||
} else {
|
||||
rssi = -255;
|
||||
}
|
||||
return rssi;
|
||||
}
|
||||
|
||||
/*
|
||||
Return the Encryption Type associated with the network
|
||||
|
||||
return: one value of wl_enc_type enum
|
||||
*/
|
||||
uint8_t CYW43lwIP::encryptionType() {
|
||||
// TODO - Driver does not return this?!
|
||||
return ENC_TYPE_AUTO;
|
||||
}
|
||||
|
||||
//TODO - this can be in the class
|
||||
static uint64_t _to64(uint8_t b[8]) {
|
||||
uint64_t x = 0;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
x <<= 8LL;
|
||||
x |= b[i] & 255;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
int CYW43lwIP::_scanCB(void *env, const cyw43_ev_scan_result_t *result) {
|
||||
CYW43lwIP *w = (CYW43lwIP *)env;
|
||||
if (result) {
|
||||
cyw43_ev_scan_result_t s;
|
||||
memcpy(&s, result, sizeof(s));
|
||||
w->_scan.insert_or_assign(_to64(s.bssid), s);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t CYW43lwIP::scanNetworks(bool async) {
|
||||
cyw43_wifi_scan_options_t scan_options;
|
||||
memset(&scan_options, 0, sizeof(scan_options));
|
||||
_scan.clear();
|
||||
int err = cyw43_wifi_scan(&cyw43_state, &scan_options, this, _scanCB);
|
||||
if (err) {
|
||||
return 0;
|
||||
}
|
||||
if (!async) {
|
||||
uint32_t now = millis();
|
||||
while (cyw43_wifi_scan_active(&cyw43_state) && (millis() - now < 10000)) {
|
||||
delay(10);
|
||||
}
|
||||
return _scan.size();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int8_t CYW43lwIP::scanComplete() {
|
||||
if (cyw43_wifi_scan_active(&cyw43_state)) {
|
||||
return -1;
|
||||
} else {
|
||||
return _scan.size();
|
||||
}
|
||||
}
|
||||
|
||||
void CYW43lwIP::scanDelete() {
|
||||
_scan.clear();
|
||||
}
|
||||
|
||||
const char*CYW43lwIP::SSID(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
return (const char *)it->second.ssid;
|
||||
}
|
||||
|
||||
uint8_t CYW43lwIP::encryptionType(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return ENC_TYPE_UNKNOWN;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
// TODO - the driver returns a small integer but does not actually provide a way of mapping that to the proper enc type. My best guesses here...
|
||||
switch (it->second.auth_mode) {
|
||||
case 0: return ENC_TYPE_NONE;
|
||||
case 3: return ENC_TYPE_TKIP;
|
||||
case 5: return ENC_TYPE_CCMP;
|
||||
case 7: return ENC_TYPE_AUTO;
|
||||
}
|
||||
return ENC_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
uint8_t* CYW43lwIP::BSSID(uint8_t networkItem, uint8_t* bssid) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
memcpy(bssid, it->second.bssid, 6);
|
||||
return bssid;
|
||||
}
|
||||
|
||||
uint8_t CYW43lwIP::channel(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return 255;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
return it->second.channel;
|
||||
}
|
||||
|
||||
int32_t CYW43lwIP::RSSI(uint8_t networkItem) {
|
||||
if (networkItem >= _scan.size()) {
|
||||
return -9999;
|
||||
}
|
||||
auto it = _scan.begin();
|
||||
for (int i = 0; i < networkItem; i++) {
|
||||
++it;
|
||||
}
|
||||
return it->second.rssi;
|
||||
}
|
||||
|
||||
uint8_t CYW43lwIP::status() {
|
||||
switch (cyw43_wifi_link_status(&cyw43_state, 0)) {
|
||||
case CYW43_LINK_DOWN: return WL_IDLE_STATUS;
|
||||
case CYW43_LINK_JOIN: return localIP().isSet() ? WL_CONNECTED : WL_DISCONNECTED;
|
||||
case CYW43_LINK_FAIL: return WL_CONNECT_FAILED;
|
||||
case CYW43_LINK_NONET: return WL_CONNECT_FAILED;
|
||||
case CYW43_LINK_BADAUTH: return WL_CONNECT_FAILED;
|
||||
}
|
||||
return WL_NO_MODULE;
|
||||
}
|
||||
|
||||
void CYW43lwIP::noLowPowerMode() {
|
||||
cyw43_wifi_pm(&cyw43_state, 0xA11140);
|
||||
}
|
||||
@@ -3,4 +3,38 @@
|
||||
#include <LwipIntfDev.h>
|
||||
#include <utility/CYW43shim.h>
|
||||
|
||||
using CYW43lwIP = LwipIntfDev<CYW43>;
|
||||
class CYW43lwIP: public LwipIntfDev<CYW43> {
|
||||
public:
|
||||
CYW43lwIP(int8_t cs = SS);
|
||||
|
||||
void end();
|
||||
bool connected();
|
||||
|
||||
uint8_t* macAddress(bool apMode, uint8_t *mac);
|
||||
|
||||
uint8_t* BSSID(uint8_t *bssid);
|
||||
int32_t RSSI();
|
||||
int channel();
|
||||
uint8_t encryptionType();
|
||||
|
||||
int8_t scanNetworks(bool async = false);
|
||||
int8_t scanComplete();
|
||||
void scanDelete();
|
||||
|
||||
const char* SSID(uint8_t networkItem);
|
||||
uint8_t encryptionType(uint8_t networkItem);
|
||||
uint8_t* BSSID(uint8_t networkItem, uint8_t *bssid);
|
||||
uint8_t channel(uint8_t networkItem);
|
||||
int32_t RSSI(uint8_t networkItem);
|
||||
|
||||
uint8_t status();
|
||||
|
||||
void noLowPowerMode();
|
||||
|
||||
private:
|
||||
|
||||
// WiFi Scan callback
|
||||
std::map<uint64_t, cyw43_ev_scan_result_t> _scan;
|
||||
static int _scanCB(void *env, const cyw43_ev_scan_result_t *result);
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# lwIP_ESPHost library
|
||||
|
||||
RP2040 Arduino integration with the ESPHost library.
|
||||
|
||||
[ESPHost library](https://github.com/JAndrassy/ESPHost) is a driver for communication with Espressif's esp-hosted-fg firmware.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
name=lwIP_ESPHost
|
||||
version=1
|
||||
author=Juraj Andrassy
|
||||
maintainer=Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
sentence=RP2040 ESPHost wifi driver
|
||||
paragraph=Driver for the esp-hosted-fg firmware with the ESPHosted library
|
||||
category=Communication
|
||||
url=https://github.com/earlephilhower/arduino-pico
|
||||
architectures=rp2040
|
||||
dot_a_linkage=true
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
WiFi <-> LWIP for ESPHost library in RP2040 Core
|
||||
|
||||
Copyright (c) 2024 Juraj Andrassy
|
||||
|
||||
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 "ESPHost.h"
|
||||
#include "CEspControl.h"
|
||||
|
||||
ESPHost::ESPHost(int8_t cs, arduino::SPIClass &spi, int8_t intrpin) {
|
||||
(void) cs;
|
||||
(void) spi;
|
||||
(void) intrpin;
|
||||
// CS and SPI are configured in ESPHost library
|
||||
}
|
||||
|
||||
bool ESPHost::begin(const uint8_t *address, netif *netif) {
|
||||
(void) address;
|
||||
(void) netif;
|
||||
|
||||
// WiFi is initialized in ESPHostLwIP
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ESPHost::end() {
|
||||
// WiFi is ended in ESPHostLwIP
|
||||
}
|
||||
|
||||
uint16_t ESPHost::sendFrame(const uint8_t *data, uint16_t datalen) {
|
||||
int res = CEspControl::getInstance().sendBuffer(apMode ? ESP_AP_IF : ESP_STA_IF, 0, (uint8_t*) data, datalen);
|
||||
CEspControl::getInstance().communicateWithEsp();
|
||||
return (res == ESP_CONTROL_OK) ? datalen : 0;
|
||||
}
|
||||
|
||||
uint16_t ESPHost::readFrameData(uint8_t *buffer, uint16_t bufsize) {
|
||||
uint8_t ifn = 0;
|
||||
uint16_t res;
|
||||
if (apMode) {
|
||||
res = CEspControl::getInstance().getSoftApRx(ifn, buffer, bufsize);
|
||||
} else {
|
||||
res = CEspControl::getInstance().getStationRx(ifn, buffer, bufsize);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint16_t ESPHost::readFrameSize() {
|
||||
CEspControl::getInstance().communicateWithEsp();
|
||||
uint16_t res;
|
||||
if (apMode) {
|
||||
res = CEspControl::getInstance().peekSoftApRxPayloadLen();
|
||||
} else {
|
||||
res = CEspControl::getInstance().peekStationRxPayloadLen();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
WiFi <-> LWIP for ESPHost library in RP2040 Core
|
||||
|
||||
Copyright (c) 2024 Juraj Andrassy
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
|
||||
class ESPHost {
|
||||
public:
|
||||
|
||||
// constructor and methods as required by LwipIntfDev
|
||||
|
||||
ESPHost(int8_t cs, arduino::SPIClass &spi, int8_t intrpin);
|
||||
|
||||
bool begin(const uint8_t *address, netif *netif);
|
||||
void end();
|
||||
|
||||
uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
|
||||
|
||||
uint16_t readFrameData(uint8_t *buffer, uint16_t bufsize);
|
||||
|
||||
uint16_t readFrameSize();
|
||||
|
||||
void discardFrame(uint16_t ign) {
|
||||
(void) ign;
|
||||
}
|
||||
|
||||
bool interruptIsPossible() {
|
||||
return false;
|
||||
}
|
||||
|
||||
constexpr bool needsSPI() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool apMode = false;
|
||||
|
||||
};
|
||||
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
WiFi <-> LWIP for ESPHost library in RP2040 Core
|
||||
|
||||
Copyright (c) 2024 Juraj Andrassy
|
||||
|
||||
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 "lwIP_ESPHost.h"
|
||||
#include "CEspControl.h"
|
||||
|
||||
#define MAX_SOFTAP_CONNECTION_DEF 5
|
||||
|
||||
bool ESPHostLwIP::wifiHwInitialized = false;
|
||||
ESPHostLwIP* ESPHostLwIP::instance = nullptr;
|
||||
|
||||
void ESPHostLwIP::setSTA() {
|
||||
apMode = false;
|
||||
}
|
||||
|
||||
void ESPHostLwIP::setAP() {
|
||||
apMode = true;
|
||||
}
|
||||
|
||||
void ESPHostLwIP::setSSID(const char *ssid) {
|
||||
if (apMode) {
|
||||
if (ssid == nullptr) {
|
||||
softAP.ssid[0] = 0;
|
||||
} else {
|
||||
memcpy(softAP.ssid, ssid, sizeof(softAP.ssid));
|
||||
}
|
||||
} else {
|
||||
if (ssid == nullptr) {
|
||||
ap.ssid[0] = 0;
|
||||
} else {
|
||||
memcpy(ap.ssid, ssid, sizeof(ap.ssid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ESPHostLwIP::setBSSID(const uint8_t *bssid) {
|
||||
if (bssid == nullptr) {
|
||||
ap.bssid[0] = 0;
|
||||
} else {
|
||||
snprintf((char *)ap.bssid, sizeof(ap.bssid), "%02x:%02x:%02x:%02x:%02x:%02x", bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
|
||||
}
|
||||
}
|
||||
|
||||
void ESPHostLwIP::setPassword(const char *pass) {
|
||||
if (apMode) {
|
||||
if (pass == nullptr) {
|
||||
softAP.pwd[0] = 0;
|
||||
} else {
|
||||
memcpy(softAP.pwd, pass, sizeof(softAP.pwd));
|
||||
}
|
||||
} else {
|
||||
if (pass == nullptr) {
|
||||
ap.pwd[0] = 0;
|
||||
} else {
|
||||
memcpy(ap.pwd, pass, sizeof(ap.pwd));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ESPHostLwIP::setChannel(uint8_t channel) {
|
||||
softAP.channel = (channel > MAX_CHNL_NO) ? MAX_CHNL_NO : channel;
|
||||
}
|
||||
|
||||
void ESPHostLwIP::setTimeout(int _timeout) {
|
||||
timeout = _timeout;
|
||||
}
|
||||
|
||||
int ESPHostLwIP::initEventCb(CCtrlMsgWrapper *resp) {
|
||||
(void) resp;
|
||||
wifiHwInitialized = true;
|
||||
return ESP_CONTROL_OK;
|
||||
}
|
||||
|
||||
int ESPHostLwIP::disconnectEventCb(CCtrlMsgWrapper *resp) {
|
||||
(void) resp;
|
||||
instance->onDisconnectEvent();
|
||||
return ESP_CONTROL_OK;
|
||||
}
|
||||
|
||||
bool ESPHostLwIP::initHW() {
|
||||
if (wifiHwInitialized) {
|
||||
return true;
|
||||
}
|
||||
instance = this;
|
||||
|
||||
CEspControl::getInstance().listenForStationDisconnectEvent(disconnectEventCb);
|
||||
CEspControl::getInstance().listenForInitEvent(initEventCb);
|
||||
if (CEspControl::getInstance().initSpiDriver() != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t start = millis();
|
||||
while (!wifiHwInitialized && (millis() - start < timeout)) {
|
||||
CEspControl::getInstance().communicateWithEsp();
|
||||
delay(100);
|
||||
}
|
||||
if (wifiHwInitialized) {
|
||||
wifiStatus = WL_IDLE_STATUS;
|
||||
}
|
||||
__startEthernetContext();
|
||||
return wifiHwInitialized;
|
||||
}
|
||||
|
||||
bool ESPHostLwIP::begin() {
|
||||
if (!initHW()) {
|
||||
return false;
|
||||
}
|
||||
ethernet_arch_lwip_begin();
|
||||
if (!apMode) {
|
||||
CEspControl::getInstance().setWifiMode(WIFI_MODE_STA);
|
||||
if (CEspControl::getInstance().connectAccessPoint(ap) != ESP_CONTROL_OK) {
|
||||
wifiStatus = WL_CONNECT_FAILED;
|
||||
ethernet_arch_lwip_end();
|
||||
return false;
|
||||
}
|
||||
CEspControl::getInstance().getAccessPointConfig(ap);
|
||||
} else {
|
||||
CEspControl::getInstance().setWifiMode(WIFI_MODE_AP);
|
||||
if (softAP.channel == 0 || softAP.channel > MAX_CHNL_NO) {
|
||||
softAP.channel = 1;
|
||||
}
|
||||
softAP.max_connections = MAX_SOFTAP_CONNECTION_DEF;
|
||||
softAP.encryption_mode = softAP.pwd[0] == 0 ? WIFI_AUTH_OPEN : WIFI_AUTH_WPA_WPA2_PSK;
|
||||
softAP.bandwidth = WIFI_BW_HT40;
|
||||
softAP.ssid_hidden = false;
|
||||
int rv = CEspControl::getInstance().startSoftAccessPoint(softAP);
|
||||
if (rv != ESP_CONTROL_OK) {
|
||||
wifiStatus = WL_AP_FAILED;
|
||||
ethernet_arch_lwip_end();
|
||||
return false;
|
||||
}
|
||||
CEspControl::getInstance().getSoftAccessPointConfig(softAP);
|
||||
}
|
||||
ethernet_arch_lwip_end();
|
||||
uint8_t mac[6];
|
||||
if (!LwipIntfDev<ESPHost>::begin(macAddress(apMode, mac))) {
|
||||
ethernet_arch_lwip_begin();
|
||||
if (apMode) {
|
||||
CEspControl::getInstance().stopSoftAccessPoint();
|
||||
wifiStatus = WL_AP_FAILED;
|
||||
} else {
|
||||
CEspControl::getInstance().disconnectAccessPoint();
|
||||
wifiStatus = WL_CONNECT_FAILED;
|
||||
}
|
||||
ethernet_arch_lwip_end();
|
||||
return false;
|
||||
}
|
||||
if (apMode) {
|
||||
wifiStatus = WL_AP_LISTENING;
|
||||
} else {
|
||||
joined = true;
|
||||
wifiStatus = LwipIntfDev<ESPHost>::connected() ? WL_CONNECTED : WL_DISCONNECTED;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ESPHostLwIP::end() {
|
||||
LwipIntfDev<ESPHost>::end();
|
||||
if (apMode) {
|
||||
CEspControl::getInstance().stopSoftAccessPoint();
|
||||
} else {
|
||||
CEspControl::getInstance().disconnectAccessPoint();
|
||||
joined = false;
|
||||
}
|
||||
wifiStatus = WL_IDLE_STATUS;
|
||||
}
|
||||
|
||||
void ESPHostLwIP::onDisconnectEvent() {
|
||||
LwipIntfDev<ESPHost>::end();
|
||||
joined = false;
|
||||
wifiStatus = WL_CONNECTION_LOST;
|
||||
}
|
||||
|
||||
bool ESPHostLwIP::connected() {
|
||||
return (status() == WL_CONNECTED);
|
||||
}
|
||||
|
||||
uint8_t ESPHostLwIP::status() {
|
||||
initHW();
|
||||
if (joined && wifiStatus == WL_DISCONNECTED && LwipIntfDev<ESPHost>::connected()) {
|
||||
wifiStatus = WL_CONNECTED; // DHCP finished
|
||||
}
|
||||
return wifiStatus;
|
||||
}
|
||||
|
||||
uint8_t* ESPHostLwIP::macAddress(bool apMode, uint8_t *mac) {
|
||||
if (!initHW()) {
|
||||
return mac;
|
||||
}
|
||||
WifiMac_t MAC;
|
||||
MAC.mode = apMode ? WIFI_MODE_AP : WIFI_MODE_STA;
|
||||
ethernet_arch_lwip_begin();
|
||||
if (CEspControl::getInstance().getWifiMacAddress(MAC) == ESP_CONTROL_OK) {
|
||||
CNetUtilities::macStr2macArray(mac, MAC.mac);
|
||||
}
|
||||
ethernet_arch_lwip_end();
|
||||
return mac;
|
||||
}
|
||||
|
||||
uint8_t* ESPHostLwIP::BSSID(uint8_t *bssid) {
|
||||
CNetUtilities::macStr2macArray(bssid, (char*) ap.bssid);
|
||||
return bssid;
|
||||
}
|
||||
|
||||
int ESPHostLwIP::channel() {
|
||||
return ap.channel;
|
||||
}
|
||||
|
||||
int32_t ESPHostLwIP::RSSI() {
|
||||
if (!joined) {
|
||||
return 0;
|
||||
}
|
||||
ethernet_arch_lwip_begin();
|
||||
CEspControl::getInstance().getAccessPointConfig(ap);
|
||||
ethernet_arch_lwip_end();
|
||||
return ap.rssi;
|
||||
}
|
||||
|
||||
static uint8_t encr2wl_enc(int enc) {
|
||||
// the ESPHost returns authentication mode as encryption mode
|
||||
if (enc == WIFI_AUTH_OPEN) {
|
||||
return ENC_TYPE_NONE;
|
||||
} else if (enc == WIFI_AUTH_WEP) {
|
||||
return ENC_TYPE_WEP;
|
||||
} else if (enc == WIFI_AUTH_WPA_PSK) {
|
||||
return ENC_TYPE_WPA;
|
||||
} else if (enc == WIFI_AUTH_WPA2_PSK) {
|
||||
return ENC_TYPE_WPA2;
|
||||
} else if (enc == WIFI_AUTH_WPA_WPA2_PSK) {
|
||||
return ENC_TYPE_WPA2;
|
||||
} else if (enc == WIFI_AUTH_WPA3_PSK) {
|
||||
return ENC_TYPE_WPA3;
|
||||
} else if (enc == WIFI_AUTH_WPA2_WPA3_PSK) {
|
||||
return ENC_TYPE_WPA3;
|
||||
} else {
|
||||
return ENC_TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t ESPHostLwIP::encryptionType() {
|
||||
return encr2wl_enc(ap.encryption_mode);
|
||||
}
|
||||
|
||||
int8_t ESPHostLwIP::scanNetworks(bool async) {
|
||||
(void) async;
|
||||
accessPoints.clear();
|
||||
if (!initHW()) {
|
||||
return -1;
|
||||
}
|
||||
ethernet_arch_lwip_begin();
|
||||
int res = CEspControl::getInstance().getAccessPointScanList(accessPoints);
|
||||
ethernet_arch_lwip_end();
|
||||
wifiStatus = WL_SCAN_COMPLETED;
|
||||
if (res != ESP_CONTROL_OK) {
|
||||
return -1;
|
||||
}
|
||||
return accessPoints.size();
|
||||
}
|
||||
|
||||
int8_t ESPHostLwIP::scanComplete() {
|
||||
return accessPoints.size();
|
||||
}
|
||||
|
||||
void ESPHostLwIP::scanDelete() {
|
||||
accessPoints.clear();
|
||||
}
|
||||
|
||||
const char* ESPHostLwIP::SSID(uint8_t networkItem) {
|
||||
if (networkItem < accessPoints.size()) {
|
||||
return (const char*) accessPoints[networkItem].ssid;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8_t ESPHostLwIP::encryptionType(uint8_t networkItem) {
|
||||
if (networkItem < accessPoints.size()) {
|
||||
return encr2wl_enc(accessPoints[networkItem].encryption_mode);
|
||||
}
|
||||
return ENC_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
uint8_t* ESPHostLwIP::BSSID(uint8_t networkItem, uint8_t *bssid) {
|
||||
if (networkItem < accessPoints.size()) {
|
||||
CNetUtilities::macStr2macArray(bssid, (char*) accessPoints[networkItem].bssid);
|
||||
}
|
||||
return bssid;
|
||||
}
|
||||
|
||||
uint8_t ESPHostLwIP::channel(uint8_t networkItem) {
|
||||
if (networkItem < accessPoints.size()) {
|
||||
return accessPoints[networkItem].channel;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ESPHostLwIP::RSSI(uint8_t networkItem) {
|
||||
if (networkItem < accessPoints.size()) {
|
||||
return accessPoints[networkItem].rssi;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ESPHostLwIP::lowPowerMode() {
|
||||
if (!initHW()) {
|
||||
return;
|
||||
}
|
||||
ethernet_arch_lwip_begin();
|
||||
CEspControl::getInstance().setPowerSaveMode(1);
|
||||
ethernet_arch_lwip_end();
|
||||
}
|
||||
|
||||
void ESPHostLwIP::noLowPowerMode() {
|
||||
// not supported by firmware
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
WiFi <-> LWIP for ESPHost library in RP2040 Core
|
||||
|
||||
Copyright (c) 2024 Juraj Andrassy
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LwipIntfDev.h>
|
||||
#include "CCtrlWrapper.h"
|
||||
#include "ESPHost.h"
|
||||
|
||||
class ESPHostLwIP : public LwipIntfDev<ESPHost> {
|
||||
public:
|
||||
|
||||
void setSTA();
|
||||
void setAP();
|
||||
|
||||
void setSSID(const char *p);
|
||||
void setBSSID(const uint8_t *bssid);
|
||||
void setPassword(const char *p);
|
||||
void setChannel(uint8_t channel);
|
||||
|
||||
bool begin();
|
||||
void end();
|
||||
bool connected();
|
||||
uint8_t status();
|
||||
|
||||
uint8_t* macAddress(bool apMode, uint8_t *mac);
|
||||
|
||||
uint8_t* BSSID(uint8_t *bssid);
|
||||
int32_t RSSI();
|
||||
int channel();
|
||||
uint8_t encryptionType();
|
||||
|
||||
int8_t scanNetworks(bool async = false);
|
||||
int8_t scanComplete();
|
||||
void scanDelete();
|
||||
|
||||
const char* SSID(uint8_t networkItem);
|
||||
uint8_t encryptionType(uint8_t networkItem);
|
||||
uint8_t* BSSID(uint8_t networkItem, uint8_t *bssid);
|
||||
uint8_t channel(uint8_t networkItem);
|
||||
int32_t RSSI(uint8_t networkItem);
|
||||
|
||||
void lowPowerMode();
|
||||
void noLowPowerMode();
|
||||
|
||||
void setTimeout(int timeout);
|
||||
|
||||
private:
|
||||
static int initEventCb(CCtrlMsgWrapper *resp);
|
||||
static int disconnectEventCb(CCtrlMsgWrapper *resp);
|
||||
|
||||
static bool wifiHwInitialized;
|
||||
static ESPHostLwIP* instance;
|
||||
|
||||
bool initHW();
|
||||
void onDisconnectEvent();
|
||||
|
||||
uint32_t timeout = 10000;
|
||||
uint8_t wifiStatus = WL_NO_MODULE;
|
||||
WifiApCfg_t ap;
|
||||
bool joined = false;
|
||||
SoftApCfg_t softAP;
|
||||
|
||||
std::vector<AccessPoint_t> accessPoints;
|
||||
}
|
||||
;
|
||||
@@ -33,7 +33,6 @@ bool __ethernetContextInitted = false;
|
||||
static async_context_threadsafe_background_t lwip_ethernet_async_context_threadsafe_background;
|
||||
static async_when_pending_worker_t always_pending_update_timeout_worker;
|
||||
static async_at_time_worker_t ethernet_timeout_worker;
|
||||
|
||||
static async_context_t *_context = nullptr;
|
||||
|
||||
// Theoretically support multiple interfaces
|
||||
@@ -46,7 +45,7 @@ void ethernet_arch_lwip_begin() {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
async_context_acquire_lock_blocking(&lwip_ethernet_async_context_threadsafe_background.core);
|
||||
async_context_acquire_lock_blocking(_context);
|
||||
}
|
||||
|
||||
void ethernet_arch_lwip_end() {
|
||||
@@ -56,7 +55,7 @@ void ethernet_arch_lwip_end() {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
async_context_release_lock(&lwip_ethernet_async_context_threadsafe_background.core);
|
||||
async_context_release_lock(_context);
|
||||
}
|
||||
|
||||
int __addEthernetPacketHandler(std::function<void(void)> _packetHandler) {
|
||||
@@ -73,6 +72,45 @@ void __removeEthernetPacketHandler(int id) {
|
||||
ethernet_arch_lwip_end();
|
||||
}
|
||||
|
||||
#define GPIOSTACKSIZE 8
|
||||
static uint32_t gpioMaskStack[GPIOSTACKSIZE][4];
|
||||
static uint32_t gpioMask[4] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
|
||||
|
||||
void ethernet_arch_lwip_gpio_mask() {
|
||||
noInterrupts();
|
||||
memmove(gpioMaskStack[1], gpioMaskStack[0], 4 * sizeof(uint32_t) * (GPIOSTACKSIZE - 1)); // Push down the stack
|
||||
io_irq_ctrl_hw_t *irq_ctrl_base = get_core_num() ? &iobank0_hw->proc1_irq_ctrl : &iobank0_hw->proc0_irq_ctrl;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
gpioMaskStack[0][i] = irq_ctrl_base->inte[i];
|
||||
irq_ctrl_base->inte[i] = irq_ctrl_base->inte[i] & gpioMask[i];
|
||||
}
|
||||
interrupts();
|
||||
}
|
||||
|
||||
void ethernet_arch_lwip_gpio_unmask() {
|
||||
noInterrupts();
|
||||
io_irq_ctrl_hw_t *irq_ctrl_base = get_core_num() ? &iobank0_hw->proc1_irq_ctrl : &iobank0_hw->proc0_irq_ctrl;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
irq_ctrl_base->inte[i] = gpioMaskStack[0][i];
|
||||
}
|
||||
memmove(gpioMaskStack[0], gpioMaskStack[1], 4 * sizeof(uint32_t) * (GPIOSTACKSIZE - 1)); // Pop up the stack
|
||||
interrupts();
|
||||
}
|
||||
|
||||
// To be called after IRQ is set, so we can just rad from the IOREG instead of duplicating the calculation
|
||||
void __addEthernetGPIO(int pin) {
|
||||
int idx = pin / 8;
|
||||
int off = (pin % 8) * 4;
|
||||
gpioMask[idx] &= ~(0xf << off);
|
||||
}
|
||||
|
||||
void __removeEthernetGPIO(int pin) {
|
||||
int idx = pin / 8;
|
||||
int off = (pin % 8) * 4;
|
||||
gpioMask[idx] |= 0xf << off;
|
||||
}
|
||||
|
||||
|
||||
static volatile bool _dns_lookup_pending = false;
|
||||
|
||||
static void _dns_found_callback(const char *name, const ip_addr_t *ipaddr, void *callback_arg) {
|
||||
@@ -129,9 +167,13 @@ static async_context_t *lwip_ethernet_init_default_async_context(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32_t __ethernet_timeout_reached_calls = 0;
|
||||
static uint32_t _pollingPeriod = 20;
|
||||
// This will only be called under the protection of the async context mutex, so no re-entrancy checks needed
|
||||
static void ethernet_timeout_reached(__unused async_context_t *context, __unused async_at_time_worker_t *worker) {
|
||||
assert(worker == ðernet_timeout_worker);
|
||||
__ethernet_timeout_reached_calls++;
|
||||
ethernet_arch_lwip_gpio_mask(); // Ensure non-polled devices won't interrupt us
|
||||
for (auto handlePacket : _handlePacketList) {
|
||||
handlePacket.second();
|
||||
}
|
||||
@@ -142,9 +184,9 @@ static void ethernet_timeout_reached(__unused async_context_t *context, __unused
|
||||
#else
|
||||
sys_check_timeouts();
|
||||
#endif
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
}
|
||||
|
||||
static uint32_t _pollingPeriod = 20;
|
||||
static void update_next_timeout(async_context_t *context, async_when_pending_worker_t *worker) {
|
||||
assert(worker == &always_pending_update_timeout_worker);
|
||||
worker->work_pending = true;
|
||||
@@ -164,9 +206,9 @@ void __startEthernetContext() {
|
||||
#else
|
||||
_context = lwip_ethernet_init_default_async_context();
|
||||
#endif
|
||||
ethernet_timeout_worker.do_work = ethernet_timeout_reached;
|
||||
always_pending_update_timeout_worker.work_pending = true;
|
||||
always_pending_update_timeout_worker.do_work = update_next_timeout;
|
||||
ethernet_timeout_worker.do_work = ethernet_timeout_reached;
|
||||
async_context_add_when_pending_worker(_context, &always_pending_update_timeout_worker);
|
||||
__ethernetContextInitted = true;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
|
||||
void ethernet_arch_lwip_begin() __attribute__((weak));
|
||||
void ethernet_arch_lwip_end() __attribute__((weak));
|
||||
void ethernet_arch_lwip_gpio_mask() __attribute__((weak));
|
||||
void ethernet_arch_lwip_gpio_unmask() __attribute__((weak));
|
||||
|
||||
void __addEthernetGPIO(int pin);
|
||||
void __removeEthernetGPIO(int pin);
|
||||
|
||||
// Internal Ethernet helper functions
|
||||
void __startEthernetContext();
|
||||
|
||||
@@ -61,9 +61,14 @@ public:
|
||||
memset(&_netif, 0, sizeof(_netif));
|
||||
}
|
||||
|
||||
//The argument order for ESP is not the same as for Arduino. However, there is compatibility code under the hood
|
||||
//to detect Arduino arg order, and handle it correctly.
|
||||
bool config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2,
|
||||
const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
|
||||
|
||||
// two and one parameter version. 2nd parameter is DNS like in Arduino. IPv4 only
|
||||
bool config(IPAddress local_ip, IPAddress dns = IPADDR_NONE);
|
||||
|
||||
// default mac-address is inferred from esp8266's STA interface
|
||||
bool begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
|
||||
|
||||
@@ -73,6 +78,10 @@ public:
|
||||
return &_netif;
|
||||
}
|
||||
|
||||
uint8_t* macAddress(uint8_t* mac) {
|
||||
memcpy(mac, &_netif.hwaddr, 6);
|
||||
return mac;
|
||||
}
|
||||
IPAddress localIP() const {
|
||||
return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)));
|
||||
}
|
||||
@@ -82,6 +91,17 @@ public:
|
||||
IPAddress gatewayIP() const {
|
||||
return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw)));
|
||||
}
|
||||
IPAddress dnsIP(int n = 0) const {
|
||||
return IPAddress(dns_getserver(n));
|
||||
}
|
||||
void setDNS(IPAddress dns1, IPAddress dns2 = INADDR_ANY) {
|
||||
if (dns1.isSet()) {
|
||||
dns_setserver(0, dns1);
|
||||
}
|
||||
if (dns2.isSet()) {
|
||||
dns_setserver(1, dns2);
|
||||
}
|
||||
}
|
||||
|
||||
// 1. Currently when no default is set, esp8266-Arduino uses the first
|
||||
// DHCP client interface receiving a valid address and gateway to
|
||||
@@ -107,7 +127,7 @@ public:
|
||||
// ICMP echo, returns TTL
|
||||
int ping(IPAddress host, uint8_t ttl, uint32_t timeout = 5000);
|
||||
|
||||
int hostByName(const char* aHostname, IPAddress& aResult, int timeout);
|
||||
int hostByName(const char* aHostname, IPAddress& aResult, int timeout = 15000);
|
||||
|
||||
inline void setSPISpeed(int mhz) {
|
||||
setSPISettings(SPISettings(mhz, MSBFIRST, SPI_MODE0));
|
||||
@@ -117,6 +137,14 @@ public:
|
||||
_spiSettings = s;
|
||||
}
|
||||
|
||||
uint32_t packetsReceived() {
|
||||
return _packetsReceived;
|
||||
}
|
||||
uint32_t packetsSent() {
|
||||
return _packetsSent;
|
||||
}
|
||||
|
||||
|
||||
// ESP8266WiFi API compatibility
|
||||
|
||||
wl_status_t status();
|
||||
@@ -129,6 +157,7 @@ protected:
|
||||
static err_t netif_init_s(netif* netif);
|
||||
static err_t linkoutput_s(netif* netif, struct pbuf* p);
|
||||
static void netif_status_callback_s(netif* netif);
|
||||
static void _irq(void *param);
|
||||
public:
|
||||
// called on a regular basis or on interrupt
|
||||
err_t handlePackets();
|
||||
@@ -152,6 +181,9 @@ protected:
|
||||
|
||||
// Packet handler number
|
||||
int _phID = -1;
|
||||
|
||||
uint32_t _packetsReceived = 0;
|
||||
uint32_t _packetsSent = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -249,6 +281,24 @@ bool LwipIntfDev<RawDev>::config(const IPAddress& localIP, const IPAddress& gate
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class RawDev>
|
||||
bool LwipIntfDev<RawDev>::config(IPAddress local_ip, IPAddress dns) {
|
||||
|
||||
if (!local_ip.isSet()) {
|
||||
return config(INADDR_ANY, INADDR_ANY, INADDR_ANY);
|
||||
}
|
||||
if (!local_ip.isV4()) {
|
||||
return false;
|
||||
}
|
||||
IPAddress gw(local_ip);
|
||||
gw[3] = 1;
|
||||
if (!dns.isSet()) {
|
||||
dns = gw;
|
||||
}
|
||||
return config(local_ip, gw, IPAddress(255, 255, 255, 0), dns);
|
||||
}
|
||||
|
||||
extern char wifi_station_hostname[];
|
||||
template<class RawDev>
|
||||
bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
|
||||
@@ -310,7 +360,9 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_phID = __addEthernetPacketHandler(std::bind(&LwipIntfDev<RawDev>::handlePackets, this));
|
||||
if (_intrPin < 0) {
|
||||
_phID = __addEthernetPacketHandler([this] { this->handlePackets(); });
|
||||
}
|
||||
|
||||
if (localIP().v4() == 0) {
|
||||
// IP not set, starting DHCP
|
||||
@@ -337,6 +389,7 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
|
||||
#endif
|
||||
#if LWIP_IPV6_DHCP6_STATELESS
|
||||
err_t __res = dhcp6_enable_stateless(&_netif);
|
||||
(void) __res; // Not used except for debug
|
||||
DEBUGV("LwipIntfDev: Enabled DHCP6 stateless: %d\n", __res);
|
||||
#endif
|
||||
|
||||
@@ -344,7 +397,11 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
|
||||
|
||||
if (_intrPin >= 0) {
|
||||
if (RawDev::interruptIsPossible()) {
|
||||
// attachInterrupt(_intrPin, [&]() { this->handlePackets(); }, FALLING);
|
||||
noInterrupts(); // Ensure this is atomically set up
|
||||
pinMode(_intrPin, INPUT);
|
||||
attachInterruptParam(_intrPin, _irq, LOW, (void*)this);
|
||||
__addEthernetGPIO(_intrPin);
|
||||
interrupts();
|
||||
} else {
|
||||
::printf((PGM_P)F(
|
||||
"lwIP_Intf: Interrupt not implemented yet, enabling transparent polling\r\n"));
|
||||
@@ -357,15 +414,28 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
|
||||
|
||||
template<class RawDev>
|
||||
void LwipIntfDev<RawDev>::end() {
|
||||
__removeEthernetPacketHandler(_phID);
|
||||
if (_intrPin < 0) {
|
||||
__removeEthernetPacketHandler(_phID);
|
||||
} else {
|
||||
detachInterrupt(_intrPin);
|
||||
__removeEthernetGPIO(_intrPin);
|
||||
}
|
||||
|
||||
RawDev::end();
|
||||
|
||||
netif_remove(&_netif);
|
||||
memset(&_netif, 0, sizeof(_netif));
|
||||
|
||||
_started = false;
|
||||
}
|
||||
|
||||
template<class RawDev>
|
||||
void LwipIntfDev<RawDev>::_irq(void *param) {
|
||||
LwipIntfDev *d = static_cast<LwipIntfDev*>(param);
|
||||
ethernet_arch_lwip_begin();
|
||||
d->handlePackets();
|
||||
sys_check_timeouts();
|
||||
ethernet_arch_lwip_end();
|
||||
}
|
||||
|
||||
template<class RawDev>
|
||||
wl_status_t LwipIntfDev<RawDev>::status() {
|
||||
@@ -377,7 +447,7 @@ err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf) {
|
||||
LwipIntfDev* lid = (LwipIntfDev*)netif->state;
|
||||
ethernet_arch_lwip_begin();
|
||||
uint16_t len = lid->sendFrame((const uint8_t*)pbuf->payload, pbuf->len);
|
||||
|
||||
lid->_packetsSent++;
|
||||
#if PHY_HAS_CAPTURE
|
||||
if (phy_capture) {
|
||||
phy_capture(lid->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/ 1,
|
||||
@@ -491,6 +561,8 @@ err_t LwipIntfDev<RawDev>::handlePackets() {
|
||||
return ERR_BUF;
|
||||
}
|
||||
|
||||
_packetsReceived++;
|
||||
|
||||
err_t err = _netif.input(pbuf, &_netif);
|
||||
|
||||
#if PHY_HAS_CAPTURE
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <LwipEthernet.h>
|
||||
|
||||
#include "enc28j60.h"
|
||||
|
||||
@@ -68,6 +69,9 @@
|
||||
#define ECON2_AUTOINC 0x80
|
||||
#define ECON2_PKTDEC 0x40
|
||||
|
||||
#define EIE_PKTIE 0x40
|
||||
#define EIE_INTIE 0x80
|
||||
|
||||
#define EIR_TXIF 0x08
|
||||
|
||||
#define ERXTX_BANK 0x00
|
||||
@@ -152,8 +156,7 @@
|
||||
// The ENC28J60 SPI Interface supports clock speeds up to 20 MHz
|
||||
static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
|
||||
|
||||
ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) : _bank(ERXTX_BANK), _cs(cs), _spi(spi) {
|
||||
(void)intr;
|
||||
ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) : _bank(ERXTX_BANK), _cs(cs), _intr(intr), _spi(spi) {
|
||||
}
|
||||
|
||||
void ENC28J60::enc28j60_arch_spi_select(void) {
|
||||
@@ -487,6 +490,12 @@ bool ENC28J60::reset(void) {
|
||||
/* Turn on autoincrement for buffer access */
|
||||
setregbitfield(ECON2, ECON2_AUTOINC);
|
||||
|
||||
/* Enable interrupt on packet receive if desired */
|
||||
if (_intr >= 0) {
|
||||
setregbitfield(EIE, EIE_PKTIE);
|
||||
setregbitfield(EIE, EIE_INTIE);
|
||||
}
|
||||
|
||||
/* Turn on reception */
|
||||
writereg(ECON1, ECON1_RXEN);
|
||||
|
||||
@@ -510,6 +519,8 @@ bool ENC28J60::begin(const uint8_t* address, netif *net) {
|
||||
uint16_t ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen) {
|
||||
uint16_t dataend;
|
||||
|
||||
ethernet_arch_lwip_gpio_mask(); // So we don't fire an IRQ and interrupt the send w/a receive!
|
||||
|
||||
/*
|
||||
1. Appropriately program the ETXST pointer to point to an unused
|
||||
location in memory. It will point to the per packet control
|
||||
@@ -581,6 +592,8 @@ uint16_t ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen) {
|
||||
}
|
||||
#endif
|
||||
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
|
||||
// sent_packets++;
|
||||
// PRINTF("enc28j60: sent_packets %d\n", sent_packets);
|
||||
return datalen;
|
||||
@@ -696,6 +709,8 @@ uint16_t ENC28J60::phyread(uint8_t reg) {
|
||||
|
||||
bool ENC28J60::isLinked() {
|
||||
// ( https://github.com/JAndrassy/EthernetENC/tree/master/src/utility/enc28j60.h )
|
||||
|
||||
return !!(phyread(MACSTAT2) & 0x400);
|
||||
ethernet_arch_lwip_begin();
|
||||
auto ret = !!(phyread(MACSTAT2) & 0x400);
|
||||
ethernet_arch_lwip_end();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
netif *_netif;
|
||||
protected:
|
||||
static constexpr bool interruptIsPossible() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +154,7 @@ private:
|
||||
|
||||
uint8_t _bank;
|
||||
int8_t _cs;
|
||||
int8_t _intr;
|
||||
SPIClass& _spi;
|
||||
|
||||
const uint8_t* _localMac;
|
||||
|
||||
@@ -8,14 +8,21 @@
|
||||
const char* host = "djxmmx.net";
|
||||
const uint16_t port = 17;
|
||||
|
||||
#ifdef ARDUINO_WIZNET_5100S_EVB_PICO
|
||||
// To use Interrupt-driven mode, pass in an SPI object and an IRQ pin like so:
|
||||
Wiznet5100lwIP eth(17, SPI, 21);
|
||||
#else
|
||||
Wiznet5100lwIP eth(1 /* chip select */);
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
#ifndef ARDUINO_WIZNET_5100S_EVB_PICO
|
||||
// Set up SPI pinout to match your HW
|
||||
SPI.setRX(0);
|
||||
SPI.setCS(1);
|
||||
SPI.setSCK(2);
|
||||
SPI.setTX(3);
|
||||
#endif
|
||||
|
||||
Serial.begin(115200);
|
||||
delay(5000);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <SPI.h>
|
||||
#include "w5100.h"
|
||||
#include <LwipEthernet.h>
|
||||
|
||||
uint8_t Wiznet5100::wizchip_read(uint16_t address) {
|
||||
uint8_t ret;
|
||||
@@ -178,8 +179,7 @@ void Wiznet5100::wizchip_sw_reset() {
|
||||
setSHAR(_mac_address);
|
||||
}
|
||||
|
||||
Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) : _spi(spi), _cs(cs) {
|
||||
(void)intr;
|
||||
Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) : _spi(spi), _cs(cs), _intr(intr) {
|
||||
}
|
||||
|
||||
bool Wiznet5100::begin(const uint8_t* mac_address, netif *net) {
|
||||
@@ -189,13 +189,6 @@ bool Wiznet5100::begin(const uint8_t* mac_address, netif *net) {
|
||||
pinMode(_cs, OUTPUT);
|
||||
wizchip_cs_deselect();
|
||||
|
||||
#if 0
|
||||
_spi.begin();
|
||||
_spi.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz?
|
||||
_spi.setBitOrder(MSBFIRST);
|
||||
_spi.setDataMode(SPI_MODE0);
|
||||
#endif
|
||||
|
||||
wizchip_sw_reset();
|
||||
|
||||
// Set the size of the Rx and Tx buffers
|
||||
@@ -213,6 +206,11 @@ bool Wiznet5100::begin(const uint8_t* mac_address, netif *net) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_intr >= 0) {
|
||||
setSn_IR(0xff); // Clear everything
|
||||
setIMR(IM_IR0);
|
||||
}
|
||||
|
||||
// Success
|
||||
return true;
|
||||
}
|
||||
@@ -245,6 +243,8 @@ uint16_t Wiznet5100::readFrame(uint8_t* buffer, uint16_t bufsize) {
|
||||
}
|
||||
|
||||
uint16_t Wiznet5100::readFrameSize() {
|
||||
setSn_IR(Sn_IR_RECV);
|
||||
|
||||
uint16_t len = getSn_RX_RSR();
|
||||
|
||||
if (len == 0) {
|
||||
@@ -273,25 +273,18 @@ uint16_t Wiznet5100::readFrameData(uint8_t* buffer, uint16_t framesize) {
|
||||
wizchip_recv_data(buffer, framesize);
|
||||
setSn_CR(Sn_CR_RECV);
|
||||
|
||||
#if 1
|
||||
// let lwIP deal with mac address filtering
|
||||
return framesize;
|
||||
#else
|
||||
// W5100 doesn't have any built-in MAC address filtering
|
||||
if ((buffer[0] & 0x01) || memcmp(&buffer[0], _mac_address, 6) == 0) {
|
||||
// Addressed to an Ethernet multicast address or our unicast address
|
||||
return framesize;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint16_t Wiznet5100::sendFrame(const uint8_t* buf, uint16_t len) {
|
||||
ethernet_arch_lwip_gpio_mask(); // So we don't fire an IRQ and interrupt the send w/a receive!
|
||||
|
||||
// Wait for space in the transmit buffer
|
||||
while (1) {
|
||||
uint16_t freesize = getSn_TX_FSR();
|
||||
if (getSn_SR() == SOCK_CLOSED) {
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
return -1;
|
||||
}
|
||||
if (len <= freesize) {
|
||||
@@ -311,9 +304,11 @@ uint16_t Wiznet5100::sendFrame(const uint8_t* buf, uint16_t len) {
|
||||
} else if (tmp & Sn_IR_TIMEOUT) {
|
||||
setSn_IR(Sn_IR_TIMEOUT);
|
||||
// There was a timeout
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
netif *_netif;
|
||||
protected:
|
||||
static constexpr bool interruptIsPossible() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,6 +144,7 @@ private:
|
||||
|
||||
SPIClass& _spi;
|
||||
int8_t _cs;
|
||||
int8_t _intr;
|
||||
uint8_t _mac_address[6];
|
||||
|
||||
/**
|
||||
@@ -308,6 +309,17 @@ private:
|
||||
MR_IND = 0x01, ///< Indirect Bus Interface mode
|
||||
};
|
||||
|
||||
/** Interrupt Mask register values */
|
||||
enum {
|
||||
IM_IR0 = 0x01, ///< Occurrence of Socket 0 Socket Interrupt Enable
|
||||
IM_IR1 = 0x02, ///< Occurrence of Socket 1 Socket Interrupt Enable
|
||||
IM_IR2 = 0x04, ///< Occurrence of Socket 2 Socket Interrupt Enable
|
||||
IM_IR3 = 0x08, ///< Occurrence of Socket 3 Socket Interrupt Enable
|
||||
IM_IR5 = 0x20, ///< PPPoE Close Enable
|
||||
IM_IR6 = 0x40, ///< Destination unreachable Enable
|
||||
IM_IR7 = 0x80, ///< IP Conflict Enable
|
||||
};
|
||||
|
||||
/** Socket Mode Register values @ref Sn_MR */
|
||||
enum {
|
||||
Sn_MR_CLOSE = 0x00, ///< Unused socket
|
||||
@@ -375,6 +387,24 @@ private:
|
||||
return wizchip_read(MR);
|
||||
}
|
||||
|
||||
/**
|
||||
Set Interrupt Mask Register
|
||||
@param (uint8_t)mr The value to be set.
|
||||
@sa geIMR()
|
||||
*/
|
||||
inline void setIMR(uint8_t mode) {
|
||||
wizchip_write(IMR, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
Get Mode Register
|
||||
@return uint8_t. The value of Mode register.
|
||||
@sa setIMR()
|
||||
*/
|
||||
inline uint8_t getIMR() {
|
||||
return wizchip_read(IMR);
|
||||
}
|
||||
|
||||
/**
|
||||
Set local MAC address
|
||||
@param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <SPI.h>
|
||||
#include "w5500.h"
|
||||
#include <LwipEthernet.h>
|
||||
|
||||
uint8_t Wiznet5500::wizchip_read(uint8_t block, uint16_t address) {
|
||||
uint8_t ret;
|
||||
@@ -238,8 +239,7 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) : _spi(spi), _cs(cs) {
|
||||
(void)intr;
|
||||
Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) : _spi(spi), _cs(cs), _intr(intr) {
|
||||
}
|
||||
|
||||
bool Wiznet5500::begin(const uint8_t* mac_address, netif *net) {
|
||||
@@ -249,13 +249,6 @@ bool Wiznet5500::begin(const uint8_t* mac_address, netif *net) {
|
||||
pinMode(_cs, OUTPUT);
|
||||
wizchip_cs_deselect();
|
||||
|
||||
#if 0
|
||||
_spi.begin();
|
||||
_spi.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz?
|
||||
_spi.setBitOrder(MSBFIRST);
|
||||
_spi.setDataMode(SPI_MODE0);
|
||||
#endif
|
||||
|
||||
wizchip_sw_reset();
|
||||
|
||||
// Use the full 16Kb of RAM for Socket 0
|
||||
@@ -273,6 +266,11 @@ bool Wiznet5500::begin(const uint8_t* mac_address, netif *net) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_intr >= 0) {
|
||||
setSn_IR(0xff); // Clear everything
|
||||
setSIMR(1);
|
||||
}
|
||||
|
||||
// Success
|
||||
return true;
|
||||
}
|
||||
@@ -305,6 +303,8 @@ uint16_t Wiznet5500::readFrame(uint8_t* buffer, uint16_t bufsize) {
|
||||
}
|
||||
|
||||
uint16_t Wiznet5500::readFrameSize() {
|
||||
setSn_IR(Sn_IR_RECV);
|
||||
|
||||
uint16_t len = getSn_RX_RSR();
|
||||
|
||||
if (len == 0) {
|
||||
@@ -333,26 +333,18 @@ uint16_t Wiznet5500::readFrameData(uint8_t* buffer, uint16_t framesize) {
|
||||
wizchip_recv_data(buffer, framesize);
|
||||
setSn_CR(Sn_CR_RECV);
|
||||
|
||||
#if 1
|
||||
// let lwIP deal with mac address filtering
|
||||
return framesize;
|
||||
#else
|
||||
// Had problems with W5500 MAC address filtering (the Sn_MR_MFEN option)
|
||||
// Do it in software instead:
|
||||
if ((buffer[0] & 0x01) || memcmp(&buffer[0], _mac_address, 6) == 0) {
|
||||
// Addressed to an Ethernet multicast address or our unicast address
|
||||
return framesize;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint16_t Wiznet5500::sendFrame(const uint8_t* buf, uint16_t len) {
|
||||
ethernet_arch_lwip_gpio_mask(); // So we don't fire an IRQ and interrupt the send w/a receive!
|
||||
|
||||
// Wait for space in the transmit buffer
|
||||
while (1) {
|
||||
uint16_t freesize = getSn_TX_FSR();
|
||||
if (getSn_SR() == SOCK_CLOSED) {
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
return -1;
|
||||
}
|
||||
if (len <= freesize) {
|
||||
@@ -372,9 +364,11 @@ uint16_t Wiznet5500::sendFrame(const uint8_t* buf, uint16_t len) {
|
||||
} else if (tmp & Sn_IR_TIMEOUT) {
|
||||
setSn_IR(Sn_IR_TIMEOUT);
|
||||
// There was a timeout
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
ethernet_arch_lwip_gpio_unmask();
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <stdint.h>
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
#include <LwipEthernet.h>
|
||||
|
||||
class Wiznet5500 {
|
||||
public:
|
||||
@@ -83,7 +84,10 @@ public:
|
||||
@return true when physical link is up
|
||||
*/
|
||||
bool isLinked() {
|
||||
return wizphy_getphylink() == PHY_LINK_ON;
|
||||
ethernet_arch_lwip_begin();
|
||||
auto ret = wizphy_getphylink() == PHY_LINK_ON;
|
||||
ethernet_arch_lwip_end();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,7 +104,7 @@ public:
|
||||
|
||||
protected:
|
||||
static constexpr bool interruptIsPossible() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,6 +152,7 @@ private:
|
||||
|
||||
SPIClass& _spi;
|
||||
int8_t _cs;
|
||||
int8_t _intr;
|
||||
uint8_t _mac_address[6];
|
||||
|
||||
/**
|
||||
@@ -267,7 +272,7 @@ private:
|
||||
/**
|
||||
set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in
|
||||
W5200
|
||||
@param pmode Settig value of power down mode.
|
||||
@param pmode Setting value of power down mode.
|
||||
*/
|
||||
int8_t wizphy_setphypmode(uint8_t pmode);
|
||||
|
||||
@@ -315,7 +320,7 @@ private:
|
||||
IR = 0x0015, ///< Interrupt Register (R/W)
|
||||
_IMR_ = 0x0016, ///< Interrupt mask register (R/W)
|
||||
SIR = 0x0017, ///< Socket Interrupt Register (R/W)
|
||||
SIMR = 0x0018, ///< Socket Interrupt Mask Register (R/W)
|
||||
_SIMR_ = 0x0018, ///< Socket Interrupt Mask Register (R/W)
|
||||
_RTR_ = 0x0019, ///< Timeout register address (1 is 100us) (R/W)
|
||||
_RCR_ = 0x001B, ///< Retry count register (R/W)
|
||||
UIPR = 0x0028, ///< Unreachable IP register address in UDP mode (R)
|
||||
@@ -432,7 +437,7 @@ private:
|
||||
/* PHYCFGR register value */
|
||||
enum {
|
||||
PHYCFGR_RST = ~(1 << 7), //< For PHY reset, must operate AND mask.
|
||||
PHYCFGR_OPMD = (1 << 6), // Configre PHY with OPMDC value
|
||||
PHYCFGR_OPMD = (1 << 6), // Configure PHY with OPMDC value
|
||||
PHYCFGR_OPMDC_ALLA = (7 << 3),
|
||||
PHYCFGR_OPMDC_PDOWN = (6 << 3),
|
||||
PHYCFGR_OPMDC_NA = (5 << 3),
|
||||
@@ -516,6 +521,24 @@ private:
|
||||
return wizchip_read(BlockSelectCReg, IR) & 0xF0;
|
||||
}
|
||||
|
||||
/**
|
||||
Set @ref SIR register
|
||||
@param (uint8_t)ir Value to set @ref SIR register.
|
||||
@sa getSIR()
|
||||
*/
|
||||
inline void setSIR(uint8_t ir) {
|
||||
wizchip_write(BlockSelectCReg, SIR, ir);
|
||||
}
|
||||
|
||||
/**
|
||||
Get @ref SIR register
|
||||
@return uint8_t. Value of @ref SIR register.
|
||||
@sa setSIR()
|
||||
*/
|
||||
inline uint8_t getSIR() {
|
||||
return wizchip_read(BlockSelectCReg, SIR);
|
||||
}
|
||||
|
||||
/**
|
||||
Set @ref _IMR_ register
|
||||
@param (uint8_t)imr Value to set @ref _IMR_ register.
|
||||
@@ -534,6 +557,24 @@ private:
|
||||
return wizchip_read(BlockSelectCReg, _IMR_);
|
||||
}
|
||||
|
||||
/**
|
||||
Set @ref _SIMR_ register
|
||||
@param (uint8_t)imr Value to set @ref _SIMR_ register.
|
||||
@sa getIMR()
|
||||
*/
|
||||
inline void setSIMR(uint8_t imr) {
|
||||
wizchip_write(BlockSelectCReg, _SIMR_, imr);
|
||||
}
|
||||
|
||||
/**
|
||||
Get @ref _SIMR_ register
|
||||
@return uint8_t. Value of @ref _SIMR_ register.
|
||||
@sa setSIMR()
|
||||
*/
|
||||
inline uint8_t getSIMR() {
|
||||
return wizchip_read(BlockSelectCReg, _SIMR_);
|
||||
}
|
||||
|
||||
/**
|
||||
Set @ref PHYCFGR register
|
||||
@param (uint8_t)phycfgr Value to set @ref PHYCFGR register.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "framework-arduinopico",
|
||||
"version": "1.30600.0",
|
||||
"version": "1.30701.0",
|
||||
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
||||
@@ -86,15 +86,24 @@
|
||||
{
|
||||
"name": "Cytron Maker Pi RP2040"
|
||||
},
|
||||
{
|
||||
"name": "Cytron Maker Uno RP2040"
|
||||
},
|
||||
{
|
||||
"name": "DatanoiseTV PicoADK"
|
||||
},
|
||||
{
|
||||
"name": "Degz Robotics Suibo RP2040"
|
||||
},
|
||||
{
|
||||
"name": "DeRuiLab FlyBoard2040Core"
|
||||
},
|
||||
{
|
||||
"name": "DFRobot Beetle RP2040"
|
||||
},
|
||||
{
|
||||
"name": "L'atelier d'Arnoz DudesCab"
|
||||
},
|
||||
{
|
||||
"name": "ElectronicCats HunterCat NFC RP2040"
|
||||
},
|
||||
@@ -131,6 +140,9 @@
|
||||
{
|
||||
"name": "iLabs Challenger 2040 UWB"
|
||||
},
|
||||
{
|
||||
"name": "iLabs Connectivity 2040 LTE/WiFi/BLE"
|
||||
},
|
||||
{
|
||||
"name": "iLabs RPICO32"
|
||||
},
|
||||
@@ -155,6 +167,18 @@
|
||||
{
|
||||
"name": "Pimoroni Tiny2040"
|
||||
},
|
||||
{
|
||||
"name": "RAKwireless RAK11300"
|
||||
},
|
||||
{
|
||||
"name": "redscorp RP2040-Eins"
|
||||
},
|
||||
{
|
||||
"name": "redscorp RP2040-ProMini"
|
||||
},
|
||||
{
|
||||
"name": "Generic Sea-Picro"
|
||||
},
|
||||
{
|
||||
"name": "Silicognition RP2040-Shim"
|
||||
},
|
||||
@@ -209,9 +233,6 @@
|
||||
{
|
||||
"name": "WIZnet W5500-EVB-Pico"
|
||||
},
|
||||
{
|
||||
"name": "redscorp RP2040-ProMini"
|
||||
},
|
||||
{
|
||||
"name": "Generic RP2040"
|
||||
}
|
||||
@@ -219,22 +240,22 @@
|
||||
"toolsDependencies": [
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-gcc"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-mklittlefs"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-elf2uf2"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-pioasm"
|
||||
},
|
||||
{
|
||||
@@ -244,12 +265,12 @@
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-openocd"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-picotool"
|
||||
}
|
||||
],
|
||||
@@ -260,112 +281,126 @@
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-picotool",
|
||||
"systems": [
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/picotool.macosarm.tar.gz",
|
||||
"archiveFileName": "picotool.macosarm.tar.gz",
|
||||
"checksum": "SHA-256:6b9d28dee6f3c67ab705ff1bc9bd96de3fcb7f1d73753a0e802999b408d39011",
|
||||
"size": "174728"
|
||||
},
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/aarch64-linux-gnu.picotool-f6fe6b7.230911.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.picotool-f6fe6b7.230911.tar.gz",
|
||||
"checksum": "SHA-256:95192ab12bbe99eb64b7c50c883e971b306e1fc0fc43738ff2a6ffaf8e684325",
|
||||
"size": "172728"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
|
||||
"checksum": "SHA-256:3d3aec025f74e146d9d27b3a64604fa271ac6a25dc8bf61855035c75829f55c0",
|
||||
"size": "179609"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/arm-linux-gnueabihf.picotool-f6fe6b7.230911.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.picotool-f6fe6b7.230911.tar.gz",
|
||||
"checksum": "SHA-256:734b30df29b884de711bc9eb1859a44275c02c7d2c067259070a5abadb2e4dd1",
|
||||
"size": "153317"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.picotool-f6fe6b7.240125.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.picotool-f6fe6b7.240125.tar.gz",
|
||||
"checksum": "SHA-256:d2ea134a0dfea2a5d0ab4bc206f1a823e9bff632218e5476b56acbb3f4c99837",
|
||||
"size": "168619"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-linux-gnu.picotool-f6fe6b7.230911.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.picotool-f6fe6b7.230911.tar.gz",
|
||||
"checksum": "SHA-256:f8cceebdf270beba3d5282ec30911bc8cd1c2afc4733772fd2b32ba8c62d87a8",
|
||||
"size": "184349"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
|
||||
"checksum": "SHA-256:56ebf53f6ce0748faca2fc06c05bad9cb8bfcb429f5c4336e56738f344b99e38",
|
||||
"size": "202882"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-w64-mingw32.picotool-f6fe6b7.230911.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.picotool-f6fe6b7.230911.zip",
|
||||
"checksum": "SHA-256:8059eb1b0c41fad5ec6da06a731f19e7d25ce21684679d9975311ecb66e0aca6",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.picotool-f6fe6b7.240125.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.picotool-f6fe6b7.240125.zip",
|
||||
"checksum": "SHA-256:f8a1ea6f0ea863b74a26b155fca780f24403f1069921e965f904ceac3d328dd5",
|
||||
"size": "292401"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-apple-darwin15.picotool-f6fe6b7.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.picotool-f6fe6b7.230911.tar.gz",
|
||||
"checksum": "SHA-256:01813cb827a33de73ac46450f9525855b483269b6248a5c9d123d4771b78e5d7",
|
||||
"size": "845993"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.picotool-f6fe6b7.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin20.4.picotool-f6fe6b7.240125.tar.gz",
|
||||
"checksum": "SHA-256:b04fccd0416cfa753d1e2dd431b7bfc24a971819eab255eaec2a3e7d76c5966f",
|
||||
"size": "167079"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-linux-gnu.picotool-f6fe6b7.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.picotool-f6fe6b7.230911.tar.gz",
|
||||
"checksum": "SHA-256:1282e7ff7985537cac549eaa8b1e4107f5e27f8a1b99b56c5b239a6e1545e6b0",
|
||||
"size": "131937"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.picotool-f6fe6b7.240125.tar.gz",
|
||||
"checksum": "SHA-256:ba7c3a168fe7813de9645f64f22fbdbf81841412550338df02c0e20701caee66",
|
||||
"size": "192471"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-w64-mingw32.picotool-f6fe6b7.230911.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.picotool-f6fe6b7.230911.zip",
|
||||
"checksum": "SHA-256:08e516df547aaf42d808584e3f7f95b2c91966721f8dc377a772f67eb7b2baa4",
|
||||
"size": "277242"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.picotool-f6fe6b7.240125.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.picotool-f6fe6b7.240125.zip",
|
||||
"checksum": "SHA-256:0e75f683223b5237051d1a1e47917f2b37b2b3a8ac11e516a0020dffbd49d3bd",
|
||||
"size": "277241"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-openocd",
|
||||
"systems": [
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/openocd.macosarm.tar.gz",
|
||||
"archiveFileName": "openocd.macosarm.tar.gz",
|
||||
"checksum": "SHA-256:585128f38286c0026f0c3d3d14aab098282ef0958882226907fefb1824ddd350",
|
||||
"size": "1877283"
|
||||
},
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/aarch64-linux-gnu.openocd-4d87f6dca.230911.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.openocd-4d87f6dca.230911.tar.gz",
|
||||
"checksum": "SHA-256:ca0e58739a5af5d4726668e6613fe9ec21c04d28eb857a640638ca94860b9229",
|
||||
"size": "6440041"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
|
||||
"checksum": "SHA-256:470bedcfc7e26006e3789439b7c3806e0ee4e715e28330c4e3a48a19c6efbefa",
|
||||
"size": "7439489"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/arm-linux-gnueabihf.openocd-4d87f6dca.230911.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.openocd-4d87f6dca.230911.tar.gz",
|
||||
"checksum": "SHA-256:0acb02f16080fdd0d1cb5e89708a9df954d2ba97a6fc7e963bbc8e27ff92c786",
|
||||
"size": "6156659"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.openocd-4d87f6dca.240125.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.openocd-4d87f6dca.240125.tar.gz",
|
||||
"checksum": "SHA-256:d086bfc425829984d9257e5629277ae8eb4dff780ef3e92d292b132764246ed2",
|
||||
"size": "7256877"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-linux-gnu.openocd-4d87f6dca.230911.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.openocd-4d87f6dca.230911.tar.gz",
|
||||
"checksum": "SHA-256:a2db908d408949dea7785e062eeb1226465378590e54ae3561d31cb859ef2b7a",
|
||||
"size": "5960505"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
|
||||
"checksum": "SHA-256:06e97a31d77ed690767eaf579f7be8e295dec4eecbbe504650726631d94379e6",
|
||||
"size": "6978839"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-w64-mingw32.openocd-4d87f6dca.230911.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.openocd-4d87f6dca.230911.zip",
|
||||
"checksum": "SHA-256:2205a5746f869170448ee9fda68aa8388f3cb030a5e2a3847c502840f56ad33c",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.openocd-4d87f6dca.240125.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.openocd-4d87f6dca.240125.zip",
|
||||
"checksum": "SHA-256:0151d237bb7d4418130346d9296daee2a903bad93ca0fd676db2e0ecc3742b4c",
|
||||
"size": "2468166"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-apple-darwin15.openocd-4d87f6dca.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.openocd-4d87f6dca.230911.tar.gz",
|
||||
"checksum": "SHA-256:cb44314cb64316e91cf45c5623319751706bd94ad734a322af243b77f8eb2328",
|
||||
"size": "2801625"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.openocd-4d87f6dca.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin20.4.openocd-4d87f6dca.240125.tar.gz",
|
||||
"checksum": "SHA-256:c37f3f1222b2b5614d09a08ed820a27f79be78daa699884abfa26da9f96b2126",
|
||||
"size": "3083387"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-linux-gnu.openocd-4d87f6dca.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.openocd-4d87f6dca.230911.tar.gz",
|
||||
"checksum": "SHA-256:327f80305ab5d02162bc5b88b1bdf05a41bfe6717b8a27153d62cad60f88a19c",
|
||||
"size": "6355683"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.openocd-4d87f6dca.240125.tar.gz",
|
||||
"checksum": "SHA-256:cf7163e0c3981cd1025a3eba64dda1ea02cc8042f340ae2740c89c1048b55f20",
|
||||
"size": "7454235"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-w64-mingw32.openocd-4d87f6dca.230911.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.openocd-4d87f6dca.230911.zip",
|
||||
"checksum": "SHA-256:99e6b543fd648f033299b6a49e1895e75c720386b1d31d1574fab973689937f5",
|
||||
"size": "2412179"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.openocd-4d87f6dca.240125.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.openocd-4d87f6dca.240125.zip",
|
||||
"checksum": "SHA-256:a15ba6f4a8054ca787c5ec47ce9a866b033667bbbf3dcbd0941a55539b2fbe37",
|
||||
"size": "2412178"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -422,6 +457,13 @@
|
||||
"checksum": "SHA-256:01a5bf1fa264c6f04cfaadf4c6e9f6caaacb6833ef40104dfbe953fcdb9bca1c",
|
||||
"size": "25494144"
|
||||
},
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/python3.18-portable-darwin_arm64.tar.gz",
|
||||
"archiveFileName": "python3.18-portable-darwin_arm64.tar.gz",
|
||||
"checksum": "SHA-256:ac6ee694191ac4db770e147429a7606b50063110db9ccbaf46e0e5ff8f7dcd20",
|
||||
"size": "90294119"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.0.1-base/python3-via-env.tar.gz",
|
||||
@@ -432,222 +474,250 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-gcc",
|
||||
"systems": [
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.arm-none-eabi-d04e724.240127.tar.gz",
|
||||
"archiveFileName": "aarch64-apple-darwin20.4.arm-none-eabi-d04e724.240127.tar.gz",
|
||||
"checksum": "SHA-256:f70431e62a1d64b43d8730911be6b6f18ece3b91a216ce6c40d5318ad263756f",
|
||||
"size": "86285430"
|
||||
},
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/aarch64-linux-gnu.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"checksum": "SHA-256:248690d021b9da120ecf459972b35aba03b051b6cae6c7215fa7450c5e5c1ea4",
|
||||
"size": "92005838"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"checksum": "SHA-256:752be9aebf0f040794232a331bd6fd17a8843f7ebe819c73e728d1a9fe8de3c3",
|
||||
"size": "93501390"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/arm-linux-gnueabihf.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"checksum": "SHA-256:fea1f309249344a6ff09e965e2e4e35aa6c51dbf46fb2cbd18c8efe37f7b6974",
|
||||
"size": "85920067"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"checksum": "SHA-256:494dc88980d0f1e2cc0ac10f0bd3adb5d6964cc31b43f44a14b8a167781a0316",
|
||||
"size": "87330830"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-linux-gnu.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"checksum": "SHA-256:01f0cde4760ddfe1614f30c42b50153d392971edaec9a356bdb525c472441b44",
|
||||
"size": "94592210"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"checksum": "SHA-256:b00b8e138886c7957b28615762285c70b8ac84172c32b189a673bc33c2f29e2d",
|
||||
"size": "96150883"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-w64-mingw32.arm-none-eabi-d3d2e6b.230911-v2.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-d3d2e6b.230911-v2.zip",
|
||||
"checksum": "SHA-256:cbda04d0327c963504c1c71bfbfd2f6fb27ca964e2004704108939a7716cb7a4",
|
||||
"size": "99150816"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.arm-none-eabi-d04e724.240125.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-d04e724.240125.zip",
|
||||
"checksum": "SHA-256:f9b35511c2385b9351f70d5503b1e7f86ab4e47035402749ea7220175c9bf7fa",
|
||||
"size": "102603587"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-apple-darwin15.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"checksum": "SHA-256:7e8a6fb52b947850fcb10f5c6bf7e26d08edab060ac42237d3d7739f6b226400",
|
||||
"size": "97134440"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin20.4.arm-none-eabi-d04e724.240125.tar.gz",
|
||||
"checksum": "SHA-256:a2d9ea24986973c31082b35ada0fe9d1577167e6a68a908b69aa6d99490b2499",
|
||||
"size": "97543047"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-linux-gnu.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-d3d2e6b.230911.tar.gz",
|
||||
"checksum": "SHA-256:4bbf08c2c529e76763cf29be7580f55f4932d691cb0090e41e9d7f22ede8612d",
|
||||
"size": "94544555"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.arm-none-eabi-028e019.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-028e019.240125.tar.gz",
|
||||
"checksum": "SHA-256:447951503effc0238cdc83b23b5253909b4b9d9f1175f4cc6c29169927fa0964",
|
||||
"size": "96301885"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-w64-mingw32.arm-none-eabi-d3d2e6b.230911-v2.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-d3d2e6b.230911-v2.zip",
|
||||
"checksum": "SHA-256:97dda385e4c20a228bfe59b8d61ebb23f2f419e9ebd4d04fb57980a6a1e6edd2",
|
||||
"size": "102620481"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.arm-none-eabi-d04e724.240125.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-d04e724.240125.zip",
|
||||
"checksum": "SHA-256:f8f79b3da6b4997dc30c91689e6aeb126a37eb034b51c9f9356b382f1982c075",
|
||||
"size": "106485317"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-elf2uf2",
|
||||
"systems": [
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.elf2uf2-6a7db34.240127.tar.gz",
|
||||
"archiveFileName": "aarch64-apple-darwin20.4.elf2uf2-6a7db34.240127.tar.gz",
|
||||
"checksum": "SHA-256:3fb12aa0d39bb03520a46ff5e3d0dbd0eb0df31843056f5dcd8b6fffa1d7ff86",
|
||||
"size": "30084"
|
||||
},
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/aarch64-linux-gnu.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:5eed824fdd1c529295c1fd3945017f0e9baed8250055749651aeee72c3e11ae5",
|
||||
"size": "83825"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:b8ab83714f963dd42164ff1093a02822d63a2825fc04ac395f5ce9c98224fc6a",
|
||||
"size": "85433"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/arm-linux-gnueabihf.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:137792ded226d15fc7ce9041b1322cdc895d8423328cf08fbe0f3eb8f63a98fe",
|
||||
"size": "56866"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:027de6742745bd27bb79e98563da95fc72f7aad28af19d2893e40b14602b3e99",
|
||||
"size": "59530"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-linux-gnu.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:7956e5365d647f1c810c1ac3c6786f8b81e7b1b89d90c2edc495448dbd7b82b9",
|
||||
"size": "92453"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:b8ab8cf6fe09a6ce0c30861ded3e88c785cec06f1b3ccb888522ba6da8fc3220",
|
||||
"size": "96835"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-w64-mingw32.elf2uf2-6a7db34.230911.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.elf2uf2-6a7db34.230911.zip",
|
||||
"checksum": "SHA-256:74e9be8f520b2752010978f4f140671da95d7faa385d4cca5aae06d719674ae0",
|
||||
"size": "72746"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.elf2uf2-6a7db34.240125.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.elf2uf2-6a7db34.240125.zip",
|
||||
"checksum": "SHA-256:80c2b269d50475f0bcc518b3cc08d3ee639470603912bc17fbcd695efb5ac825",
|
||||
"size": "73951"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-apple-darwin15.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:29b23e904fab7f373a082a09fe197555f79372aeef1e4d4cdef8ac8860476655",
|
||||
"size": "105035"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin20.4.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:3d3e47d70981b852e553e1250b90c5442320232952f18d4a74ca87ff14a55ea7",
|
||||
"size": "106528"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-linux-gnu.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.elf2uf2-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:ff48939331d44d51418e55e7ca2cf3e63a746e2617d307ac8000422c05914ee4",
|
||||
"size": "83343"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.elf2uf2-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:ba9cbfa2b6a46ced939b7c02f2c21f923cfb98228468634618e4a1ea2e4f10a1",
|
||||
"size": "86035"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-w64-mingw32.elf2uf2-6a7db34.230911.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-6a7db34.230911.zip",
|
||||
"checksum": "SHA-256:bd932b64376557790ab130cfef941c4cf0c4f636ea373fb1bb30ccb7d9a667d0",
|
||||
"size": "81346"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.elf2uf2-6a7db34.240125.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-6a7db34.240125.zip",
|
||||
"checksum": "SHA-256:8bd4440c8a0a5102235377ab3437d75324e7cfa58aa69bbce24c5dff29f5947d",
|
||||
"size": "81681"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-pioasm",
|
||||
"systems": [
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.pioasm-6a7db34.240127.tar.gz",
|
||||
"archiveFileName": "aarch64-apple-darwin20.4.pioasm-6a7db34.240127.tar.gz",
|
||||
"checksum": "SHA-256:b325fdf8c2e7712e821049c68fc29dfac80bc492fb03c0fb3597de272ff42deb",
|
||||
"size": "246217"
|
||||
},
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/aarch64-linux-gnu.pioasm-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.pioasm-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:db0e42e85463d3ff61fa07e40fad274f414161ea9d54098ee41a048c38cf9bed",
|
||||
"size": "453497"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.pioasm-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.pioasm-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:fb9faf961945bd2f0773feeb760750f38028740c34b279ea85904377f16d5a55",
|
||||
"size": "456608"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/arm-linux-gnueabihf.pioasm-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.pioasm-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:afaabb3367f8fe1c5d95d8324eccc288c20a7fd29d0499ec52488a6a317cdeb5",
|
||||
"size": "360810"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.pioasm-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.pioasm-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:14bcd7305a2542b807eb9d3e31c043a7465dea170a928c8dc5a651476d8b9a14",
|
||||
"size": "379178"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-linux-gnu.pioasm-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.pioasm-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:62d58a88c22d94081a20d2005fddcdce08ebeb6cf3eb3ad824f28e5f3bb05424",
|
||||
"size": "511516"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.pioasm-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.pioasm-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:2822abdfb3226c9cfa6bd7e58cbd9f0699cc9fe8ec319bb7adceb31c209095d2",
|
||||
"size": "530142"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-w64-mingw32.pioasm-6a7db34.230911.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.pioasm-6a7db34.230911.zip",
|
||||
"checksum": "SHA-256:c5bb884e3e8452495152662946be6ff5c9dc03981a6694df33d17572037888d2",
|
||||
"size": "386187"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.pioasm-6a7db34.240125.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.pioasm-6a7db34.240125.zip",
|
||||
"checksum": "SHA-256:a1f8f36ef039c3081d80d874949d243282889f81868ca626389b7d0c2ffef40a",
|
||||
"size": "404747"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-apple-darwin15.pioasm-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.pioasm-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:74c3d7f5502674763cb205ed87df469abd5d763a84d37c28ca9fb7b66b583062",
|
||||
"size": "585394"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.pioasm-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin20.4.pioasm-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:4c54204a7d5312825d6609cc326d4b4072728f8446ead346bae1c319256d7abe",
|
||||
"size": "650257"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-linux-gnu.pioasm-6a7db34.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.pioasm-6a7db34.230911.tar.gz",
|
||||
"checksum": "SHA-256:029bbc6f1ab44481583730aedc58a091341267c4089aa151a1e50ba17aca4ba5",
|
||||
"size": "458908"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.pioasm-6a7db34.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.pioasm-6a7db34.240125.tar.gz",
|
||||
"checksum": "SHA-256:13db79fd0992a0aa8c6a78684fcf6538d77eb645758ccc5dc16b148d452ad796",
|
||||
"size": "477990"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-w64-mingw32.pioasm-6a7db34.230911.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.pioasm-6a7db34.230911.zip",
|
||||
"checksum": "SHA-256:3c506a8163ed5d3c6408343f5768f87bbcc6209a049313b51b1dda8bcfe634f4",
|
||||
"size": "408968"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.pioasm-6a7db34.240125.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.pioasm-6a7db34.240125.zip",
|
||||
"checksum": "SHA-256:71eee9c820774328cbd5d082a032fb960587af6a7568b2502ee75ebc6fe6c9a2",
|
||||
"size": "429999"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0-a-d3d2e6b",
|
||||
"version": "2.2.0-d04e724",
|
||||
"name": "pqt-mklittlefs",
|
||||
"systems": [
|
||||
{
|
||||
"host": "arm64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-apple-darwin20.4.mklittlefs-6e2fa17.240127.tar.gz",
|
||||
"archiveFileName": "aarch64-apple-darwin20.4.mklittlefs-6e2fa17.240127.tar.gz",
|
||||
"checksum": "SHA-256:ad46da0560569a97edd11490829479e70aa3c53b4525c5a8f6ae154f2d41c0bb",
|
||||
"size": "70714"
|
||||
},
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/aarch64-linux-gnu.mklittlefs-4aca452.230911.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.mklittlefs-4aca452.230911.tar.gz",
|
||||
"checksum": "SHA-256:ebaa3a47e4004afc40e68c948d4811eec546b9e971691faa6cdb8798b450ceca",
|
||||
"size": "63224"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/aarch64-linux-gnu.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"checksum": "SHA-256:63e549d45addddc0e029efed36fdf4684cb4b9f3f965426c56282fef890f7a3f",
|
||||
"size": "68800"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/arm-linux-gnueabihf.mklittlefs-4aca452.230911.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-4aca452.230911.tar.gz",
|
||||
"checksum": "SHA-256:2865730ce61934f9b24b91ee675a9bcca3db7e2676520363062cd49f501f6f29",
|
||||
"size": "53459"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/arm-linux-gnueabihf.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"checksum": "SHA-256:79746a9b44590ab132c03f686529c3894caf557a15720b2d9e4d64c91742093d",
|
||||
"size": "59810"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-linux-gnu.mklittlefs-4aca452.230911.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.mklittlefs-4aca452.230911.tar.gz",
|
||||
"checksum": "SHA-256:d8042d1d0d8d052af6c3979cfa61d63790cf940e74ad670df7591530081be923",
|
||||
"size": "69995"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-linux-gnu.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"checksum": "SHA-256:084c016bf074b028cb40471b2087a6d54ef31a3d34709f5879b86e9577bff44d",
|
||||
"size": "76575"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/i686-w64-mingw32.mklittlefs-4aca452.230911.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.mklittlefs-4aca452.230911.zip",
|
||||
"checksum": "SHA-256:0ddc40ccd20f36101543ea4a7a3ff56c63450d417746db2de8a499cb7cdd59b5",
|
||||
"size": "347611"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/i686-w64-mingw32.mklittlefs-6e2fa17.240125.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.mklittlefs-6e2fa17.240125.zip",
|
||||
"checksum": "SHA-256:35c1bcdd05be6389992e78fdb890e81cdd9c298408d811293a2bc7605ac59e7a",
|
||||
"size": "369155"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-apple-darwin15.mklittlefs-4aca452.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.mklittlefs-4aca452.230911.tar.gz",
|
||||
"checksum": "SHA-256:bdb0d7ec9e2ae9f7ab672a7dd5cc103db3bae287ab3e1b000bbbb6d8141c34f7",
|
||||
"size": "435002"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-apple-darwin20.4.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin20.4.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"checksum": "SHA-256:5d0eb016a0712b17f3178acf835590557a6a4990c0400e325f27db4fc9d9813c",
|
||||
"size": "508017"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-linux-gnu.mklittlefs-4aca452.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.mklittlefs-4aca452.230911.tar.gz",
|
||||
"checksum": "SHA-256:a2b5b89c2535a426d59edd51495ba162c347632aeed2af9af27e8378ebeaad4b",
|
||||
"size": "64930"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-linux-gnu.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.mklittlefs-6e2fa17.240125.tar.gz",
|
||||
"checksum": "SHA-256:91efeabcd4765d4f6a8e07b1561a226aaaf176abacee3d5f879e94c68dcc5617",
|
||||
"size": "71165"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.1.0-a/x86_64-w64-mingw32.mklittlefs-4aca452.230911.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-4aca452.230911.zip",
|
||||
"checksum": "SHA-256:49c18c392c86106ca317bc6fa1db0f3bd7430f937cab372987ebae9cb5194f6a",
|
||||
"size": "359296"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.mklittlefs-6e2fa17.240125.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-6e2fa17.240125.zip",
|
||||
"checksum": "SHA-256:cf7291de4633f3a041f38973771a4298128b7641c4c65a94f080fd13cbd50275",
|
||||
"size": "381186"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=Raspberry Pi RP2040 Boards
|
||||
version=3.6.0
|
||||
version=3.7.1
|
||||
|
||||
# Required discoveries and monitors
|
||||
# ---------------------------------
|
||||
|
||||
@@ -25,6 +25,7 @@ function skip_ino()
|
||||
/midi_pizza_box_dj/
|
||||
/msc_esp32_file_browser/
|
||||
/DualRole/
|
||||
/Host/
|
||||
EOL
|
||||
echo $ino | grep -q -F "$skiplist"
|
||||
echo $(( 1 - $? ))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user