Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -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
|
||||
|
||||
@@ -30,6 +30,7 @@ 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
|
||||
@@ -76,6 +77,34 @@ Read the [Contributing Guide](https://github.com/earlephilhower/arduino-pico/blo
|
||||
* WIZnet WizFi360-EVB-Pico
|
||||
* 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
|
||||
@@ -201,48 +230,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.
|
||||
@@ -252,14 +239,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
|
||||
|
||||
+804
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#define ARDUINO_PICO_MAJOR 3
|
||||
#define ARDUINO_PICO_MINOR 6
|
||||
#define ARDUINO_PICO_REVISION 1
|
||||
#define ARDUINO_PICO_VERSION_STR "3.6.1"
|
||||
#define ARDUINO_PICO_MINOR 7
|
||||
#define ARDUINO_PICO_REVISION 0
|
||||
#define ARDUINO_PICO_VERSION_STR "3.7.0"
|
||||
|
||||
@@ -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,6 +29,7 @@
|
||||
#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));
|
||||
@@ -68,13 +69,18 @@ public:
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+2
-2
@@ -54,9 +54,9 @@ author = u'Earle F. Philhower, III'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'3.6.1'
|
||||
version = u'3.7.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'3.6.1'
|
||||
release = u'3.7.0'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
||||
@@ -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::
|
||||
|
||||
+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!
|
||||
|
||||
+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.
|
||||
|
||||
|
||||
+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')) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -165,14 +165,14 @@ static void __no_inline_not_in_flash_func(IdleThisCore)(void *param) {
|
||||
(void) param;
|
||||
while (true) {
|
||||
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
|
||||
vTaskPreemptionDisable(nullptr);
|
||||
portDISABLE_INTERRUPTS();
|
||||
vTaskPreemptionDisable(nullptr);
|
||||
__otherCoreIdled = true;
|
||||
while (__otherCoreIdled) {
|
||||
/* noop */
|
||||
}
|
||||
portENABLE_INTERRUPTS();
|
||||
vTaskPreemptionEnable(nullptr);
|
||||
portENABLE_INTERRUPTS();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,9 +188,9 @@ extern "C" void __no_inline_not_in_flash_func(__freertos_idle_other_core)() {
|
||||
|
||||
extern "C" void __no_inline_not_in_flash_func(__freertos_resume_other_core)() {
|
||||
__otherCoreIdled = false;
|
||||
portENABLE_INTERRUPTS();
|
||||
xTaskResumeAll();
|
||||
vTaskPreemptionEnable(nullptr);
|
||||
portENABLE_INTERRUPTS();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
-14
@@ -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;
|
||||
@@ -111,6 +111,7 @@ byte SPIClassRP2040::transfer(uint8_t data) {
|
||||
}
|
||||
data = (_spis.getBitOrder() == MSBFIRST) ? data : reverseByte(data);
|
||||
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,11 +125,8 @@ uint16_t SPIClassRP2040::transfer16(uint16_t data) {
|
||||
}
|
||||
data = (_spis.getBitOrder() == MSBFIRST) ? data : reverse16Bit(data);
|
||||
DEBUGSPI("SPI::transfer16(%04x), cpol=%d, cpha=%d\n", data, cpol(), cpha());
|
||||
uint8_t d[2];
|
||||
d[0] = (data >> 8) & 0xff;
|
||||
d[1] = data & 0xff;
|
||||
spi_write_read_blocking(_spi, d, d, 2);
|
||||
ret = ((d[0] << 8) | (d[1] & 0xff)) & 0xffff;
|
||||
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);
|
||||
return ret;
|
||||
@@ -149,6 +147,8 @@ 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);
|
||||
@@ -184,15 +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());
|
||||
_spis = settings;
|
||||
spi_set_format(_spi, 8, cpol(), cpha(), SPI_MSB_FIRST);
|
||||
DEBUGSPI("SPI: actual baudrate=%u\n", spi_get_baudrate(_spi));
|
||||
_initted = true;
|
||||
}
|
||||
// Disable any IRQs that are being used for SPI
|
||||
@@ -205,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]);
|
||||
@@ -338,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) {
|
||||
@@ -363,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;
|
||||
}
|
||||
|
||||
};
|
||||
@@ -470,5 +470,10 @@ void TwoWire::clearTimeoutFlag() {
|
||||
#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
|
||||
|
||||
@@ -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,322 @@
|
||||
/*
|
||||
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 {
|
||||
memcpy(ap.bssid, bssid, sizeof(ap.bssid));
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
@@ -129,9 +128,12 @@ 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++;
|
||||
for (auto handlePacket : _handlePacketList) {
|
||||
handlePacket.second();
|
||||
}
|
||||
@@ -144,7 +146,6 @@ static void ethernet_timeout_reached(__unused async_context_t *context, __unused
|
||||
#endif
|
||||
}
|
||||
|
||||
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 +165,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;
|
||||
}
|
||||
|
||||
@@ -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,13 @@ public:
|
||||
_spiSettings = s;
|
||||
}
|
||||
|
||||
uint32_t packetsReceived() {
|
||||
return _packetsReceived;
|
||||
}
|
||||
uint32_t packetsSent() {
|
||||
return _packetsSent;
|
||||
}
|
||||
|
||||
// ESP8266WiFi API compatibility
|
||||
|
||||
wl_status_t status();
|
||||
@@ -152,6 +179,9 @@ protected:
|
||||
|
||||
// Packet handler number
|
||||
int _phID = -1;
|
||||
|
||||
uint32_t _packetsReceived = 0;
|
||||
uint32_t _packetsSent = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -249,6 +279,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) {
|
||||
@@ -337,6 +385,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
|
||||
|
||||
@@ -362,7 +411,7 @@ void LwipIntfDev<RawDev>::end() {
|
||||
RawDev::end();
|
||||
|
||||
netif_remove(&_netif);
|
||||
memset(&_netif, 0, sizeof(_netif));
|
||||
|
||||
_started = false;
|
||||
}
|
||||
|
||||
@@ -377,7 +426,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 +540,8 @@ err_t LwipIntfDev<RawDev>::handlePackets() {
|
||||
return ERR_BUF;
|
||||
}
|
||||
|
||||
_packetsReceived++;
|
||||
|
||||
err_t err = _netif.input(pbuf, &_netif);
|
||||
|
||||
#if PHY_HAS_CAPTURE
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "framework-arduinopico",
|
||||
"version": "1.30601.0",
|
||||
"version": "1.30700.0",
|
||||
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
||||
@@ -86,6 +86,9 @@
|
||||
{
|
||||
"name": "Cytron Maker Pi RP2040"
|
||||
},
|
||||
{
|
||||
"name": "Cytron Maker Uno RP2040"
|
||||
},
|
||||
{
|
||||
"name": "DatanoiseTV PicoADK"
|
||||
},
|
||||
@@ -98,6 +101,9 @@
|
||||
{
|
||||
"name": "DFRobot Beetle RP2040"
|
||||
},
|
||||
{
|
||||
"name": "L'atelier d'Arnoz DudesCab"
|
||||
},
|
||||
{
|
||||
"name": "ElectronicCats HunterCat NFC RP2040"
|
||||
},
|
||||
@@ -134,6 +140,9 @@
|
||||
{
|
||||
"name": "iLabs Challenger 2040 UWB"
|
||||
},
|
||||
{
|
||||
"name": "iLabs Connectivity 2040 LTE/WiFi/BLE"
|
||||
},
|
||||
{
|
||||
"name": "iLabs RPICO32"
|
||||
},
|
||||
@@ -231,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"
|
||||
},
|
||||
{
|
||||
@@ -256,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"
|
||||
}
|
||||
],
|
||||
@@ -272,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.picotool1-f6fe6b7.230911.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.picotool1-f6fe6b7.230911.zip",
|
||||
"checksum": "SHA-256:5c8fc5a9a9a6f4cc49a84bcf4cde6f4188d64008d11754bda4da48affca39f13",
|
||||
"size": "291812"
|
||||
"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.picotool1-f6fe6b7.230911.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin15.picotool1-f6fe6b7.230911.tar.gz",
|
||||
"checksum": "SHA-256:80415ab9b4b63a327b31a1b84df31883dae4080a286851a546a46badf1b7de41",
|
||||
"size": "1130270"
|
||||
"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.picotool1-f6fe6b7.230911.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.picotool1-f6fe6b7.230911.zip",
|
||||
"checksum": "SHA-256:1a0cbf35adcc1fa696af8a97ea37d9f413fb4de152713b8f97f1d0ca393a5593",
|
||||
"size": "277139"
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -434,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",
|
||||
@@ -444,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.1
|
||||
version=3.7.0
|
||||
|
||||
# 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 - $? ))
|
||||
|
||||
@@ -178,11 +178,6 @@ function install_ide()
|
||||
unzip -q ${core_path}/tools/dist/arduino-windows.zip
|
||||
mv arduino-${idever} arduino-distrib
|
||||
elif [ "$MACOSX" = "1" ]; then
|
||||
# MACOS only has next-to-obsolete Python2 installed. Install Python 3 from python.org
|
||||
wget -q https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg
|
||||
sudo installer -pkg python-3.7.4-macosx10.9.pkg -target /
|
||||
# Install the Python3 certificates, because SSL connections fail w/o them and of course they aren't installed by default.
|
||||
( cd "/Applications/Python 3.7/" && sudo "./Install Certificates.command" )
|
||||
# Hack to place arduino-builder in the same spot as sane OSes
|
||||
test -r ${core_path}/tools/dist/arduino-macos.zip || wget -q -O ${core_path}/tools/dist/arduino-macos.zip "${ideurl}-macosx.zip"
|
||||
unzip -q ${core_path}/tools/dist/arduino-macos.zip
|
||||
|
||||
+11
-10
@@ -99,22 +99,23 @@ def load_tools_list(filename, platform):
|
||||
return tools_to_download
|
||||
|
||||
def identify_platform():
|
||||
arduino_platform_names = {'Darwin' : {32 : 'i386-apple-darwin', 64 : 'x86_64-apple-darwin'},
|
||||
'Linux' : {32 : 'i686-pc-linux-gnu', 64 : 'x86_64-pc-linux-gnu'},
|
||||
'LinuxARM': {32 : 'arm-linux-gnueabihf', 64 : 'aarch64-linux-gnu'},
|
||||
'Windows' : {32 : 'i686-mingw32', 64 : 'x86_64-mingw32'}}
|
||||
arduino_platform_names = {'Darwin' : {32 : 'i386-apple-darwin', 64 : 'x86_64-apple-darwin'},
|
||||
'DarwinARM': {32 : 'arm64-apple-darwin', 64 : 'arm64-apple-darwin'},
|
||||
'Linux' : {32 : 'i686-pc-linux-gnu', 64 : 'x86_64-pc-linux-gnu'},
|
||||
'LinuxARM' : {32 : 'arm-linux-gnueabihf', 64 : 'aarch64-linux-gnu'},
|
||||
'Windows' : {32 : 'i686-mingw32', 64 : 'x86_64-mingw32'}}
|
||||
bits = 32
|
||||
if sys.maxsize > 2**32:
|
||||
bits = 64
|
||||
sys_name = platform.system()
|
||||
if 'Linux' in sys_name and (platform.platform().find('arm') > 0 or platform.platform().find('aarch64') > 0):
|
||||
sys_platform = platform.platform()
|
||||
if 'Darwin' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('arm64') > 0):
|
||||
sys_name = 'DarwinARM'
|
||||
if 'Linux' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('aarch64') > 0):
|
||||
sys_name = 'LinuxARM'
|
||||
if 'CYGWIN_NT' in sys_name:
|
||||
sys_name = 'Windows'
|
||||
if 'MSYS_NT' in sys_name:
|
||||
sys_name = 'Windows'
|
||||
if 'MINGW' in sys_name:
|
||||
if ('CYGWIN_NT' in sys_name) or ('MSYS_NT' in sys_name) or ('MINGW' in sys_name):
|
||||
sys_name = 'Windows'
|
||||
print('System: %s, Bits: %d, Info: %s' % (sys_name, bits, sys_platform))
|
||||
return arduino_platform_names[sys_name][bits]
|
||||
|
||||
def main():
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2E8A",
|
||||
"usb_pid": "0x106F"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_RASPBERRY_PI_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x106F"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "DudesCab"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "DudesCab",
|
||||
"upload": {
|
||||
"maximum_ram_size": 270336,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"native_usb": true,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": false,
|
||||
"protocol": "picotool",
|
||||
"protocols": [
|
||||
"blackmagic",
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe",
|
||||
"pico-debug"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "L'atelier d'Arnoz"
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2E8A",
|
||||
"usb_pid": "0x107B"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CONNECTIVITY_2040_LTE_WIFI_BLE_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500 -DWIFIESPAT2",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x107B"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "connectivity_2040_lte_wifi_ble"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "Connectivity 2040 LTE/WiFi/BLE",
|
||||
"upload": {
|
||||
"maximum_ram_size": 270336,
|
||||
"maximum_size": 8388608,
|
||||
"require_upload_port": true,
|
||||
"native_usb": true,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": false,
|
||||
"protocol": "picotool",
|
||||
"protocols": [
|
||||
"blackmagic",
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe",
|
||||
"pico-debug"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2E8A",
|
||||
"usb_pid": "0x1071"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CYTRON_MAKER_UNO_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
],
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x1071"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "cytron_maker_uno_rp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "Maker Uno RP2040",
|
||||
"upload": {
|
||||
"maximum_ram_size": 270336,
|
||||
"maximum_size": 2097152,
|
||||
"require_upload_port": true,
|
||||
"native_usb": true,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": false,
|
||||
"protocol": "picotool",
|
||||
"protocols": [
|
||||
"blackmagic",
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe",
|
||||
"pico-debug"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Cytron"
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ILABS_2040_RPICO32_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"extra_flags": "-D ARDUINO_ILABS_2040_RPICO32_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DWIFIESPAT2",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
|
||||
@@ -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)
|
||||
|
||||
+9
-1
@@ -88,6 +88,8 @@ def BuildUSBStack(name):
|
||||
print('%s.menu.usbstack.picosdk.build.usbstack_flags=' % (name))
|
||||
print("%s.menu.usbstack.tinyusb=Adafruit TinyUSB" % (name))
|
||||
print('%s.menu.usbstack.tinyusb.build.usbstack_flags=-DUSE_TINYUSB "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"' % (name))
|
||||
print("%s.menu.usbstack.tinyusb_host=Adafruit TinyUSB Host" % (name))
|
||||
print('%s.menu.usbstack.tinyusb_host.build.usbstack_flags=-DUSE_TINYUSB -DUSE_TINYUSB_HOST "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"' % (name))
|
||||
print("%s.menu.usbstack.nousb=No USB" % (name))
|
||||
print('%s.menu.usbstack.nousb.build.usbstack_flags="-DNO_USB -DDISABLE_USB_SERIAL -I{runtime.platform.path}/tools/libpico"' % (name))
|
||||
|
||||
@@ -370,6 +372,7 @@ MakeBoard("bridgetek_idm2040-7a", "BridgeTek", "IDM2040-7A", "0x2e8a", "0x1041",
|
||||
# Cytron
|
||||
MakeBoard("cytron_maker_nano_rp2040", "Cytron", "Maker Nano RP2040", "0x2e8a", "0x100f", 250, "CYTRON_MAKER_NANO_RP2040", 2, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("cytron_maker_pi_rp2040", "Cytron", "Maker Pi RP2040", "0x2e8a", "0x1000", 250, "CYTRON_MAKER_PI_RP2040", 2, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("cytron_maker_uno_rp2040", "Cytron", "Maker Uno RP2040", "0x2e8a", "0x1071", 250, "CYTRON_MAKER_UNO_RP2040", 2, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
# DatanoiseTV
|
||||
MakeBoard("datanoisetv_picoadk", "DatanoiseTV", "PicoADK", "0x2e8a", "0x000a", 250, "DATANOISETV_PICOADK", 2, "boot2_w25q080_2_padded_checksum")
|
||||
@@ -383,6 +386,10 @@ MakeBoard("flyboard2040_core", "DeRuiLab", "FlyBoard2040Core", "0x2e8a", "0x008a
|
||||
# DFRobot
|
||||
MakeBoard("dfrobot_beetle_rp2040", "DFRobot", "Beetle RP2040", "0x3343", "0x4253", 250, "DFROBOT_BEETLE_RP2040", 2, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
# DudesCab
|
||||
MakeBoard("DudesCab", "L'atelier d'Arnoz", "DudesCab", "0x2e8a", "0x106F", 250, "RASPBERRY_PI_PICO", 4, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
|
||||
# ElectronicCat
|
||||
MakeBoard("electroniccats_huntercat_nfc", "ElectronicCats", "HunterCat NFC RP2040", "0x2E8A", "0x1037", 500, "ELECTRONICCATS_HUNTERCAT_NFC", 2, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
@@ -400,7 +407,8 @@ MakeBoard("challenger_nb_2040_wifi", "iLabs", "Challenger NB 2040 WiFi", "0x2e8a
|
||||
MakeBoard("challenger_2040_sdrtc", "iLabs", "Challenger 2040 SD/RTC", "0x2e8a", "0x102d", 250, "CHALLENGER_2040_SDRTC_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("challenger_2040_nfc", "iLabs", "Challenger 2040 NFC", "0x2e8a", "0x1036", 250, "CHALLENGER_2040_NFC_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("challenger_2040_uwb", "iLabs", "Challenger 2040 UWB", "0x2e8a", "0x1052", 500, "CHALLENGER_2040_UWB_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("ilabs_rpico32", "iLabs", "RPICO32", "0x2e8a", "0x1010", 250, "ILABS_2040_RPICO32_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("connectivity_2040_lte_wifi_ble", "iLabs", "Connectivity 2040 LTE/WiFi/BLE", "0x2e8a", "0x107b", 500, "CONNECTIVITY_2040_LTE_WIFI_BLE_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
|
||||
MakeBoard("ilabs_rpico32", "iLabs", "RPICO32", "0x2e8a", "0x1010", 250, "ILABS_2040_RPICO32_RP2040", 8, "boot2_w25q080_2_padded_checksum", ["WIFIESPAT2"])
|
||||
|
||||
# Melopero
|
||||
MakeBoard("melopero_cookie_rp2040", "Melopero", "Cookie RP2040", "0x2e8a", "0x1011", 250, "MELOPERO_COOKIE_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
@@ -321,9 +321,15 @@ libs = []
|
||||
|
||||
variant = board.get("build.arduino.earlephilhower.variant", board.get("build.variant", ""))
|
||||
|
||||
# The following 3 lines are adapted from espressif/arduino-esp32, also licensed under apache2
|
||||
variants_dir = os.path.join(FRAMEWORK_DIR, "variants")
|
||||
|
||||
if "build.variants_dir" in board:
|
||||
variants_dir = os.path.join("$PROJECT_DIR", board.get("build.variants_dir"))
|
||||
|
||||
if variant != "":
|
||||
env.Append(CPPPATH=[
|
||||
os.path.join(FRAMEWORK_DIR, "variants", variant)
|
||||
os.path.join(variants_dir, variant)
|
||||
])
|
||||
|
||||
env.Append(CPPDEFINES=[
|
||||
@@ -335,7 +341,7 @@ if variant != "":
|
||||
# otherwise weak function overriding won't work in the linking stage.
|
||||
env.BuildSources(
|
||||
os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"),
|
||||
os.path.join(FRAMEWORK_DIR, "variants", variant))
|
||||
os.path.join(variants_dir, variant))
|
||||
|
||||
libs.append(
|
||||
env.BuildLibrary(
|
||||
|
||||
Executable
+66
@@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
|
||||
# this shell script refreshes world timezone definitions in
|
||||
# cores/rp2040/TZ.h
|
||||
#
|
||||
# to run it, use:
|
||||
# /path/to/TZupdate.sh
|
||||
# tools/TZupdate.sh
|
||||
# ./TZupdate.sh
|
||||
|
||||
dir=$(cd ${0%/*} 2>/dev/null; pwd)
|
||||
base=${0##*/}
|
||||
|
||||
csv=https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
|
||||
|
||||
set -e
|
||||
|
||||
tz_tmpdir=$(mktemp -d)
|
||||
trap 'rm -r $tz_tmpdir' EXIT
|
||||
|
||||
input=$tz_tmpdir/zones.csv
|
||||
names=$tz_tmpdir/names.txt
|
||||
values=$tz_tmpdir/values.txt
|
||||
|
||||
wget -O $input $csv || curl $csv > $input
|
||||
|
||||
sed -e 's/^[^,]*,//g' -e 's,^,(,g' -e 's,$,),g' < $input > $values
|
||||
sed -e 's/^\([^,]*\),.*/#define TZ_\1/g' -e 's,["],,g' < $input | tr '/\-+' '_mp' > $names
|
||||
|
||||
(
|
||||
|
||||
cat << EOF
|
||||
|
||||
// autogenerated from $csv
|
||||
// by script <rp2040 arduino core>/tools/${base}
|
||||
// $(date -u)
|
||||
//
|
||||
// This database is autogenerated from IANA timezone database
|
||||
// ${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
|
||||
|
||||
EOF
|
||||
|
||||
paste $names $values
|
||||
|
||||
) > $tz_tmpdir/TZ.h
|
||||
|
||||
backup=$(date +%s)
|
||||
mv ${dir}/../cores/rp2040/TZ.h ${dir}/../cores/rp2040/TZ.h.$backup
|
||||
mv $tz_tmpdir/TZ.h ${dir}/../cores/rp2040/TZ.h
|
||||
|
||||
cat << EOF
|
||||
|
||||
Done:
|
||||
'${dir}/../cores/rp2040/TZ.h' is updated
|
||||
|
||||
Diff:
|
||||
----8<-------8<------8<---
|
||||
$(diff -u ${dir}/../cores/rp2040/TZ.h.$backup ${dir}/../cores/rp2040/TZ.h)
|
||||
--->8----->8------>8------
|
||||
|
||||
EOF
|
||||
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
// Pin definitions taken from:
|
||||
// https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf
|
||||
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (25u)
|
||||
|
||||
// Serial
|
||||
#define PIN_SERIAL1_TX (0u)
|
||||
#define PIN_SERIAL1_RX (1u)
|
||||
|
||||
#define PIN_SERIAL2_TX (8u)
|
||||
#define PIN_SERIAL2_RX (9u)
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (4u)
|
||||
#define PIN_SPI0_MOSI (3u)
|
||||
#define PIN_SPI0_SCK (2u)
|
||||
#define PIN_SPI0_SS (5u)
|
||||
|
||||
#define PIN_SPI1_MISO (12u)
|
||||
#define PIN_SPI1_MOSI (15u)
|
||||
#define PIN_SPI1_SCK (14u)
|
||||
#define PIN_SPI1_SS (13u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (18u)
|
||||
#define PIN_WIRE0_SCL (19u)
|
||||
|
||||
#define PIN_WIRE1_SDA (10u)
|
||||
#define PIN_WIRE1_SCL (11u)
|
||||
|
||||
#define SERIAL_HOWMANY (3u)
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (2u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
@@ -24,7 +24,7 @@
|
||||
#define SARA_SERIAL_PORT Serial2
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (24u)
|
||||
#define PIN_SPI0_MISO (20u)
|
||||
#define PIN_SPI0_MOSI (23u)
|
||||
#define PIN_SPI0_SCK (22u)
|
||||
#define PIN_SPI0_SS (21u)
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
/*
|
||||
UBlox SARA/ESP helper class for the Connectivity RP2040 LTE/WIFI/BLE board
|
||||
|
||||
Copyright (c) 2024 P. Oldberg <pontus@ilabs.se>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <Connectivity.h>
|
||||
|
||||
iLabsConnectivityClass::iLabsConnectivityClass(HardwareSerial* espSerial, HardwareSerial* modemSerial) {
|
||||
_espSerial = espSerial;
|
||||
_modemSerial = modemSerial;
|
||||
/* SARA pins */
|
||||
pinMode(PIN_SARA_ON, OUTPUT);
|
||||
digitalWrite(PIN_SARA_ON, LOW); // Output register must always be low
|
||||
pinMode(PIN_SARA_ON, INPUT_PULLUP);
|
||||
|
||||
pinMode(PIN_SARA_RST, INPUT_PULLUP); // Keep as input for now
|
||||
|
||||
pinMode(PIN_SARA_PWR, OUTPUT);
|
||||
digitalWrite(PIN_SARA_PWR, LOW); // No power to SARA yet
|
||||
|
||||
pinMode(PIN_SARA_DTR, OUTPUT);
|
||||
digitalWrite(PIN_SARA_PWR, HIGH); // Make sure DTR is low on the R412M
|
||||
|
||||
modemSerialPortConfigured = false;
|
||||
|
||||
/* ESP Pins */
|
||||
pinMode(PIN_ESP_RST, OUTPUT);
|
||||
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
|
||||
pinMode(PIN_ESP_MODE, OUTPUT);
|
||||
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
|
||||
espSerialPortConfigured = false;
|
||||
}
|
||||
|
||||
// Do a HW reset by applying a low pulse to the reset line for 1mSec
|
||||
bool iLabsConnectivityClass::doModemPowerOn() {
|
||||
bool ret;
|
||||
digitalWrite(PIN_SARA_PWR, HIGH); // Make sure LDO is on
|
||||
delay(100); // let the power stabilize
|
||||
pinMode(PIN_SARA_ON, OUTPUT); // Pull power on control low
|
||||
delay(150); // For 150mS
|
||||
pinMode(PIN_SARA_ON, INPUT_PULLUP); // before releasing it again.
|
||||
delay(1000); // Now wait for 1 second
|
||||
|
||||
SARA_SERIAL_PORT.setRTS(PIN_SERIAL2_RTS); // Enable hardware handshaking
|
||||
SARA_SERIAL_PORT.setCTS(PIN_SERIAL2_CTS);
|
||||
SARA_SERIAL_PORT.begin(DEFAULT_SARA_BAUDRATE);
|
||||
modemSerialPortConfigured = true;
|
||||
ret = isModemAlive(); // Make sure the modem is up and running
|
||||
|
||||
delay(250); // Allow for any extra characters
|
||||
// before flushing the input buffer
|
||||
while (SARA_SERIAL_PORT.available()) {
|
||||
SARA_SERIAL_PORT.read();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Checks to see if the modem responds to the "AT" poll command.
|
||||
bool iLabsConnectivityClass::isModemAlive(uint32_t timeout) {
|
||||
SARA_SERIAL_PORT.setTimeout(100);
|
||||
SARA_SERIAL_PORT.println(F("AT"));
|
||||
String rdy = SARA_SERIAL_PORT.readStringUntil('\n');
|
||||
while (!rdy.startsWith(F("OK")) && --timeout) {
|
||||
SARA_SERIAL_PORT.println(F("AT"));
|
||||
rdy = SARA_SERIAL_PORT.readStringUntil('\n');
|
||||
//Serial.println(rdy);
|
||||
}
|
||||
SARA_SERIAL_PORT.setTimeout(1000); // Restore serial timeout
|
||||
if (timeout) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return the current MNO profile
|
||||
// Returns -1 if the serial port is not yet setup or the number of the current
|
||||
// MNO profile setting from the modem.
|
||||
int iLabsConnectivityClass::getModemMNOProfile() {
|
||||
if (!modemSerialPortConfigured) {
|
||||
return -1;
|
||||
}
|
||||
SARA_SERIAL_PORT.println(F("AT+UMNOPROF?"));
|
||||
String resp = getModemResponse();
|
||||
return resp.substring(resp.indexOf("+UMNOPROF: ") + 11).toInt();
|
||||
}
|
||||
|
||||
// Set a new MNO profile
|
||||
// Returns false if the serial port is not yet setup or if an error
|
||||
// is detected during the communication with the modem.
|
||||
// This call is synchronous and will wait for the modem to start after
|
||||
// the soft restart which takes about 10 seconds.
|
||||
bool iLabsConnectivityClass::setModemMNOProfile(int profile) {
|
||||
if (!modemSerialPortConfigured) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disconnect from the network
|
||||
SARA_SERIAL_PORT.println("AT+COPS=2");
|
||||
if (!getModemResponse().endsWith("OK")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String cmd = "AT+UMNOPROF=" + String(profile) + ",1";
|
||||
SARA_SERIAL_PORT.println(cmd);
|
||||
if (!getModemResponse().endsWith("OK")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Restart the modem to apply the new MNO profile
|
||||
SARA_SERIAL_PORT.println("AT+CFUN=15");
|
||||
if (!getModemResponse().endsWith("OK")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isModemAlive(15000);
|
||||
}
|
||||
|
||||
// Disable power save features
|
||||
bool iLabsConnectivityClass::enableModemPS(bool enable) {
|
||||
if (!modemSerialPortConfigured) {
|
||||
return false;
|
||||
}
|
||||
if (enable) {
|
||||
SARA_SERIAL_PORT.println(F("AT+CPSMS=1"));
|
||||
} else {
|
||||
SARA_SERIAL_PORT.println(F("AT+CPSMS=0"));
|
||||
}
|
||||
|
||||
if (!getModemResponse().endsWith("OK")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get a response from SARA
|
||||
// A default serial timeout of 2 seconds allow for reading really slow
|
||||
// responses which should accommodate most replies. Replies are then trimmed
|
||||
// from control characters and appended with a tab character as a separator.
|
||||
//
|
||||
String iLabsConnectivityClass::getModemResponse(int timeout) {
|
||||
SARA_SERIAL_PORT.setTimeout(2000); // allow for really slow responses
|
||||
|
||||
String resp = SARA_SERIAL_PORT.readStringUntil('\n');
|
||||
resp.trim();
|
||||
String acc = resp;
|
||||
while (resp.indexOf("OK") == -1 && resp.indexOf("ERROR") == -1 && --timeout) {
|
||||
resp = SARA_SERIAL_PORT.readStringUntil('\n');
|
||||
resp.trim();
|
||||
if (resp.length()) {
|
||||
acc += "\t" + resp;
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}
|
||||
|
||||
// Do a HW reset by applying a low pulse to the reset line for 1mSec
|
||||
void iLabsConnectivityClass::doEspHWReset() {
|
||||
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
|
||||
delay(1);
|
||||
digitalWrite(PIN_ESP_RST, HIGH); // Release ESP reset
|
||||
}
|
||||
|
||||
// Set the mode flag high to indicate normal run operation and do a HW
|
||||
// reset.
|
||||
void iLabsConnectivityClass::runEspReset() { // Prepare ESP for normal op
|
||||
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
|
||||
doEspHWReset();
|
||||
}
|
||||
|
||||
// Set the mode flag low to indicate flash operation and do a HW
|
||||
// reset.
|
||||
void iLabsConnectivityClass::flashEspReset() { // Prepare ESP for flashing
|
||||
digitalWrite(PIN_ESP_MODE, LOW); // Prepare for normal start
|
||||
doEspHWReset();
|
||||
}
|
||||
|
||||
// Wait for the modem to reply with a "ready" prompt. This can be done
|
||||
// after a sw or hw reset have been performed to ensure that the AT
|
||||
// interpreter is up and running.
|
||||
bool iLabsConnectivityClass::waitForEspReady() {
|
||||
int timeout = 20; // Aprox max 2 sec
|
||||
|
||||
_espSerial->setTimeout(100);
|
||||
String rdy = _espSerial->readStringUntil('\n');
|
||||
while (!rdy.startsWith("ready") && timeout--) {
|
||||
rdy = _espSerial->readStringUntil('\n');
|
||||
}
|
||||
_espSerial->setTimeout(1000); // Reset default timeout to 1000
|
||||
if (timeout) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the ESP and wait for the "ready" prompt to be returned.
|
||||
bool iLabsConnectivityClass::resetEsp() {
|
||||
runEspReset();
|
||||
_espSerial->begin(DEFAULT_ESP_BAUDRATE);
|
||||
return waitForEspReady();
|
||||
}
|
||||
|
||||
// Checks to see if the modem responds to the "AT" poll command.
|
||||
bool iLabsConnectivityClass::isEspAlive() {
|
||||
int timeout = 100;
|
||||
|
||||
_espSerial->setTimeout(250);
|
||||
_espSerial->println(F("AT"));
|
||||
String rdy = _espSerial->readStringUntil('\n');
|
||||
while (!rdy.startsWith(F("OK")) && timeout--) {
|
||||
_espSerial->println(F("AT"));
|
||||
rdy = _espSerial->readStringUntil('\n');
|
||||
}
|
||||
_espSerial->setTimeout(1000);
|
||||
|
||||
if (timeout) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Change the baud rate of the ESP device as well as the local UART.
|
||||
// No checking is done on the input baud rate so the user must know what
|
||||
// baud rates are valid. The function ends by checking if the ESP is
|
||||
// reachable by doing an "AT" poll.
|
||||
bool iLabsConnectivityClass::changeEspBaudRate(int baud) {
|
||||
_espSerial->print(F("AT+UART_CUR="));
|
||||
_espSerial->print(baud);
|
||||
_espSerial->println(F(",8,1,0,0"));
|
||||
delay(100);
|
||||
_espSerial->end();
|
||||
_espSerial->begin(baud);
|
||||
return isEspAlive();
|
||||
}
|
||||
|
||||
// This method should be called if the builtin object isn't needed any more
|
||||
// It basically just releases the UART pins for other use.
|
||||
void iLabsConnectivityClass::releaseEsp() {
|
||||
_espSerial->end();
|
||||
}
|
||||
|
||||
// We can assign a new hardware serial port to accommodate the ESP device here.
|
||||
// The function will release the previously used serial port and assign the
|
||||
// new port. The ESP will be left in a reset state ready to start normal
|
||||
// operation when exiting the function.
|
||||
// This function is useful for when using the PIO serial ports to communicate
|
||||
// with the ESP instead of the built in hardware serial port.
|
||||
void iLabsConnectivityClass::setEspSerial(HardwareSerial* serial) {
|
||||
|
||||
releaseEsp();
|
||||
_espSerial = serial;
|
||||
|
||||
pinMode(PIN_ESP_RST, OUTPUT);
|
||||
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
|
||||
pinMode(PIN_ESP_MODE, OUTPUT);
|
||||
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
|
||||
}
|
||||
|
||||
// Return the current serial object
|
||||
HardwareSerial* iLabsConnectivityClass::getEspSerial() {
|
||||
return _espSerial;
|
||||
}
|
||||
|
||||
iLabsConnectivityClass iLabsConnectivity;
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
UBlox SARA/ESP helper class for the Connectivity RP2040 LTE/WIFI/BLE board
|
||||
|
||||
Copyright (c) 2024 P. Oldberg <pontus@ilabs.se>
|
||||
|
||||
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
|
||||
|
||||
#define DEFAULT_SARA_BAUDRATE 115200
|
||||
#define DEFAULT_ESP_BAUDRATE 115200
|
||||
|
||||
class iLabsConnectivityClass {
|
||||
public:
|
||||
iLabsConnectivityClass(HardwareSerial* = &ESP_SERIAL_PORT, HardwareSerial* = &SARA_SERIAL_PORT);
|
||||
|
||||
// Modem stuff
|
||||
bool doModemPowerOn();
|
||||
bool isModemAlive(uint32_t timeout = 50);
|
||||
int getModemMNOProfile();
|
||||
bool setModemMNOProfile(int profile);
|
||||
bool enableModemPS(bool enable = true);
|
||||
String getModemResponse(int timeout = 5);
|
||||
|
||||
// ESP stuff
|
||||
void doEspHWReset();
|
||||
void runEspReset();
|
||||
void flashEspReset();
|
||||
bool waitForEspReady();
|
||||
bool resetEsp();
|
||||
bool isEspAlive();
|
||||
bool changeEspBaudRate(int);
|
||||
void releaseEsp();
|
||||
void setEspSerial(HardwareSerial*);
|
||||
HardwareSerial* getEspSerial();
|
||||
|
||||
|
||||
private:
|
||||
bool modemSerialPortConfigured;
|
||||
bool espSerialPortConfigured;
|
||||
HardwareSerial* _espSerial;
|
||||
HardwareSerial* _modemSerial;
|
||||
};
|
||||
|
||||
extern iLabsConnectivityClass iLabsConnectivity;
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (19u)
|
||||
|
||||
// Serial1, (UART0) Connected to ESP32 chip)
|
||||
#define PIN_SERIAL1_TX (16u)
|
||||
#define PIN_SERIAL1_RX (17u)
|
||||
#define PIN_ESP32_RST (24u)
|
||||
#define PIN_ESP32_MODE (25u)
|
||||
#define ESP32_SERIAL Serial1
|
||||
// Uart define esp serial abstraction pins
|
||||
#define PIN_ESP_TX PIN_SERIAL1_TX
|
||||
#define PIN_ESP_RX PIN_SERIAL1_RX
|
||||
#define PIN_ESP_RST PIN_ESP32_RST
|
||||
#define PIN_ESP_MODE PIN_ESP32_MODE
|
||||
#define ESP_SERIAL_PORT ESP32_SERIAL
|
||||
|
||||
// Serial2, (UART1) connected to SARA-R4XX modem
|
||||
#define PIN_SERIAL2_TX (4u)
|
||||
#define PIN_SERIAL2_RX (5u)
|
||||
#define PIN_SERIAL2_CTS (6u)
|
||||
#define PIN_SERIAL2_RTS (7u)
|
||||
#define PIN_SARA_DTR (12u)
|
||||
#define PIN_SARA_ON (13u)
|
||||
#define PIN_SARA_RST (14u)
|
||||
#define PIN_SARA_PWR (15u)
|
||||
#define SARA_SERIAL_PORT Serial2
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (20u)
|
||||
#define PIN_SPI0_MOSI (23u)
|
||||
#define PIN_SPI0_SCK (22u)
|
||||
#define PIN_SPI0_SS (21u)
|
||||
|
||||
// Not pinned out
|
||||
#define PIN_SPI1_MISO (31u)
|
||||
#define PIN_SPI1_MOSI (31u)
|
||||
#define PIN_SPI1_SCK (31u)
|
||||
#define PIN_SPI1_SS (31u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (0u)
|
||||
#define PIN_WIRE0_SCL (1u)
|
||||
|
||||
// Not pinned out
|
||||
#define PIN_WIRE1_SDA (31u)
|
||||
#define PIN_WIRE1_SCL (31u)
|
||||
|
||||
#define SERIAL_HOWMANY (2u)
|
||||
#define SPI_HOWMANY (1u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (3u)
|
||||
|
||||
|
||||
// Neopixel
|
||||
#define PIN_NEOPIXEL (25u)
|
||||
#define NUM_NEOPIXEL (2u)
|
||||
#define PIN_RGB PIN_NEOPIXEL
|
||||
|
||||
// Buzzer
|
||||
#define PIN_BUZZER (8u)
|
||||
|
||||
// Button
|
||||
#define PIN_BUTTON (2u)
|
||||
|
||||
|
||||
|
||||
// Serial 1
|
||||
#define PIN_SERIAL1_TX (0u)
|
||||
#define PIN_SERIAL1_RX (1u)
|
||||
|
||||
// Serial 2 (Not pinned out)
|
||||
#define PIN_SERIAL2_TX (31u)
|
||||
#define PIN_SERIAL2_RX (31u)
|
||||
|
||||
// SPI 0
|
||||
#define PIN_SPI0_MISO (12u)
|
||||
#define PIN_SPI0_MOSI (11u)
|
||||
#define PIN_SPI0_SCK (10u)
|
||||
#define PIN_SPI0_SS (13u)
|
||||
|
||||
// SPI 1 (Not pinned out)
|
||||
#define PIN_SPI1_MISO (31u)
|
||||
#define PIN_SPI1_MOSI (31u)
|
||||
#define PIN_SPI1_SCK (31u)
|
||||
#define PIN_SPI1_SS (31u)
|
||||
|
||||
// Wire
|
||||
#define PIN_WIRE0_SDA (20u)
|
||||
#define PIN_WIRE0_SCL (21u)
|
||||
|
||||
#define PIN_WIRE1_SDA (26u)
|
||||
#define PIN_WIRE1_SCL (27u)
|
||||
|
||||
|
||||
|
||||
#define SERIAL_HOWMANY (1u)
|
||||
#define SPI_HOWMANY (1u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
#include "../generic/common.h"
|
||||
@@ -7,6 +7,7 @@
|
||||
#define NUM_ANALOG_INPUTS (4u)
|
||||
#define NUM_ANALOG_OUTPUTS (0u)
|
||||
#define ADC_RESOLUTION (12u)
|
||||
#define WIRE_INTERFACES_COUNT (WIRE_HOWMANY)
|
||||
|
||||
#ifdef PIN_LED
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
Reference in New Issue
Block a user