Compare commits
@@ -14,21 +14,21 @@ jobs:
|
||||
name: Check spelling
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: Run codespell
|
||||
uses: codespell-project/actions-codespell@master
|
||||
with:
|
||||
skip: ./pico-extras,./ArduinoCore-API,./libraries/ESP8266SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst,./cores/rp2040/api,./libraries/FreeRTOS
|
||||
ignore_words_list: ser,DOUT
|
||||
skip: ./ArduinoCore-API,./libraries/ESP8266SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst,./cores/rp2040/api,./libraries/FreeRTOS
|
||||
ignore_words_list: ser,dout
|
||||
|
||||
# Consistent style
|
||||
astyle:
|
||||
name: Style, Boards, Package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- name: Check package references
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
matrix:
|
||||
chunk: [0, 1, 2, 3]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v2
|
||||
@@ -81,8 +81,6 @@ jobs:
|
||||
run: |
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd ../pico-extras
|
||||
git submodule update --init
|
||||
cd ..
|
||||
bash ./tests/build.sh
|
||||
|
||||
@@ -91,7 +89,7 @@ jobs:
|
||||
name: Build TinyUSB Examples
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v2
|
||||
@@ -111,8 +109,6 @@ jobs:
|
||||
run: |
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd ../pico-extras
|
||||
git submodule update --init
|
||||
cd ..
|
||||
bash ./tests/build-tinyusb.sh
|
||||
|
||||
@@ -121,7 +117,7 @@ jobs:
|
||||
name: Windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v2
|
||||
@@ -147,8 +143,6 @@ jobs:
|
||||
try { Get-Command python3 } catch { copy (get-command python).source (get-command python).source.Replace("python.exe", "python3.exe") }
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd ../pico-extras
|
||||
git submodule update --init
|
||||
cd ..
|
||||
bash ./tests/build.sh
|
||||
|
||||
@@ -158,7 +152,7 @@ jobs:
|
||||
name: Mac
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-python@v2
|
||||
@@ -181,8 +175,40 @@ jobs:
|
||||
run: |
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd ../pico-extras
|
||||
git submodule update --init
|
||||
cd ..
|
||||
bash ./tests/build.sh
|
||||
|
||||
# Build a few examples with PlatformIO to test if integration works
|
||||
build-platformio:
|
||||
name: Build PlatformIO Examples
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
pio pkg install --global --platform https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
pio pkg install --global --tool symlink://.
|
||||
- name: Build Multicore Example
|
||||
run: pio ci --board=rpipico --board=adafruit_feather -O "platform_packages=framework-arduinopico@symlink:///home/runner/work/arduino-pico/arduino-pico" libraries/rp2040/examples/Multicore/Multicore.ino
|
||||
- name: Build Fade Example
|
||||
run: pio ci --board=rpipico --board=adafruit_feather -O "platform_packages=framework-arduinopico@symlink:///home/runner/work/arduino-pico/arduino-pico" libraries/rp2040/examples/Fade/Fade.ino
|
||||
- name: Build TinyUSB Example
|
||||
run: pio ci --board=rpipico --board=adafruit_feather -O "platform_packages=framework-arduinopico@symlink:///home/runner/work/arduino-pico/arduino-pico" -O "build_flags=-DUSE_TINYUSB" libraries/Adafruit_TinyUSB_Arduino/examples/CDC/cdc_multi/cdc_multi.ino
|
||||
@@ -12,16 +12,36 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
- name: Deploy updated JSON
|
||||
env:
|
||||
TRAVIS_BUILD_DIR: ${{ github.workspace }}
|
||||
BUILD_TYPE: package
|
||||
CI_GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
|
||||
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
|
||||
run: |
|
||||
pip3 install PyGithub
|
||||
TAG=$(git describe --exact-match --tags)
|
||||
curl -L -o package_rp2040_index.json "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/$TAG/package_rp2040_index.json"
|
||||
./package/update_release.py --token ${CI_GITHUB_API_KEY} --repo "$GITHUB_REPOSITORY" --tag global package_rp2040_index.json
|
||||
# Upload to Platform.IO
|
||||
curl -LO $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/download/$TAG/rp2040-$TAG.zip
|
||||
pio package publish rp2040-$TAG.zip --non-interactive
|
||||
|
||||
@@ -29,7 +29,6 @@ jobs:
|
||||
CI_GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(cd pico-sdk && git submodule update --init)
|
||||
(cd pico-extras && git submodule update --init)
|
||||
(cd ./package && bash ./build_boards_manager_package.sh)
|
||||
pip3 install PyGithub
|
||||
# Create a draft release and upload the ZIP and JSON files.
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
[submodule "libraries/SdFat"]
|
||||
path = libraries/ESP8266SdFat
|
||||
url = https://github.com/earlephilhower/ESP8266SdFat.git
|
||||
[submodule "pico-extras"]
|
||||
path = pico-extras
|
||||
url = https://github.com/raspberrypi/pico-extras.git
|
||||
[submodule "libraries/Keyboard"]
|
||||
path = libraries/Keyboard
|
||||
url = https://github.com/earlephilhower/Keyboard
|
||||
|
||||
@@ -24,6 +24,7 @@ See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for m
|
||||
* DeRuiLab FlyBoard2040 Core
|
||||
* DFRobot Beetle RP2040
|
||||
* Invector Labs Challenger RP2040 WiFi
|
||||
* Invector Labs Challenger RP2040 WiFi/BLE
|
||||
* Invector Labs Challenger NB RP2040 WiFi
|
||||
* Invector Labs Challenger RP2040 LTE
|
||||
* Invector Labs Challenger RP2040 LoRa
|
||||
@@ -35,6 +36,8 @@ See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for m
|
||||
* SparkFun Thing Plus RP2040
|
||||
* uPesy RP2040 DevKit
|
||||
* WIZnet W5100S-EVB-Pico
|
||||
* WIZnet W5500-EVB-Pico
|
||||
* WIZnet WizFi360-EVB-Pico
|
||||
* Generic (configurable flash, I/O pins)
|
||||
|
||||
# Installing via Arduino Boards Manager
|
||||
@@ -70,8 +73,6 @@ cd ~/Arduino/hardware/pico/rp2040
|
||||
git submodule update --init
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd ../pico-extras
|
||||
git submodule update --init
|
||||
cd ../tools
|
||||
python3 ./get.py
|
||||
`````
|
||||
@@ -143,14 +144,16 @@ The installed tools include a version of OpenOCD (in the pqt-openocd directory)
|
||||
* Generic Arduino USB Serial, Keyboard, and Mouse emulation
|
||||
* 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
|
||||
* Peripherals: SPI master, Wire(I2C) master/slave, dual UART, emulated EEPROM, I2S audio output, Servo
|
||||
* Peripherals: SPI master, Wire(I2C) master/slave, dual UART, emulated EEPROM, I2S audio input, I2S audio 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)
|
||||
|
||||
@@ -168,7 +171,7 @@ If you want to contribute or have bugfixes, drop me a note at <earlephilhower@ya
|
||||
# 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.
|
||||
* The [Pico-SDK](https://github.com/raspberrypi/pico-sdk) and [Pico-Extras](https://github.com/raspberrypi/pico-extras) are by Raspberry Pi (Trading) Ltd and licensed under the BSD 3-Clause license.
|
||||
* The [Pico-SDK](https://github.com/raspberrypi/pico-sdk) is by Raspberry Pi (Trading) Ltd and licensed under the BSD 3-Clause license.
|
||||
* [Arduino-Pico](https://github.com/earlephilhower/arduino-pico) core files are licensed under the LGPL.
|
||||
* [LittleFS](https://github.com/ARMmbed/littlefs) library written by ARM Limited and released under the [BSD 3-clause license](https://github.com/ARMmbed/littlefs/blob/master/LICENSE.md).
|
||||
* [UF2CONV.PY](https://github.com/microsoft/uf2) is by Microsoft Corporation and licensed under the MIT license.
|
||||
|
||||
+2472
-7
File diff suppressed because it is too large
Load Diff
@@ -47,8 +47,8 @@ static bool __no_inline_not_in_flash_func(get_bootsel_button)() {
|
||||
GPIO_OVERRIDE_NORMAL << IO_QSPI_GPIO_QSPI_SS_CTRL_OEOVER_LSB,
|
||||
IO_QSPI_GPIO_QSPI_SS_CTRL_OEOVER_BITS);
|
||||
|
||||
interrupts();
|
||||
rp2040.resumeOtherCore();
|
||||
interrupts();
|
||||
|
||||
return button_state;
|
||||
}
|
||||
|
||||
@@ -188,15 +188,6 @@ public:
|
||||
bool _autoFormat;
|
||||
};
|
||||
|
||||
class SPIFFSConfig : public FSConfig {
|
||||
public:
|
||||
static constexpr uint32_t FSId = 0x53504946;
|
||||
SPIFFSConfig(bool autoFormat = true) : FSConfig(FSId, autoFormat) { }
|
||||
|
||||
// Inherit _type and _autoFormat
|
||||
// nothing yet, enableTime TBD when SPIFFS has metadate
|
||||
};
|
||||
|
||||
class FS {
|
||||
public:
|
||||
FS(FSImplPtr impl) : _impl(impl) {
|
||||
@@ -272,11 +263,6 @@ using fs::SeekCur;
|
||||
using fs::SeekEnd;
|
||||
using fs::FSInfo;
|
||||
using fs::FSConfig;
|
||||
using fs::SPIFFSConfig;
|
||||
#endif //FS_NO_GLOBALS
|
||||
|
||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS)
|
||||
extern fs::FS SPIFFS __attribute__((deprecated("SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems.")));
|
||||
#endif
|
||||
|
||||
#endif //FS_H
|
||||
|
||||
+31
-27
@@ -120,49 +120,49 @@ int __USBGetMouseReportID() {
|
||||
return __USBInstallKeyboard ? 2 : 1;
|
||||
}
|
||||
|
||||
static int __hid_report_len = 0;
|
||||
static uint8_t *__hid_report = nullptr;
|
||||
|
||||
static uint8_t *GetDescHIDReport(int *len) {
|
||||
static uint8_t *report = nullptr;
|
||||
int report_len = 0;
|
||||
|
||||
if (report) {
|
||||
free(report);
|
||||
report = nullptr;
|
||||
if (len) {
|
||||
*len = __hid_report_len;
|
||||
}
|
||||
return __hid_report;
|
||||
}
|
||||
|
||||
void __SetupDescHIDReport() {
|
||||
if (__USBInstallKeyboard && __USBInstallMouse) {
|
||||
uint8_t desc_hid_report[] = {
|
||||
TUD_HID_REPORT_DESC_KEYBOARD(HID_REPORT_ID(1)),
|
||||
TUD_HID_REPORT_DESC_MOUSE(HID_REPORT_ID(2))
|
||||
};
|
||||
report_len = sizeof(desc_hid_report);
|
||||
report = (uint8_t *)malloc(report_len);
|
||||
if (report) {
|
||||
memcpy(report, desc_hid_report, report_len);
|
||||
__hid_report = (uint8_t *)malloc(sizeof(desc_hid_report));
|
||||
if (__hid_report) {
|
||||
__hid_report_len = sizeof(desc_hid_report);
|
||||
memcpy(__hid_report, desc_hid_report, __hid_report_len);
|
||||
}
|
||||
} else if (__USBInstallKeyboard && ! __USBInstallMouse) {
|
||||
uint8_t desc_hid_report[] = {
|
||||
TUD_HID_REPORT_DESC_KEYBOARD(HID_REPORT_ID(1))
|
||||
};
|
||||
report_len = sizeof(desc_hid_report);
|
||||
report = (uint8_t *)malloc(report_len);
|
||||
if (report) {
|
||||
memcpy(report, desc_hid_report, report_len);
|
||||
__hid_report = (uint8_t *)malloc(sizeof(desc_hid_report));
|
||||
if (__hid_report) {
|
||||
__hid_report_len = sizeof(desc_hid_report);
|
||||
memcpy(__hid_report, desc_hid_report, __hid_report_len);
|
||||
}
|
||||
} else { // if (!__USBInstallKeyboard && __USBInstallMouse) {
|
||||
} else if (! __USBInstallKeyboard && __USBInstallMouse) {
|
||||
uint8_t desc_hid_report[] = {
|
||||
TUD_HID_REPORT_DESC_MOUSE(HID_REPORT_ID(1))
|
||||
};
|
||||
report_len = sizeof(desc_hid_report);
|
||||
report = (uint8_t *)malloc(report_len);
|
||||
if (report) {
|
||||
memcpy(report, desc_hid_report, report_len);
|
||||
__hid_report = (uint8_t *)malloc(sizeof(desc_hid_report));
|
||||
if (__hid_report) {
|
||||
__hid_report_len = sizeof(desc_hid_report);
|
||||
memcpy(__hid_report, desc_hid_report, __hid_report_len);
|
||||
}
|
||||
} else {
|
||||
__hid_report = nullptr;
|
||||
__hid_report_len = 0;
|
||||
}
|
||||
|
||||
if (len) {
|
||||
*len = report_len;
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
// Invoked when received GET HID REPORT DESCRIPTOR
|
||||
@@ -173,11 +173,13 @@ uint8_t const * tud_hid_descriptor_report_cb(uint8_t instance) {
|
||||
return GetDescHIDReport(nullptr);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t *usbd_desc_cfg = nullptr;
|
||||
const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
|
||||
(void)index;
|
||||
static uint8_t *usbd_desc_cfg = nullptr;
|
||||
return usbd_desc_cfg;
|
||||
}
|
||||
|
||||
void __SetupUSBDescriptor() {
|
||||
if (!usbd_desc_cfg) {
|
||||
bool hasHID = __USBInstallKeyboard || __USBInstallMouse;
|
||||
|
||||
@@ -229,7 +231,6 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return usbd_desc_cfg;
|
||||
}
|
||||
|
||||
const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
@@ -295,6 +296,9 @@ void __USBStart() {
|
||||
return;
|
||||
}
|
||||
|
||||
__SetupDescHIDReport();
|
||||
__SetupUSBDescriptor();
|
||||
|
||||
mutex_init(&__usb_mutex);
|
||||
|
||||
tusb_init();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#define ARDUINO_PICO_MAJOR 2
|
||||
#define ARDUINO_PICO_MINOR 0
|
||||
#define ARDUINO_PICO_REVISION 0
|
||||
#define ARDUINO_PICO_VERSION_STR "2.0.0"
|
||||
#define ARDUINO_PICO_MINOR 2
|
||||
#define ARDUINO_PICO_REVISION 1
|
||||
#define ARDUINO_PICO_VERSION_STR "2.2.1"
|
||||
|
||||
@@ -257,8 +257,23 @@ void SerialPIO::end() {
|
||||
if (!_running) {
|
||||
return;
|
||||
}
|
||||
// TODO: Deallocate PIO resources, stop them
|
||||
_pioSP[pio_get_index(_rxPIO)][_rxSM] = nullptr;
|
||||
if (_tx != NOPIN) {
|
||||
pio_sm_set_enabled(_txPIO, _txSM, false);
|
||||
}
|
||||
if (_rx != NOPIN) {
|
||||
pio_sm_set_enabled(_rxPIO, _rxSM, false);
|
||||
_pioSP[pio_get_index(_rxPIO)][_rxSM] = nullptr;
|
||||
// If no more active, disable the IRQ
|
||||
auto pioNum = pio_get_index(_rxPIO);
|
||||
bool used = false;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
used = used || !!_pioSP[pioNum][i];
|
||||
}
|
||||
if (!used) {
|
||||
auto irqno = pioNum == 0 ? PIO0_IRQ_0 : PIO1_IRQ_0;
|
||||
irq_set_enabled(irqno, false);
|
||||
}
|
||||
}
|
||||
_running = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
// Not to be called by users, only from the IRQ handler. In public so that the C-language IQR callback can access it
|
||||
void _handleIRQ();
|
||||
|
||||
private:
|
||||
protected:
|
||||
bool _running = false;
|
||||
pin_size_t _tx, _rx;
|
||||
int _baud;
|
||||
|
||||
+30
-14
@@ -350,18 +350,6 @@ SerialUART::operator bool() {
|
||||
return _running;
|
||||
}
|
||||
|
||||
#if defined(PIN_SERIAL1_RTS)
|
||||
SerialUART Serial1(uart0, PIN_SERIAL1_TX, PIN_SERIAL1_RX, PIN_SERIAL1_RTS, PIN_SERIAL1_CTS);
|
||||
#else
|
||||
SerialUART Serial1(uart0, PIN_SERIAL1_TX, PIN_SERIAL1_RX);
|
||||
#endif
|
||||
|
||||
#if defined(PIN_SERIAL2_RTS)
|
||||
SerialUART Serial2(uart1, PIN_SERIAL2_TX, PIN_SERIAL2_RX, PIN_SERIAL2_RTS, PIN_SERIAL2_CTS);
|
||||
#else
|
||||
SerialUART Serial2(uart1, PIN_SERIAL2_TX, PIN_SERIAL2_RX);
|
||||
#endif
|
||||
|
||||
void arduino::serialEvent1Run(void) {
|
||||
if (serialEvent1 && Serial1.available()) {
|
||||
serialEvent1();
|
||||
@@ -406,10 +394,38 @@ void __not_in_flash_func(SerialUART::_handleIRQ)(bool inIRQ) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __SERIAL1_DEVICE
|
||||
#define __SERIAL1_DEVICE uart0
|
||||
#endif
|
||||
#ifndef __SERIAL2_DEVICE
|
||||
#define __SERIAL2_DEVICE uart1
|
||||
#endif
|
||||
|
||||
#if defined(PIN_SERIAL1_RTS)
|
||||
SerialUART Serial1(__SERIAL1_DEVICE, PIN_SERIAL1_TX, PIN_SERIAL1_RX, PIN_SERIAL1_RTS, PIN_SERIAL1_CTS);
|
||||
#else
|
||||
SerialUART Serial1(__SERIAL1_DEVICE, PIN_SERIAL1_TX, PIN_SERIAL1_RX);
|
||||
#endif
|
||||
|
||||
#if defined(PIN_SERIAL2_RTS)
|
||||
SerialUART Serial2(__SERIAL2_DEVICE, PIN_SERIAL2_TX, PIN_SERIAL2_RX, PIN_SERIAL2_RTS, PIN_SERIAL2_CTS);
|
||||
#else
|
||||
SerialUART Serial2(__SERIAL2_DEVICE, PIN_SERIAL2_TX, PIN_SERIAL2_RX);
|
||||
#endif
|
||||
|
||||
|
||||
static void __not_in_flash_func(_uart0IRQ)() {
|
||||
Serial1._handleIRQ();
|
||||
if (__SERIAL1_DEVICE == uart0) {
|
||||
Serial1._handleIRQ();
|
||||
} else {
|
||||
Serial2._handleIRQ();
|
||||
}
|
||||
}
|
||||
|
||||
static void __not_in_flash_func(_uart1IRQ)() {
|
||||
Serial2._handleIRQ();
|
||||
if (__SERIAL2_DEVICE == uart1) {
|
||||
Serial2._handleIRQ();
|
||||
} else {
|
||||
Serial1._handleIRQ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,35 @@
|
||||
class SoftwareSerial : public SerialPIO {
|
||||
public:
|
||||
// Note the rx/tx pins are swapped in PIO vs SWSerial
|
||||
SoftwareSerial(pin_size_t rx, pin_size_t tx, bool invert = true) : SerialPIO(tx, rx) {
|
||||
if (invert) {
|
||||
panic("SoftwareSerial inverted operation not supported\n");
|
||||
SoftwareSerial(pin_size_t rx, pin_size_t tx, bool invert = false) : SerialPIO(tx, rx) {
|
||||
_invert = invert;
|
||||
}
|
||||
|
||||
~SoftwareSerial() {
|
||||
if (_invert) {
|
||||
gpio_set_outover(_tx, 0);
|
||||
gpio_set_outover(_rx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void begin(unsigned long baud = 115200) override {
|
||||
begin(baud, SERIAL_8N1);
|
||||
};
|
||||
|
||||
void begin(unsigned long baud, uint16_t config) override {
|
||||
SerialPIO::begin(baud, config);
|
||||
if (_invert) {
|
||||
gpio_set_outover(_tx, GPIO_OVERRIDE_INVERT);
|
||||
gpio_set_inover(_rx, GPIO_OVERRIDE_INVERT);
|
||||
}
|
||||
}
|
||||
|
||||
void listen() { /* noop */ }
|
||||
|
||||
bool isListening() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
bool _invert;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
Newlib retargetable lock class using RP2040 SDK
|
||||
|
||||
Overrides weak functions in Newlib for locking to safely support
|
||||
multi-core operation. Does not need any --wrap for memory allocators.
|
||||
|
||||
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 <pico/mutex.h>
|
||||
#include <sys/lock.h>
|
||||
|
||||
// HACK ALERT
|
||||
// Pico-SDK defines mutex which can be at global scope, but when the auto_init_
|
||||
// macros are used they are defined as static. Newlib needs global access to
|
||||
// these mutextes, so instead of hacking pico-sdk just make "static" a no-op.
|
||||
|
||||
#define static
|
||||
auto_init_recursive_mutex(__lock___sinit_recursive_mutex);
|
||||
auto_init_recursive_mutex(__lock___sfp_recursive_mutex);
|
||||
auto_init_recursive_mutex(__lock___atexit_recursive_mutex);
|
||||
auto_init_mutex(__lock___at_quick_exit_mutex);
|
||||
auto_init_recursive_mutex(__lock___malloc_recursive_mutex);
|
||||
auto_init_recursive_mutex(__lock___env_recursive_mutex);
|
||||
auto_init_mutex(__lock___tz_mutex);
|
||||
auto_init_mutex(__lock___dd_hash_mutex);
|
||||
auto_init_mutex(__lock___arc4random_mutex);
|
||||
#undef static
|
||||
|
||||
void __retarget_lock_init(_LOCK_T *lock) {
|
||||
mutex_init((mutex_t*) lock);
|
||||
}
|
||||
|
||||
void __retarget_lock_init_recursive(_LOCK_T *lock) {
|
||||
recursive_mutex_init((recursive_mutex_t*) lock);
|
||||
}
|
||||
|
||||
void __retarget_lock_close(_LOCK_T lock) {
|
||||
(void) lock;
|
||||
}
|
||||
|
||||
void __retarget_lock_close_recursive(_LOCK_T lock) {
|
||||
(void) lock;
|
||||
}
|
||||
|
||||
void __retarget_lock_acquire(_LOCK_T lock) {
|
||||
mutex_enter_blocking((mutex_t*)lock);
|
||||
}
|
||||
|
||||
void __retarget_lock_acquire_recursive(_LOCK_T lock) {
|
||||
recursive_mutex_enter_blocking((recursive_mutex_t*)lock);
|
||||
}
|
||||
|
||||
int __retarget_lock_try_acquire(_LOCK_T lock) {
|
||||
return mutex_try_enter((mutex_t *)lock, NULL);
|
||||
}
|
||||
|
||||
int __retarget_lock_try_acquire_recursive(_LOCK_T lock) {
|
||||
return recursive_mutex_try_enter((recursive_mutex_t*)lock, NULL);
|
||||
}
|
||||
|
||||
void __retarget_lock_release(_LOCK_T lock) {
|
||||
mutex_exit((mutex_t*)lock);
|
||||
}
|
||||
|
||||
void __retarget_lock_release_recursive(_LOCK_T lock) {
|
||||
recursive_mutex_exit((recursive_mutex_t*)lock);
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RP2040USB.h"
|
||||
#include <pico/stdlib.h>
|
||||
#include <pico/multicore.h>
|
||||
#include <reent.h>
|
||||
|
||||
RP2040 rp2040;
|
||||
extern "C" {
|
||||
@@ -72,6 +73,7 @@ extern void __loop() {
|
||||
arduino::serialEvent2Run();
|
||||
}
|
||||
}
|
||||
static struct _reent *_impure_ptr1 = nullptr;
|
||||
|
||||
extern "C" int main() {
|
||||
#if F_CPU != 125000000
|
||||
@@ -81,6 +83,12 @@ extern "C" int main() {
|
||||
// Let rest of core know if we're using FreeRTOS
|
||||
__isFreeRTOS = initFreeRTOS ? true : false;
|
||||
|
||||
// Allocate impure_ptr (newlib temps) if there is a 2nd core running
|
||||
if (!__isFreeRTOS && (setup1 || loop1)) {
|
||||
_impure_ptr1 = (struct _reent*)calloc(sizeof(struct _reent), 1);
|
||||
_REENT_INIT_PTR(_impure_ptr1);
|
||||
}
|
||||
|
||||
mutex_init(&_pioMutex);
|
||||
|
||||
rp2040.begin();
|
||||
@@ -142,3 +150,21 @@ extern "C" int main() {
|
||||
extern "C" unsigned long ulMainGetRunTimeCounterValue() {
|
||||
return rp2040.getCycleCount64();
|
||||
}
|
||||
|
||||
extern "C" void __register_impure_ptr(struct _reent *p) {
|
||||
if (get_core_num() == 0) {
|
||||
_impure_ptr = p;
|
||||
} else {
|
||||
_impure_ptr1 = p;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO: FreeRTOS should implement this based on thread ID (and each thread should have its own struct _reent
|
||||
extern "C" struct _reent *__wrap___getreent() {
|
||||
if (get_core_num() == 0) {
|
||||
return _impure_ptr;
|
||||
} else {
|
||||
return _impure_ptr1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,26 +45,40 @@ extern "C" void noInterrupts() {
|
||||
// Only 1 GPIO IRQ callback for all pins, so we need to look at the pin it's for and
|
||||
// dispatch to the real callback manually
|
||||
auto_init_mutex(_irqMutex);
|
||||
static std::map<pin_size_t, voidFuncPtr> _map;
|
||||
class CBInfo {
|
||||
public:
|
||||
CBInfo(voidFuncPtr cb) : _cb(cb), _useParam(false), _param(nullptr) { };
|
||||
CBInfo(voidFuncPtrParam cbParam, void *param) : _cbParam(cbParam), _useParam(true), _param(param) { };
|
||||
void callback() {
|
||||
if (_useParam && _cbParam) {
|
||||
_cbParam(_param);
|
||||
} else if (_cb) {
|
||||
_cb();
|
||||
}
|
||||
}
|
||||
private:
|
||||
union {
|
||||
voidFuncPtr _cb;
|
||||
voidFuncPtrParam _cbParam;
|
||||
};
|
||||
bool _useParam;
|
||||
void *_param;
|
||||
};
|
||||
|
||||
|
||||
static std::map<pin_size_t, CBInfo> _map;
|
||||
|
||||
void _gpioInterruptDispatcher(uint gpio, uint32_t events) {
|
||||
(void) events;
|
||||
// Only need to lock around the std::map check, not the whole IRQ callback
|
||||
voidFuncPtr cb = nullptr;
|
||||
{
|
||||
CoreMutex m(&_irqMutex);
|
||||
if (m) {
|
||||
auto irq = _map.find(gpio);
|
||||
if (irq != _map.end()) {
|
||||
cb = irq->second;
|
||||
}
|
||||
CoreMutex m(&_irqMutex);
|
||||
if (m) {
|
||||
auto irq = _map.find(gpio);
|
||||
if (irq != _map.end()) {
|
||||
auto cb = irq->second;
|
||||
cb.callback();
|
||||
}
|
||||
}
|
||||
if (cb) {
|
||||
cb(); // Do the callback
|
||||
} else {
|
||||
// ERROR, but we're in an IRQ so do nothing
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void attachInterrupt(pin_size_t pin, voidFuncPtr callback, PinStatus mode) {
|
||||
@@ -84,7 +98,31 @@ extern "C" void attachInterrupt(pin_size_t pin, voidFuncPtr callback, PinStatus
|
||||
}
|
||||
noInterrupts();
|
||||
detachInterrupt(pin);
|
||||
_map.insert({pin, callback});
|
||||
CBInfo cb(callback);
|
||||
_map.insert({pin, cb});
|
||||
gpio_set_irq_enabled_with_callback(pin, events, true, _gpioInterruptDispatcher);
|
||||
interrupts();
|
||||
}
|
||||
|
||||
void attachInterruptParam(pin_size_t pin, voidFuncPtrParam callback, PinStatus mode, void *param) {
|
||||
CoreMutex m(&_irqMutex);
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t events;
|
||||
switch (mode) {
|
||||
case LOW: events = 1; break;
|
||||
case HIGH: events = 2; break;
|
||||
case FALLING: events = 4; break;
|
||||
case RISING: events = 8; break;
|
||||
case CHANGE: events = 4 | 8; break;
|
||||
default: return; // ERROR
|
||||
}
|
||||
noInterrupts();
|
||||
detachInterrupt(pin);
|
||||
CBInfo cb(callback, param);
|
||||
_map.insert({pin, cb});
|
||||
gpio_set_irq_enabled_with_callback(pin, events, true, _gpioInterruptDispatcher);
|
||||
interrupts();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ int analogRead(pin_size_t pin = A0..A3)
|
||||
Returns a value from 0...4095 correspionding to the ADC reading
|
||||
of the specific pin.
|
||||
|
||||
void analogReadResolution(int bits)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Determines the resolution (in bits) of the value returned by the analogRead() function.
|
||||
Default resolution is 10bit.
|
||||
|
||||
float analogReadTemp()
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
Returns the temperature, in Celsius, of the onboard thermal sensor.
|
||||
|
||||
+144
-52
@@ -1,89 +1,181 @@
|
||||
I2S (Digital Audio) Output Library
|
||||
==================================
|
||||
I2S (Digital Audio) Audio Library
|
||||
=================================
|
||||
|
||||
While the RP2040 chip on the Raspberry Pi Pico does not include a hardware
|
||||
I2S device, it is possible to use the PIO (Programmable I/O) state machines
|
||||
to implement one dynamically.
|
||||
|
||||
This I2S library uses the ``pico-extras`` I2S audio library and wraps it in
|
||||
an Arduino I2S library. It supports 16 bits/sample and frequencies of up
|
||||
to 48kHZ, with configurable BCLK, LRCLK(always pin "BCLK + 1"), and DOUT pins.
|
||||
Digital audio input and output are supported at 8, 16, 24, and 32 bits per
|
||||
sample.
|
||||
|
||||
Theoretically up to 6 I2S ports may be created, but in practice there
|
||||
may not be enough resources (DMA, PIO SM) to actually create and use so
|
||||
many.
|
||||
|
||||
Create an I2S port by instantiating a variable of the I2S class
|
||||
specifying the direction. Configure it using API calls below before
|
||||
using it.
|
||||
|
||||
**Note:** This I2S device takes over the entire PIO1 (second) unit and adjusts
|
||||
its clock frequency to meet the I2S needs. That means when only 4 Tones
|
||||
or only 4 Servos may be used when the I2S device is used.
|
||||
|
||||
I2S Class API
|
||||
-------------
|
||||
|
||||
I2S(OUTPUT)
|
||||
~~~~~~~~~~~
|
||||
Creates an I2S output port. Needs to be connected up to the
|
||||
desired pins (see below) and started before any output can happen.
|
||||
|
||||
I2S(INPUT)
|
||||
~~~~~~~~~~
|
||||
Creates an I2S input port. Needs to be connected up to the
|
||||
desired pins (see below) and started before any input can happen.
|
||||
|
||||
bool setBCLK(pin_size_t pin)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sets the BCLK pin of the I2S device. The LRCLK/word clock will be ``pin + 1``
|
||||
due to limitations of the PIO state machines. Call this before ``I2S.begin()``
|
||||
Default BCLK = 26, LRCLK = 27
|
||||
due to limitations of the PIO state machines. Call this before ``I2S::begin()``
|
||||
|
||||
bool setDOUT(pin_size_t pin)
|
||||
bool setDATA(pin_size_t pin)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sets the DOUT pin of the I2S device. Any pin may be used. Default DOUT = 28
|
||||
Call before ``I2S.begin()``
|
||||
Sets the DOUT or DIN pin of the I2S device. Any pin may be used.
|
||||
Call before ``I2S::begin()``
|
||||
|
||||
bool begin(long sampleRate)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start the I2S device up with the given sample rate. The pins selected above
|
||||
will be turned to output and the I2S will begin to drive silence frames (all
|
||||
zero) out.
|
||||
bool setBitsPerSample(int bits)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Specify how many bits per audio sample to read or write. Note that
|
||||
for 24-bit samples, audio samples must be left-aligned (i.e. bits 31...8).
|
||||
Call before ``I2S::begin()``
|
||||
|
||||
bool setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample = 0)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Set the number of DMA buffers and their size in 32-bit words as well as
|
||||
the word to fill when no data is available to send to the I2S hardware.
|
||||
Call before ``I2S::begin()``.
|
||||
|
||||
bool setFrequency(long sampleRate)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sets the word clock frequency, but does not start the I2S device if not
|
||||
already running. May be called after ``I2S::begin()`` to change the
|
||||
sample rate on-the-fly.
|
||||
|
||||
bool begin()/begin(long sampleRate)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Start the I2S device up with the given sample rate, or with the value set
|
||||
using the prior ``setFrequency`` call.
|
||||
|
||||
void end()
|
||||
~~~~~~~~~~
|
||||
Stops the I2S device. **Note, at present the memory allocated for I2S buffers
|
||||
is not freed leading to a memory leak when ``end()`` is called. This is due
|
||||
to the state of the ``pico-extras`` release which this code uses.**
|
||||
Stops the I2S device.
|
||||
|
||||
void flush()
|
||||
~~~~~~~~~~~~
|
||||
Sends any partial frames in memory to the I2S output device. They may NOT play
|
||||
immediately. Potential use case for this call would be when the frequency of
|
||||
the output will be changing.
|
||||
Waits until all the I2S buffers have been output.
|
||||
|
||||
size_t write(uint8_t)
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
Provided for compatibility, but not very useful. Writes a sample from 0...255
|
||||
to the I2S buffer. See ``write(int16_t)`` for a better one
|
||||
size_t write(uint8_t/int8_t/int16_t/int32_t)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes a single sample of ``bitsPerSample`` to the buffer. It is up to the
|
||||
user to keep track of left/right channels. Note this writes data equivalent
|
||||
to one channel's data, not the size of the passed in variable (i.e. if you have
|
||||
a 16-bit sample size and ``write((int8_t)-5); write((int8_t)5);`` you will have
|
||||
written **2 samples** to the I2S buffer of whatever the I2S size, not a single
|
||||
16-bit sample.
|
||||
|
||||
This call will block (wait) until space is available to actually write
|
||||
the data.
|
||||
|
||||
size_t write(int32_t val, bool sync)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes 32 bits of data to the I2S buffer (regardless of the configured I2S
|
||||
bit size). When ``sync`` is true, it will not return until the data has
|
||||
been writte. When ``sync`` is false, it will return ``0`` immediately if
|
||||
there is no space present in the I2S buffer.
|
||||
|
||||
size_t write(const uint8_t \*buffer, size_t size)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Transfers number of bytes from an application buffer to the I2S output buffer.
|
||||
Be aware that ``size`` is in *bytes** and not samples. Size must be a multiple
|
||||
of **4 bytes** (i.e. one left/right sample). Will not block, so check
|
||||
the return value to find out how many bytes were actually written.
|
||||
of **4 bytes**. Will not block, so check the return value to find out how
|
||||
many bytes were actually written.
|
||||
|
||||
int availableForWrite()
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Returns the number of **32-bit L/R samples** that can be written without
|
||||
Returns the number of L/R samples that can be written without
|
||||
potentially blocking.
|
||||
|
||||
bool setFrequency(int newFreq)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Adjusts the I2S output frequency. When changing frequency while I2S output
|
||||
is underway, be sure to use ``I2S.flush()`` before changing the frequency to
|
||||
ensure the older data is played at the right frequency.
|
||||
int read()
|
||||
~~~~~~~~~~
|
||||
Reads a single sample of I2S data, whatever the I2S sample size is configured.
|
||||
Will not return until data is available.
|
||||
|
||||
size_t write(int16_t)
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes a single 16-bit left or right sample to the I2S output buffer. The
|
||||
user is required to ensure that an even number of samples is written (i.e.
|
||||
left and right) over the application lifetime. The application also needs
|
||||
to track which sample is next to be written (right/left). For this reason,
|
||||
the ``write(void *b, size_t lrsamples)`` call may be easier and faster to use.
|
||||
int peek()
|
||||
~~~~~~~~~~
|
||||
Returns the next sample to be read from the I2S buffer (without actually
|
||||
removing it).
|
||||
|
||||
size_t write(const void \*buffer, size_t lrsamples)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes up to size left+right packed samples to the I2S device. Non-blocking,
|
||||
will writefrom 0...size samples and return that count. Be sure your app
|
||||
handles partial writes (i.e. by ``yield()`` ing and then retrying to write the
|
||||
remaining data.)
|
||||
void onTransmit(void (\*fn)(void))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sets a callback to be called when an I2S DMA buffer is fully transmitted.
|
||||
Will be in an interrupt context so the specified function must operate
|
||||
quickly and not use blocking calls like delay() or write to the I2S.
|
||||
|
||||
The ``onTransmit`` callback is not supported.
|
||||
void onReceive(void (\*fn)(void))
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sets a callback to be called when an I2S DMA buffer is fully read in.
|
||||
Will be in an interrupt context so the specified function must operate
|
||||
quickly and not use blocking calls like delay() or read from the I2S.
|
||||
|
||||
See the `ESP8266Audio <https://github.com/earlephilhower/ESP8266Audio>`_ library
|
||||
for a working example, or look at the included sample tone generator.
|
||||
Sample Writing/Reading API
|
||||
--------------------------
|
||||
Because I2S streams consist of a natural left and right sample, it is often
|
||||
convenient to write or read both with a single call. The following calls
|
||||
allow applications to read or write both samples at the same time, and
|
||||
explicitly indicate the bit widths required (to avoid potential issues with
|
||||
type conversion on calls).
|
||||
|
||||
size_t write8(int8_t l, int8_t r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes a left and right 8-bit sample to the I2S buffers. Blocks until space
|
||||
is available.
|
||||
|
||||
size_t write16(int16_t l, int16_t r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes a left and right 16-bit sample to the I2S buffers. Blocks until space
|
||||
is available.
|
||||
|
||||
size_t write24(int32_t l, int32_t r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes a left and right 24-bit sample to the I2S buffers. See note below
|
||||
about 24-bit mode. Blocks until space is available.
|
||||
|
||||
size_t write32(int32_t l, int32_t r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes a left and right 32-bit sample to the I2S buffers. Blocks until space
|
||||
is available.
|
||||
|
||||
bool read8(int8_t \*l, int8_t \*r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reads a left and right 8-bit sample and returns ``true`` on success. Will block
|
||||
until data is available.
|
||||
|
||||
bool read16(int16_t \*l, int16_t \*r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reads a left and right 16-bit sample and returns ``true`` on success. Will block
|
||||
until data is available.
|
||||
|
||||
bool read24(int32_t \*l, int32_t \*r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reads a left and right 24-bit sample and returns ``true`` on success. See note below
|
||||
about 24-bit mode. Will block until data is available.
|
||||
|
||||
bool read32(int32_t \*l, int32_t \*r)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Reads a left and right 32-bit sample and returns ``true`` on success. Will block
|
||||
until data is available.
|
||||
|
||||
|
||||
Note About 24-bit Samples
|
||||
-------------------------
|
||||
24-bit samples are stored as left-aligned 32-bit values with bits 7..0
|
||||
ignored. Only the upper 24 bits 31...8 will be transmitted or
|
||||
received. The actual I2S protocol will only transmit or receive 24 bits
|
||||
in this mode, even though the data is 32-bit packed.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 119 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -40,8 +40,6 @@ To install via GIT (for latest and greatest versions):
|
||||
git submodule update --init
|
||||
cd pico-sdk
|
||||
git submodule update --init
|
||||
cd pico-extras
|
||||
git submodule update --init
|
||||
cd ../tools
|
||||
python3 ./get.py
|
||||
|
||||
|
||||
+1
-1
@@ -64,4 +64,4 @@ it use a non-default pinout with a simple call
|
||||
Pad Strength
|
||||
============
|
||||
|
||||
The Raspberry Pi Pico has the ability to set the current that a pin (actually the pad associated with it) is capable of supplying. The current can be set to values of 2mA, 4mA, 8mA and 12mA. By default, on a reset, the setting is 4mA. A `pinMode(x, OUTPUT)`, where `x` is the pin number, is also the default setting. 4 settings have been added for use with `pinMode`: `OUTPUT_2MA`, `OUTPUT_4MA`, which has the same behavior as `OUTPUT`, `OUTPUT_8MA` and `OUTPUT_12MA`.
|
||||
The Raspberry Pi Pico has the ability to set the current that a pin (actually the pad associated with it) is capable of supplying. The current can be set to values of 2mA, 4mA, 8mA and 12mA. By default, on a reset, the setting is 4mA. A `pinMode(x, OUTPUT)`, where `x` is the pin number, is also the default setting. 4 settings have been added for use with `pinMode`: `OUTPUT_2MA`, `OUTPUT_4MA`, which has the same behavior as `OUTPUT`, `OUTPUT_8MA` and `OUTPUT_12MA`.
|
||||
|
||||
+6
-3
@@ -3,8 +3,8 @@
|
||||
|
||||
Equivalent to the Arduino SoftwareSerial library, an emulated UART using
|
||||
one or two PIO state machines is included in the Arduino-Pico core. This
|
||||
allows for up to 8 additional serial ports to be run from the RP2040 without
|
||||
requiring additional CPU resources.
|
||||
allows for up to 4 bidirectional or up to 8 unidirectional serial ports to
|
||||
be run from the RP2040 without requiring additional CPU resources.
|
||||
|
||||
Instantiate a ``SerialPIO(txpin, rxpin, fifosize)`` object in your sketch and then
|
||||
use it the same as any other serial port. Even, odd, and no parity modes
|
||||
@@ -29,5 +29,8 @@ A ``SoftwareSerial`` wrapper is included to provide plug-and-play compatibility
|
||||
with the Arduino `Software Serial <https://docs.arduino.cc/learn/built-in-libraries/software-serial>`_
|
||||
library. Use the normal ``#include <SoftwareSerial.h>`` to include it. The following
|
||||
differences from the Arduino standard are present:
|
||||
|
||||
* Inverted mode is not supported
|
||||
* All ports are always listening. The ``listen`` call is a no-op, and ``isListening()`` always returns ``true`` .
|
||||
* All ports are always listening
|
||||
* ``listen`` call is a no-op
|
||||
* ``isListening()`` always returns ``true``
|
||||
|
||||
+100
-14
@@ -19,14 +19,14 @@ The PlatformIO experience:
|
||||
|
||||
Refer to the general documentation at https://docs.platformio.org/.
|
||||
|
||||
Especially useful is the `Getting started with VSCode + PlatformIO <https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation), [CLI reference](https://docs.platformio.org/en/latest/core/index.html) and [platformio.ini options](https://docs.platformio.org/en/latest/projectconf/index.html)>`__ page.
|
||||
Especially useful is the `Getting started with VSCode + PlatformIO <https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation>`_, `CLI reference <https://docs.platformio.org/en/latest/core/index.html>`_ and the `platformio.ini options <https://docs.platformio.org/en/latest/projectconf/index.html>`_ page.
|
||||
|
||||
Hereafter it is assumed that you have a basic understanding of PlatformIO in regards to project creation, project file structure and building and uploading PlatformIO projects, through reading the above pages.
|
||||
|
||||
Current state of development
|
||||
----------------------------
|
||||
|
||||
At the time of writing, PlatformIO integration for this core is a work-in-progress and not yet merged into mainline PlatformIO. This is subject to change soon.
|
||||
At the time of writing, PlatformIO integration for this core is a work-in-progress and not yet merged into mainline PlatformIO. This is subject to change once `this pull request <https://github.com/platformio/platform-raspberrypi/pull/36>`_ is merged.
|
||||
|
||||
If you want to use the PlatformIO integration right now, make sure you first create a standard Raspberry Pi Pico + Arduino project within PlatformIO.
|
||||
This will give you a project with the ``platformio.ini``
|
||||
@@ -38,8 +38,7 @@ This will give you a project with the ``platformio.ini``
|
||||
board = pico
|
||||
framework = arduino
|
||||
|
||||
Here, you need to change the `platform` to take advantage of the features described hereunder.
|
||||
You *also* need to inject two PlatformIO packages, one for the compiler toolchain and one for the Arduino core package.
|
||||
Here, you need to change the `platform` to take advantage of the features described hereunder and switch to the new core.
|
||||
|
||||
.. code:: ini
|
||||
|
||||
@@ -47,12 +46,32 @@ You *also* need to inject two PlatformIO packages, one for the compiler toolchai
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
board = pico
|
||||
framework = arduino
|
||||
board_build.core = earlephilhower
|
||||
|
||||
When the support for this core has been merged into mainline PlatformIO, this notice will be removed and a standard `platformio.ini` as shown above will work as a base.
|
||||
|
||||
Deprecation warnings
|
||||
---------------------
|
||||
|
||||
Previous versions of this documentation told users to inject the framework and toolchain package into the project by using
|
||||
|
||||
.. code:: ini
|
||||
|
||||
; note that download link for toolchain is specific for OS. see https://github.com/earlephilhower/pico-quick-toolchain/releases.
|
||||
platform_packages =
|
||||
maxgerhardt/framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
|
||||
maxgerhardt/toolchain-pico@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.arm-none-eabi-7855b0c.210706.zip
|
||||
|
||||
When the support for this core has been merged into mainline PlatformIO, this notice will be removed and a standard `platformio.ini` as shown above will work as a base.
|
||||
|
||||
This is now **deprecated** and should not be done anymore. Users should delete these ``platform_packages`` lines and update the platform integration by issuing the command
|
||||
|
||||
.. code:: bash
|
||||
|
||||
pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
|
||||
in the `PlatformIO CLI <https://docs.platformio.org/en/latest/integration/ide/vscode.html#platformio-core-cli>`_. The same can be achieved by using the VSCode PIO Home -> Platforms -> Updates GUI.
|
||||
|
||||
The toolchain, which was also renamed to ``toolchain-rp2040-earlephilhower`` is downloaded automatically from the registry. The same goes for the ``framework-arduinopico`` toolchain package, which points directly to the Arduino-Pico Github repository.
|
||||
However, users can still select a custom fork or branch of the core if desired so, as detailed in a chapter below.
|
||||
|
||||
Selecting the new core
|
||||
----------------------
|
||||
@@ -61,8 +80,8 @@ Prerequisite for using this core is to tell PlatformIO to switch to it.
|
||||
There will be board definition files where the Earle-Philhower core will
|
||||
be the default since it's a board that only exists in this core (and not
|
||||
the other https://github.com/arduino/ArduinoCore-mbed). To switch boards
|
||||
for which this is not the default core (e.g. the standard
|
||||
``board = pico``), the directive
|
||||
for which this is not the default core (which are only
|
||||
``board = pico`` and ``board = nanorp2040connect``), the directive
|
||||
|
||||
.. code:: ini
|
||||
|
||||
@@ -72,6 +91,8 @@ must be added to the ``platformio.ini``. This controls the `core
|
||||
switching
|
||||
logic <https://github.com/maxgerhardt/platform-raspberrypi/blob/77e0d3a29d1dbf00fd3ec3271104e3bf4820869c/builder/frameworks/arduino/arduino.py#L27-L32>`__.
|
||||
|
||||
When using Arduino-Pico-only boards like ``board = rpipico`` or ``board = adafruit_feather``, this is not needed.
|
||||
|
||||
Flash size
|
||||
----------
|
||||
|
||||
@@ -154,6 +175,37 @@ either a sing line or a newline-separated expression.
|
||||
-DDEBUG_RP2040_CORE
|
||||
-DDEBUG_RP2040_PORT=Serial2
|
||||
|
||||
C++ Exceptions
|
||||
--------------
|
||||
|
||||
Exceptions are disabled by default. To enable them, use
|
||||
|
||||
.. code:: ini
|
||||
|
||||
; Enable Exceptions
|
||||
build_flags = -DPIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS
|
||||
|
||||
Stack Protector
|
||||
---------------
|
||||
|
||||
To enable GCC's stack protection feature, use
|
||||
|
||||
.. code:: ini
|
||||
|
||||
; Enable Stack Protector
|
||||
build_flags = -fstack-protector
|
||||
|
||||
|
||||
RTTI
|
||||
----
|
||||
|
||||
RTTI (run-time type information) is disabled by default. To enable it, use
|
||||
|
||||
.. code:: ini
|
||||
|
||||
; Enable RTTI
|
||||
build_flags = -DPIO_FRAMEWORK_ARDUINO_ENABLE_RTTI
|
||||
|
||||
USB Stack
|
||||
---------
|
||||
|
||||
@@ -188,8 +240,8 @@ directive to do so. Simply specify that the framework package
|
||||
Whereas the ``#master`` can also be replaced by a ``#branchname`` or a
|
||||
``#commithash``. If left out, it will pull the default branch, which is ``master``.
|
||||
|
||||
The ``file://`` pseudo-protocol can also be used instead of ``https://`` to point to a
|
||||
local copy of the core (with e.g. some modifications) on disk.
|
||||
The ``file://`` and ``symlink://`` pseudo-protocols can also be used instead of ``https://`` to point to a
|
||||
local copy of the core (with e.g. some modifications) on disk (`see documentation <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html?#local-folder>`_).
|
||||
|
||||
Note that this can only be done for versions that have the PlatformIO
|
||||
builder script it in, so versions before 1.9.2 are not supported.
|
||||
@@ -206,14 +258,48 @@ and 0.5MByte filesystem.
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
board = pico
|
||||
framework = arduino
|
||||
; board can use both Arduino cores -- we select Arduino-Pico here
|
||||
board_build.core = earlephilhower
|
||||
board_build.filesystem_size = 0.5m
|
||||
; note that download link for toolchain is specific for OS. see https://github.com/earlephilhower/pico-quick-toolchain/releases.
|
||||
platform_packages =
|
||||
maxgerhardt/framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
|
||||
maxgerhardt/toolchain-pico@https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.1-a/x86_64-w64-mingw32.arm-none-eabi-7855b0c.210706.zip
|
||||
|
||||
|
||||
The initial project structure should be generated just creating a new
|
||||
project for the Pico and the Arduino framework, after which the
|
||||
auto-generated ``platformio.ini`` can be adapted per above.
|
||||
|
||||
Debugging
|
||||
---------
|
||||
|
||||
With recent updates to the toolchain and OpenOCD, debugging firmwares is also possible.
|
||||
|
||||
To specify the debugging adapter, use ``debug_tool`` (`documentation <https://docs.platformio.org/en/latest/projectconf/section_env_debug.html#debug-tool>`_). Supported values are:
|
||||
|
||||
* ``picoprobe``
|
||||
* ``cmsis-dap``
|
||||
* ``jlink``
|
||||
* ``raspberrypi-swd``
|
||||
|
||||
These values can also be used in ``upload_protocol`` if you want PlatformIO to upload the regular firmware through this method, which you likely want.
|
||||
|
||||
Especially the PicoProbe method is convenient when you have two Raspberry Pi Pico boards. One of them can be flashed with the PicoProbe firmware (`documentation <https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico>`_) and is then connected to the target Raspberry Pi Pico board (see `documentation <https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf>`_ chapter "Picoprobe Wiring"). Remember that on Windows, you have to use `Zadig <https://zadig.akeo.ie/>`_ to also load "WinUSB" drivers for the "Picoprobe (Interface 2)" device so that OpenOCD can speak to it.
|
||||
|
||||
With that set up, debugging can be started via the left debugging sidebar and works nicely: Setup breakpoints, inspect the value of variables in the code, step through the code line by line. When a breakpoint is hit or execution is halted, you can even see the execution state both Cortex-M0+ cores of the RP2040.
|
||||
|
||||
.. image:: images/pio_debugging.png
|
||||
|
||||
For further information on customizing debug options, like the initial breakpoint or debugging / SWD speed, consult `the documentation <https://docs.platformio.org/en/latest/projectconf/section_env_debug.html>`_.
|
||||
|
||||
Filesystem Uploading
|
||||
--------------------
|
||||
|
||||
For the Arduino IDE, `a plugin <https://github.com/earlephilhower/arduino-pico#uploading-filesystem-images>`_ is available that enables a data folder to be packed as a LittleFS filesystem binary and uploaded to the Pico.
|
||||
|
||||
This functionality is also built-in in the PlatformIO integration. Open the `project tasks <https://docs.platformio.org/en/latest/integration/ide/vscode.html#project-tasks>`_ and expand the "Platform" tasks:
|
||||
|
||||
.. image:: images/pio_fs_upload.png
|
||||
|
||||
The files you want to upload should be placed in a folder called ``data`` inside the project. This can be customized `if needed <https://docs.platformio.org/en/latest/projectconf/section_platformio.html#data-dir>`_.
|
||||
|
||||
The task "Build Filesystem Image" will take all files in the data directory and create a ``littlefs.bin`` file from it using the ``mklittlefs`` tool.
|
||||
|
||||
The task "Upload Filesystem Image" will upload the filesystem image to the Pico via the specified ``upload_protocol``.
|
||||
|
||||
+3
-4
@@ -32,15 +32,14 @@ using the ``setFIFOSize`` call prior to calling ``begin()``
|
||||
Serial1.begin(baud);
|
||||
|
||||
The FIFO is normally handled via an interrupt, which reduced CPU load and
|
||||
makes it less likely to lose characters. However, the FIFO introduces up
|
||||
to 32 bit-times of delay before serial data is available to the application.
|
||||
makes it less likely to lose characters.
|
||||
|
||||
For applications where this is an issue (i.e. very low baud), use
|
||||
For applications where an IRQ driven serial port is not appropriate, use
|
||||
``setPollingMode(true)`` before calling ``begin()``
|
||||
|
||||
.. code:: cpp
|
||||
Serial1.setPollingMode(true);
|
||||
Serial1.begin(110)
|
||||
Serial1.begin(300)
|
||||
|
||||
For detailed information about the Serial ports, see the
|
||||
Arduino `Serial Reference <https://www.arduino.cc/reference/en/language/functions/communication/serial/>`_ .
|
||||
|
||||
Binary file not shown.
@@ -13,7 +13,7 @@
|
||||
|
||||
#define PICO_SDK_VERSION_MAJOR 1
|
||||
#define PICO_SDK_VERSION_MINOR 3
|
||||
#define PICO_SDK_VERSION_REVISION 0
|
||||
#define PICO_SDK_VERSION_STRING "1.3.0"
|
||||
#define PICO_SDK_VERSION_REVISION 2
|
||||
#define PICO_SDK_VERSION_STRING "1.3.2-develop"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
-iwithprefixbefore/cores/rp2040/api/deprecated-avr-comp/
|
||||
-iwithprefixbefore/lib/pico_base/
|
||||
-iwithprefixbefore/pico-extras/src/common/pico_audio/include
|
||||
-iwithprefixbefore/pico-extras/src/common/pico_util_buffer/include
|
||||
-iwithprefixbefore/pico-extras/src/rp2_common/pico_audio_i2s/include
|
||||
-iwithprefixbefore/pico-sdk/lib/tinyusb/src/
|
||||
-iwithprefixbefore/pico-sdk/src/boards/include
|
||||
-iwithprefixbefore/pico-sdk/src/common/pico_base/include
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
-Wl,--wrap=atanf
|
||||
-Wl,--wrap=atanh
|
||||
-Wl,--wrap=atanhf
|
||||
-Wl,--wrap=calloc
|
||||
-Wl,--wrap=cbrt
|
||||
-Wl,--wrap=cbrtf
|
||||
-Wl,--wrap=ceil
|
||||
@@ -105,7 +104,6 @@
|
||||
-Wl,--wrap=fmaf
|
||||
-Wl,--wrap=fmod
|
||||
-Wl,--wrap=fmodf
|
||||
-Wl,--wrap=free
|
||||
-Wl,--wrap=hypot
|
||||
-Wl,--wrap=hypotf
|
||||
-Wl,--wrap=ldexp
|
||||
@@ -118,7 +116,6 @@
|
||||
-Wl,--wrap=log2
|
||||
-Wl,--wrap=log2f
|
||||
-Wl,--wrap=logf
|
||||
-Wl,--wrap=malloc
|
||||
-Wl,--wrap=memcpy
|
||||
-Wl,--wrap=memset
|
||||
-Wl,--wrap=__popcountdi2
|
||||
@@ -147,3 +144,4 @@
|
||||
-Wl,--wrap=tanhf
|
||||
-Wl,--wrap=trunc
|
||||
-Wl,--wrap=truncf
|
||||
-Wl,--wrap=__getreent
|
||||
|
||||
Submodule libraries/Adafruit_TinyUSB_Arduino updated: 4f2c0ab42a...7264c1492a
Submodule libraries/FreeRTOS/lib/FreeRTOS-Kernel updated: f361238875...f5fe79dacd
Executable → Regular
+7
@@ -25,6 +25,13 @@
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1
|
||||
#define configSUPPORT_STATIC_ALLOCATION 0
|
||||
#define configSTACK_DEPTH_TYPE uint32_t
|
||||
|
||||
#define configUSE_NEWLIB_REENTRANT 1
|
||||
#define configNEWLIB_REENTRANT_IS_DYNAMIC 0 /* Note that we have a different config option, portSET_IMPURE_PTR */
|
||||
#include <reent.h>
|
||||
extern void __register_impure_ptr(struct _reent *p);
|
||||
#define portSET_IMPURE_PTR(x) __register_impure_ptr(x)
|
||||
|
||||
/* Run time stats related definitions. */
|
||||
void vMainConfigureTimerForRunTimeStats( void );
|
||||
|
||||
@@ -409,10 +409,16 @@ static void __usb(void *param)
|
||||
}
|
||||
}
|
||||
|
||||
extern void __SetupDescHIDReport();
|
||||
extern void __SetupUSBDescriptor();
|
||||
|
||||
void __USBStart()
|
||||
{
|
||||
mutex_init(&__usb_mutex);
|
||||
|
||||
__SetupDescHIDReport();
|
||||
__SetupUSBDescriptor();
|
||||
|
||||
// Make highest prio and locked to core 0
|
||||
xTaskCreate(__usb, "USB", 256, 0, configMAX_PRIORITIES - 1, &__usbTask);
|
||||
vTaskCoreAffinitySet( __usbTask, 1 << 0 );
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
I2S stereo microphone (input) example
|
||||
Run using the Arduino Serial Plotter to see waveform.
|
||||
Released to the Public Domain by Earle F. Philhower, III
|
||||
|
||||
For the Google AIY Voice Hat Microphone daughterboard, part
|
||||
of the Raspberry Pi AIY cardboard box, the I2S stereo pinout
|
||||
looking at the board top with the RPI logo on the left hand
|
||||
side:
|
||||
+-- ------------------------------------ --+
|
||||
left RPI | (1) GND (2) DIN (3) BCLK (4) LRCLK (5) 3.3V | AIY right
|
||||
logo +---------------------------------------------+ logo
|
||||
*/
|
||||
|
||||
#include <I2S.h>
|
||||
|
||||
I2S i2s(INPUT);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
i2s.setDATA(0);
|
||||
i2s.setBCLK(1); // LRCLK = GP2
|
||||
i2s.setBitsPerSample(16);
|
||||
i2s.setFrequency(22050);
|
||||
i2s.begin();
|
||||
|
||||
while (1) {
|
||||
int16_t l, r;
|
||||
i2s.read16(&l, &r);
|
||||
Serial.printf("%d %d\n", l, r);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
/* Nothing here */
|
||||
}
|
||||
@@ -5,56 +5,50 @@
|
||||
|
||||
created 17 November 2016
|
||||
by Sandeep Mistry
|
||||
modified for ESP8266 by Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
modified for RP2040 by Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
|
||||
|
||||
Only 16 bitsPerSample are allowed by the PIO code. Only write, no read.
|
||||
|
||||
bool setBCLK(pin_size_t pin); // Must be 28 or less. Default is 26
|
||||
// This assigns two adjacent pins - the pin after this one (one greater) is the WS (word select) signal,
|
||||
// which toggles before the sample for each channel is sent
|
||||
|
||||
bool setDOUT(pin_size_t pin); // Must be 29 or less. Default is 28
|
||||
|
||||
bool setBCLK(pin_size_t pin);
|
||||
- This assigns two adjacent pins - the pin after this one (one greater)
|
||||
is the WS (word select) signal, which toggles before the sample for
|
||||
each channel is sent
|
||||
|
||||
bool setDATA(pin_size_t pin);
|
||||
- Sets the DOUT pin, can be any valid GPIO pin
|
||||
*/
|
||||
|
||||
#include <I2S.h>
|
||||
|
||||
// GPIO pin numbers
|
||||
// Create the I2S port using a PIO state machine
|
||||
I2S i2s(OUTPUT);
|
||||
|
||||
//define pBCLK 26
|
||||
// GPIO pin numbers
|
||||
#define pBCLK 20
|
||||
#define pWS (pBCLK+1)
|
||||
//define pDOUT 28
|
||||
#define pDOUT 22
|
||||
|
||||
const int frequency = 440; // frequency of square wave in Hz
|
||||
const int amplitude = 500; // amplitude of square wave
|
||||
//const int sampleRate = 8000; // sample rate in Hz
|
||||
const int sampleRate = 16000; // minimum for UDA1334A
|
||||
|
||||
const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave
|
||||
|
||||
short sample = amplitude; // current sample value
|
||||
int16_t sample = amplitude; // current sample value
|
||||
int count = 0;
|
||||
|
||||
|
||||
void setup() {
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, 1);
|
||||
|
||||
Serial.begin(9600);
|
||||
Serial.begin(115200);
|
||||
Serial.println("I2S simple tone");
|
||||
|
||||
I2S.setBCLK(pBCLK); // Must be 28 or less. Default is 26
|
||||
// This assigns two adjacent pins - the pin after this one (one greater) is the WS (word select) signal,
|
||||
// which toggles before the sample for each channel is sent
|
||||
|
||||
I2S.setDOUT(pDOUT); // Must be 29 or less. Default is 28
|
||||
i2s.setBCLK(pBCLK);
|
||||
i2s.setDATA(pDOUT);
|
||||
i2s.setBitsPerSample(16);
|
||||
|
||||
// start I2S at the sample rate with 16-bits per sample
|
||||
if (!I2S.begin(sampleRate)) {
|
||||
if (!i2s.begin(sampleRate)) {
|
||||
Serial.println("Failed to initialize I2S!");
|
||||
while (1); // do nothing
|
||||
}
|
||||
@@ -68,8 +62,8 @@ void loop() {
|
||||
}
|
||||
|
||||
// write the same sample twice, once for left and once for the right channel
|
||||
I2S.write(sample);
|
||||
I2S.write(sample);
|
||||
i2s.write(sample);
|
||||
i2s.write(sample);
|
||||
|
||||
// increment the counter for the next sample
|
||||
count++;
|
||||
|
||||
@@ -14,10 +14,24 @@ I2S KEYWORD1
|
||||
begin KEYWORD2
|
||||
end KEYWORD2
|
||||
|
||||
setBCLK KEYWORD2
|
||||
setDATA KEYWORD2
|
||||
setBitsPerSample KEYWORD2
|
||||
setFrequency KEYWORD2
|
||||
|
||||
read8 KEYWORD2
|
||||
read16 KEYWORD2
|
||||
read24 KEYWORD2
|
||||
read32 KEYWORD2
|
||||
|
||||
write8 KEYWORD2
|
||||
write16 KEYWORD2
|
||||
write24 KEYWORD2
|
||||
write32 KEYWORD2
|
||||
|
||||
onReceive KEYWORD2
|
||||
onTransmit KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
I2S_PHILIPS_MODE LITERAL1
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
name=I2S
|
||||
version=1.0
|
||||
version=2.0
|
||||
author=Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
maintainer=Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
sentence=Enables the communication with devices that use the Inter-IC Sound (I2S) Bus. Specific implementation for RP2040, based off of pico-extras samples.
|
||||
sentence=Enables the communication with devices that use the Inter-IC Sound (I2S) Bus.
|
||||
paragraph=
|
||||
category=Communication
|
||||
url=http://www.arduino.cc/en/Reference/I2S
|
||||
architectures=rp2040
|
||||
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
AudioRingBuffer for Raspnerry Pi Pico RP2040
|
||||
Implements a ring buffer for PIO DMA for I2S read or write
|
||||
|
||||
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 <Arduino.h>
|
||||
#include <vector>
|
||||
#include "hardware/dma.h"
|
||||
#include "hardware/irq.h"
|
||||
#include "hardware/pio.h"
|
||||
#include "pio_i2s.pio.h"
|
||||
#include "AudioRingBuffer.h"
|
||||
|
||||
static int __channelCount = 0; // # of channels left. When we hit 0, then remove our handler
|
||||
static AudioRingBuffer* __channelMap[12]; // Lets the IRQ handler figure out where to dispatch to
|
||||
|
||||
AudioRingBuffer::AudioRingBuffer(size_t bufferCount, size_t bufferWords, int32_t silenceSample, PinMode direction) {
|
||||
_running = false;
|
||||
_silenceSample = silenceSample;
|
||||
_bufferCount = bufferCount;
|
||||
_wordsPerBuffer = bufferWords;
|
||||
_isOutput = direction == OUTPUT;
|
||||
_overunderflow = false;
|
||||
_callback = nullptr;
|
||||
_userBuffer = -1;
|
||||
_userOff = 0;
|
||||
for (size_t i = 0; i < bufferCount; i++) {
|
||||
auto ab = new AudioBuffer;
|
||||
ab->buff = new uint32_t[_wordsPerBuffer];
|
||||
ab->empty = true;
|
||||
_buffers.push_back(ab);
|
||||
}
|
||||
}
|
||||
|
||||
AudioRingBuffer::~AudioRingBuffer() {
|
||||
if (_running) {
|
||||
for (auto i = 0; i < 2; i++) {
|
||||
dma_channel_set_irq0_enabled(_channelDMA[i], false);
|
||||
dma_channel_unclaim(_channelDMA[i]);
|
||||
__channelMap[_channelDMA[i]] = nullptr;
|
||||
}
|
||||
while (_buffers.size()) {
|
||||
auto ab = _buffers.back();
|
||||
_buffers.pop_back();
|
||||
delete[] ab->buff;
|
||||
delete ab;
|
||||
}
|
||||
__channelCount--;
|
||||
if (!__channelCount) {
|
||||
irq_set_enabled(DMA_IRQ_0, false);
|
||||
// TODO - how can we know if there are no other parts of the core using DMA0 IRQ??
|
||||
irq_remove_handler(DMA_IRQ_0, _irq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AudioRingBuffer::setCallback(void (*fn)()) {
|
||||
_callback = fn;
|
||||
}
|
||||
|
||||
bool AudioRingBuffer::begin(int dreq, volatile void *pioFIFOAddr) {
|
||||
_running = true;
|
||||
// Set all buffers to silence, empty
|
||||
for (auto buff : _buffers) {
|
||||
buff->empty = true;
|
||||
if (_isOutput) {
|
||||
for (uint32_t x = 0; x < _wordsPerBuffer; x++) {
|
||||
buff->buff[x] = _silenceSample;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Get ping and pong DMA channels
|
||||
for (auto i = 0; i < 2; i++) {
|
||||
_channelDMA[i] = dma_claim_unused_channel(true);
|
||||
if (_channelDMA[i] == -1) {
|
||||
if (i == 1) {
|
||||
dma_channel_unclaim(_channelDMA[0]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool needSetIRQ = __channelCount == 0;
|
||||
// Need to know both channels to set up ping-pong, so do in 2 stages
|
||||
for (auto i = 0; i < 2; i++) {
|
||||
dma_channel_config c = dma_channel_get_default_config(_channelDMA[i]);
|
||||
channel_config_set_transfer_data_size(&c, DMA_SIZE_32); // 32b transfers into PIO FIFO
|
||||
if (_isOutput) {
|
||||
channel_config_set_read_increment(&c, true); // Reading incrementing addresses
|
||||
channel_config_set_write_increment(&c, false); // Writing to the same FIFO address
|
||||
} else {
|
||||
channel_config_set_read_increment(&c, false); // Reading same FIFO address
|
||||
channel_config_set_write_increment(&c, true); // Writing to incrememting buffers
|
||||
}
|
||||
channel_config_set_dreq(&c, dreq); // Wait for the PIO TX FIFO specified
|
||||
channel_config_set_chain_to(&c, _channelDMA[i ^ 1]); // Start other channel when done
|
||||
channel_config_set_irq_quiet(&c, false); // Need IRQs
|
||||
|
||||
if (_isOutput) {
|
||||
dma_channel_configure(_channelDMA[i], &c, pioFIFOAddr, _buffers[i]->buff, _wordsPerBuffer, false);
|
||||
} else {
|
||||
dma_channel_configure(_channelDMA[i], &c, _buffers[i]->buff, pioFIFOAddr, _wordsPerBuffer, false);
|
||||
}
|
||||
dma_channel_set_irq0_enabled(_channelDMA[i], true);
|
||||
__channelMap[_channelDMA[i]] = this;
|
||||
__channelCount++;
|
||||
}
|
||||
if (needSetIRQ) {
|
||||
irq_add_shared_handler(DMA_IRQ_0, _irq, PICO_SHARED_IRQ_HANDLER_DEFAULT_ORDER_PRIORITY);
|
||||
irq_set_enabled(DMA_IRQ_0, true);
|
||||
}
|
||||
_curBuffer = 0;
|
||||
_nextBuffer = 2 % _bufferCount;
|
||||
dma_channel_start(_channelDMA[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioRingBuffer::write(uint32_t v, bool sync) {
|
||||
if (!_running || !_isOutput) {
|
||||
return false;
|
||||
}
|
||||
if (_userBuffer == -1) {
|
||||
// First write or overflow, pick spot 2 buffers out
|
||||
_userBuffer = (_nextBuffer + 2) % _bufferCount;
|
||||
_userOff = 0;
|
||||
}
|
||||
if (!_buffers[_userBuffer]->empty) {
|
||||
if (!sync) {
|
||||
return false;
|
||||
} else {
|
||||
while (!_buffers[_userBuffer]->empty) {
|
||||
/* noop busy wait */
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_userBuffer == _curBuffer) {
|
||||
if (!sync) {
|
||||
return false;
|
||||
} else {
|
||||
while (_userBuffer == _curBuffer) {
|
||||
/* noop busy wait */
|
||||
}
|
||||
}
|
||||
}
|
||||
_buffers[_userBuffer]->buff[_userOff++] = v;
|
||||
if (_userOff == _wordsPerBuffer) {
|
||||
_buffers[_userBuffer]->empty = false;
|
||||
_userBuffer = (_userBuffer + 1) % _bufferCount;
|
||||
_userOff = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioRingBuffer::read(uint32_t *v, bool sync) {
|
||||
if (!_running || _isOutput) {
|
||||
return false;
|
||||
}
|
||||
if (_userBuffer == -1) {
|
||||
// First write or overflow, pick last filled buffer
|
||||
_userBuffer = (_curBuffer - 1 + _bufferCount) % _bufferCount;
|
||||
_userOff = 0;
|
||||
}
|
||||
if (_buffers[_userBuffer]->empty) {
|
||||
if (!sync) {
|
||||
return false;
|
||||
} else {
|
||||
while (_buffers[_userBuffer]->empty) {
|
||||
/* noop busy wait */
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_userBuffer == _curBuffer) {
|
||||
if (!sync) {
|
||||
return false;
|
||||
} else {
|
||||
while (_userBuffer == _curBuffer) {
|
||||
/* noop busy wait */
|
||||
}
|
||||
}
|
||||
}
|
||||
auto ret = _buffers[_userBuffer]->buff[_userOff++];
|
||||
if (_userOff == _wordsPerBuffer) {
|
||||
_buffers[_userBuffer]->empty = true;
|
||||
_userBuffer = (_userBuffer + 1) % _bufferCount;
|
||||
_userOff = 0;
|
||||
}
|
||||
*v = ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioRingBuffer::getOverUnderflow() {
|
||||
bool hold = _overunderflow;
|
||||
_overunderflow = false;
|
||||
return hold;
|
||||
}
|
||||
|
||||
int AudioRingBuffer::available() {
|
||||
if (!_running) {
|
||||
return 0;
|
||||
}
|
||||
int avail;
|
||||
avail = _wordsPerBuffer - _userOff;
|
||||
avail += ((_bufferCount + _curBuffer - _userBuffer) % _bufferCount) * _wordsPerBuffer;
|
||||
return avail;
|
||||
}
|
||||
|
||||
void AudioRingBuffer::flush() {
|
||||
while (_curBuffer != _userBuffer) {
|
||||
// busy wait
|
||||
}
|
||||
}
|
||||
|
||||
void __not_in_flash_func(AudioRingBuffer::_dmaIRQ)(int channel) {
|
||||
if (_isOutput) {
|
||||
for (uint32_t x = 0; x < _wordsPerBuffer; x++) {
|
||||
_buffers[_curBuffer]->buff[x] = _silenceSample;
|
||||
}
|
||||
_buffers[_curBuffer]-> empty = true;
|
||||
_overunderflow = _overunderflow | _buffers[_nextBuffer]->empty;
|
||||
dma_channel_set_read_addr(channel, _buffers[_nextBuffer]->buff, false);
|
||||
} else {
|
||||
_buffers[_curBuffer]-> empty = false;
|
||||
_overunderflow = _overunderflow | !_buffers[_nextBuffer]->empty;
|
||||
dma_channel_set_write_addr(channel, _buffers[_nextBuffer]->buff, false);
|
||||
}
|
||||
dma_channel_set_trans_count(channel, _wordsPerBuffer, false);
|
||||
_curBuffer = (_curBuffer + 1) % _bufferCount;
|
||||
_nextBuffer = (_nextBuffer + 1) % _bufferCount;
|
||||
dma_channel_acknowledge_irq0(channel);
|
||||
if (_callback) {
|
||||
_callback();
|
||||
}
|
||||
}
|
||||
|
||||
void __not_in_flash_func(AudioRingBuffer::_irq)() {
|
||||
for (size_t i = 0; i < sizeof(__channelMap); i++) {
|
||||
if (dma_channel_get_irq0_status(i) && __channelMap[i]) {
|
||||
__channelMap[i]->_dmaIRQ(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
AudioRingBuffer for Rasperry Pi Pico
|
||||
Implements a ring buffer for PIO DMA for I2S read or write
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include <vector>
|
||||
|
||||
class AudioRingBuffer {
|
||||
public:
|
||||
AudioRingBuffer(size_t bufferCount, size_t bufferWords, int32_t silenceSample, PinMode direction = OUTPUT);
|
||||
~AudioRingBuffer();
|
||||
|
||||
void setCallback(void (*fn)());
|
||||
|
||||
bool begin(int dreq, volatile void *pioFIFOAddr);
|
||||
|
||||
bool write(uint32_t v, bool sync = true);
|
||||
bool read(uint32_t *v, bool sync = true);
|
||||
void flush();
|
||||
|
||||
bool getOverUnderflow();
|
||||
int available();
|
||||
|
||||
private:
|
||||
void _dmaIRQ(int channel);
|
||||
static void _irq();
|
||||
|
||||
typedef struct {
|
||||
uint32_t *buff;
|
||||
volatile bool empty;
|
||||
} AudioBuffer;
|
||||
|
||||
bool _running = false;
|
||||
std::vector<AudioBuffer*> _buffers;
|
||||
volatile int _curBuffer;
|
||||
volatile int _nextBuffer;
|
||||
size_t _chunkSampleCount;
|
||||
int _bitsPerSample;
|
||||
size_t _wordsPerBuffer;
|
||||
size_t _bufferCount;
|
||||
bool _isOutput;
|
||||
int32_t _silenceSample;
|
||||
int _channelDMA[2];
|
||||
void (*_callback)();
|
||||
|
||||
bool _overunderflow;
|
||||
|
||||
// User buffer pointer
|
||||
int _userBuffer = -1;
|
||||
size_t _userOff = 0;
|
||||
};
|
||||
+280
-156
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
I2S Master library for the Raspberry Pi Pico RP2040
|
||||
I2SIn and I2SOut for Raspberry Pi Pico
|
||||
Implements one or more I2S interfaces using DMA
|
||||
|
||||
Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
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
|
||||
@@ -17,30 +18,30 @@
|
||||
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 "I2S.h"
|
||||
#include "pio_i2s.pio.h"
|
||||
|
||||
#ifdef USE_TINYUSB
|
||||
// For Serial when selecting TinyUSB. Can't include in the core because Arduino IDE
|
||||
// will not link in libraries called from the core. Instead, add the header to all
|
||||
// the standard libraries in the hope it will still catch some user cases where they
|
||||
// use these libraries.
|
||||
// See https://github.com/earlephilhower/arduino-pico/issues/167#issuecomment-848622174
|
||||
#include <Adafruit_TinyUSB.h>
|
||||
#endif
|
||||
|
||||
I2SClass::I2SClass() {
|
||||
I2S::I2S(PinMode direction) {
|
||||
_running = false;
|
||||
_pool = nullptr;
|
||||
_curBuff = nullptr;
|
||||
_bps = 0;
|
||||
_bps = 16;
|
||||
_writtenHalf = false;
|
||||
_pinBCLK = 26;
|
||||
_pinDOUT = 28;
|
||||
_freq = 48000;
|
||||
_arb = nullptr;
|
||||
_isOutput = direction == OUTPUT;
|
||||
_cb = nullptr;
|
||||
_buffers = 8;
|
||||
_bufferWords = 16;
|
||||
_silenceSample = 0;
|
||||
}
|
||||
|
||||
bool I2SClass::setBCLK(pin_size_t pin) {
|
||||
I2S::~I2S() {
|
||||
}
|
||||
|
||||
bool I2S::setBCLK(pin_size_t pin) {
|
||||
if (_running || (pin > 28)) {
|
||||
return false;
|
||||
}
|
||||
@@ -48,7 +49,7 @@ bool I2SClass::setBCLK(pin_size_t pin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2SClass::setDOUT(pin_size_t pin) {
|
||||
bool I2S::setDATA(pin_size_t pin) {
|
||||
if (_running || (pin > 29)) {
|
||||
return false;
|
||||
}
|
||||
@@ -56,173 +57,296 @@ bool I2SClass::setDOUT(pin_size_t pin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2SClass::begin(long sampleRate) {
|
||||
bool I2S::setBitsPerSample(int bps) {
|
||||
if (_running || ((bps != 8) && (bps != 16) && (bps != 24) && (bps != 32))) {
|
||||
return false;
|
||||
}
|
||||
_bps = bps;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2S::setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample) {
|
||||
if (_running || (buffers < 3) || (bufferWords < 8)) {
|
||||
return false;
|
||||
}
|
||||
_buffers = buffers;
|
||||
_bufferWords = bufferWords;
|
||||
_silenceSample = silenceSample;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2S::setFrequency(int newFreq) {
|
||||
_freq = newFreq;
|
||||
if (_running) {
|
||||
return false;
|
||||
float bitClk = _freq * _bps * 2.0;
|
||||
pio_sm_set_clkdiv(_pio, _sm, (float)clock_get_hz(clk_sys) / bitClk);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bzero(&_audio_format, sizeof(_audio_format));
|
||||
_audio_format.sample_freq = (uint32_t)sampleRate;
|
||||
_audio_format.format = AUDIO_BUFFER_FORMAT_PCM_S16;
|
||||
_audio_format.channel_count = 2;
|
||||
|
||||
bzero(&_producer_format, sizeof(_producer_format));
|
||||
_producer_format.format = &_audio_format;
|
||||
_producer_format.sample_stride = 4;
|
||||
|
||||
if (!_pool) {
|
||||
_pool = audio_new_producer_pool(&_producer_format, 3, 256);
|
||||
void I2S::onTransmit(void(*fn)(void)) {
|
||||
if (_isOutput) {
|
||||
_cb = fn;
|
||||
if (_running) {
|
||||
_arb->setCallback(_cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bzero(&_config, sizeof(_config));
|
||||
_config.data_pin = _pinDOUT;
|
||||
_config.clock_pin_base = _pinBCLK;
|
||||
_config.dma_channel = 0;
|
||||
_config.pio_sm = 1;
|
||||
|
||||
if (!audio_i2s_setup(&_audio_format, &_config)) {
|
||||
return false;
|
||||
void I2S::onReceive(void(*fn)(void)) {
|
||||
if (!_isOutput) {
|
||||
_cb = fn;
|
||||
if (_running) {
|
||||
_arb->setCallback(_cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!audio_i2s_connect(_pool)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
audio_i2s_set_enabled(true);
|
||||
|
||||
_curBuff = take_audio_buffer(_pool, true);
|
||||
_curBuff->sample_count = 0;
|
||||
|
||||
_bps = 16;
|
||||
_freq = sampleRate;
|
||||
bool I2S::begin() {
|
||||
_running = true;
|
||||
_hasPeeked = false;
|
||||
int off = 0;
|
||||
_i2s = new PIOProgram(_isOutput ? &pio_i2s_out_program : &pio_i2s_in_program);
|
||||
_i2s->prepare(&_pio, &_sm, &off);
|
||||
if (_isOutput) {
|
||||
pio_i2s_out_program_init(_pio, _sm, off, _pinDOUT, _pinBCLK, _bps);
|
||||
} else {
|
||||
pio_i2s_in_program_init(_pio, _sm, off, _pinDOUT, _pinBCLK, _bps);
|
||||
}
|
||||
setFrequency(_freq);
|
||||
if (_bps == 8) {
|
||||
uint8_t a = _silenceSample & 0xff;
|
||||
_silenceSample = (a << 24) | (a << 16) | (a << 8) | a;
|
||||
} else if (_bps == 16) {
|
||||
uint16_t a = _silenceSample & 0xffff;
|
||||
_silenceSample = (a << 16) | a;
|
||||
}
|
||||
_arb = new AudioRingBuffer(_buffers, _bufferWords, _silenceSample, _isOutput ? OUTPUT : INPUT);
|
||||
_arb->begin(pio_get_dreq(_pio, _sm, _isOutput), _isOutput ? &_pio->txf[_sm] : (volatile void*)&_pio->rxf[_sm]);
|
||||
_arb->setCallback(_cb);
|
||||
pio_sm_set_enabled(_pio, _sm, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void I2SClass::end() {
|
||||
if (_running) {
|
||||
audio_i2s_set_enabled(false);
|
||||
if (_curBuff) {
|
||||
release_audio_buffer(_pool, _curBuff);
|
||||
_curBuff = nullptr;
|
||||
}
|
||||
}
|
||||
void I2S::end() {
|
||||
_running = false;
|
||||
_bps = 0;
|
||||
_freq = 0;
|
||||
_writtenHalf = false;
|
||||
delete _arb;
|
||||
_arb = nullptr;
|
||||
delete _i2s;
|
||||
_i2s = nullptr;
|
||||
}
|
||||
|
||||
int I2SClass::availableForWrite() {
|
||||
if (!_running) {
|
||||
int I2S::available() {
|
||||
if (!_running || _isOutput) {
|
||||
return 0;
|
||||
}
|
||||
// Can we get a whole new buffer to work with?
|
||||
if (!_curBuff) {
|
||||
_curBuff = take_audio_buffer(_pool, false);
|
||||
_curBuff->sample_count = 0;
|
||||
}
|
||||
if (!_curBuff) {
|
||||
return false;
|
||||
}
|
||||
return _curBuff->max_sample_count - _curBuff->sample_count;
|
||||
return _arb->available();
|
||||
}
|
||||
|
||||
void I2SClass::flush() {
|
||||
if (!_curBuff || !_curBuff->sample_count) {
|
||||
return;
|
||||
}
|
||||
_audio_format.sample_freq = _freq;
|
||||
give_audio_buffer(_pool, _curBuff);
|
||||
_curBuff = nullptr;
|
||||
}
|
||||
|
||||
bool I2SClass::setFrequency(int newFreq) {
|
||||
if (newFreq != _freq) {
|
||||
flush();
|
||||
_freq = newFreq;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t I2SClass::write(uint8_t s) {
|
||||
return write((int16_t)s);
|
||||
}
|
||||
|
||||
size_t I2SClass::write(const uint8_t *buffer, size_t size) {
|
||||
return write((const void *)buffer, size);
|
||||
}
|
||||
|
||||
size_t I2SClass::write(int16_t s) {
|
||||
if (!_running) {
|
||||
int I2S::read() {
|
||||
if (!_running || _isOutput) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Because our HW really wants 32b writes, store any 16b writes until another
|
||||
// 16b write comes in and then send the combined write down.
|
||||
if (_bps == 16) {
|
||||
if (_writtenHalf) {
|
||||
_writtenData <<= 16;
|
||||
_writtenData |= 0xffff & s;
|
||||
_writtenHalf = false;
|
||||
if (!_curBuff) {
|
||||
_curBuff = take_audio_buffer(_pool, true);
|
||||
_curBuff->sample_count = 0;
|
||||
}
|
||||
int32_t *samples = (int32_t *)_curBuff->buffer->bytes;
|
||||
samples[_curBuff->sample_count++] = _writtenData;
|
||||
if (_curBuff->sample_count == _curBuff->max_sample_count) {
|
||||
_audio_format.sample_freq = _freq;
|
||||
give_audio_buffer(_pool, _curBuff);
|
||||
_curBuff = nullptr;
|
||||
}
|
||||
if (_hasPeeked) {
|
||||
_hasPeeked = false;
|
||||
return _peekSaved;
|
||||
}
|
||||
|
||||
if (_wasHolding <= 0) {
|
||||
read(&_holdWord, true);
|
||||
_wasHolding = 32;
|
||||
}
|
||||
|
||||
int ret;
|
||||
switch (_bps) {
|
||||
case 8:
|
||||
ret = _holdWord >> 24;
|
||||
_holdWord <<= 8;
|
||||
_wasHolding -= 8;
|
||||
return ret;
|
||||
case 16:
|
||||
ret = _holdWord >> 16;
|
||||
_holdWord <<= 16;
|
||||
_wasHolding -= 32;
|
||||
return ret;
|
||||
case 24:
|
||||
case 32:
|
||||
default:
|
||||
ret = _holdWord;
|
||||
_wasHolding = 0;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
int I2S::peek() {
|
||||
if (!_running || _isOutput) {
|
||||
return 0;
|
||||
}
|
||||
if (!_hasPeeked) {
|
||||
_peekSaved = read();
|
||||
_hasPeeked = true;
|
||||
}
|
||||
return _peekSaved;
|
||||
}
|
||||
|
||||
void I2S::flush() {
|
||||
if (_running) {
|
||||
_arb->flush();
|
||||
}
|
||||
}
|
||||
|
||||
size_t I2S::_writeNatural(int32_t s) {
|
||||
if (!_running || !_isOutput) {
|
||||
return 0;
|
||||
}
|
||||
switch (_bps) {
|
||||
case 8:
|
||||
_holdWord |= s & 0xff;
|
||||
if (_wasHolding >= 24) {
|
||||
auto ret = write(_holdWord, true);
|
||||
_holdWord = 0;
|
||||
_wasHolding = 0;
|
||||
return ret;
|
||||
} else {
|
||||
_writtenHalf = true;
|
||||
_writtenData = s & 0xffff;
|
||||
_holdWord <<= 8;
|
||||
_wasHolding += 8;
|
||||
return 1;
|
||||
}
|
||||
case 16:
|
||||
_holdWord |= s & 0xffff;
|
||||
if (_wasHolding) {
|
||||
auto ret = write(_holdWord, true);
|
||||
_holdWord = 0;
|
||||
_wasHolding = 0;
|
||||
return ret;
|
||||
} else {
|
||||
_holdWord <<= 16;
|
||||
_wasHolding = 16;
|
||||
return 1;
|
||||
}
|
||||
case 24:
|
||||
case 32:
|
||||
default:
|
||||
return write(s, true);
|
||||
}
|
||||
}
|
||||
|
||||
size_t I2S::write(int32_t val, bool sync) {
|
||||
if (!_running || !_isOutput) {
|
||||
return 0;
|
||||
}
|
||||
return _arb->write(val, sync);
|
||||
}
|
||||
|
||||
size_t I2S::write8(int8_t l, int8_t r) {
|
||||
if (!_running || !_isOutput) {
|
||||
return 0;
|
||||
}
|
||||
int16_t o = (l << 8) | (r & 0xff);
|
||||
return write((int16_t) o);
|
||||
}
|
||||
|
||||
size_t I2S::write16(int16_t l, int16_t r) {
|
||||
if (!_running || !_isOutput) {
|
||||
return 0;
|
||||
}
|
||||
int32_t o = (l << 16) | (r & 0xffff);
|
||||
return write((int32_t)o, true);
|
||||
}
|
||||
|
||||
size_t I2S::write24(int32_t l, int32_t r) {
|
||||
return write32(l, r);
|
||||
}
|
||||
|
||||
size_t I2S::write32(int32_t l, int32_t r) {
|
||||
if (!_running || !_isOutput) {
|
||||
return 0;
|
||||
}
|
||||
write((int32_t)l);
|
||||
write((int32_t)r);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Mostly non-blocking
|
||||
size_t I2SClass::write(const void *buffer, size_t size) {
|
||||
if (!_running) {
|
||||
size_t I2S::read(int32_t *val, bool sync) {
|
||||
if (!_running || _isOutput) {
|
||||
return 0;
|
||||
}
|
||||
// We have no choice here because we need to write at least 1 byte...
|
||||
if (!_curBuff) {
|
||||
_curBuff = take_audio_buffer(_pool, true);
|
||||
_curBuff->sample_count = 0;
|
||||
}
|
||||
|
||||
int32_t *inSamples = (int32_t *)buffer;
|
||||
int written = 0;
|
||||
int wantToWrite = size / 4;
|
||||
while (wantToWrite) {
|
||||
if (!_curBuff) {
|
||||
_curBuff = take_audio_buffer(_pool, false);
|
||||
if (_curBuff) {
|
||||
_curBuff->sample_count = 0;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int avail = _curBuff->max_sample_count - _curBuff->sample_count;
|
||||
int writeSize = (avail > wantToWrite) ? wantToWrite : avail;
|
||||
int32_t *samples = (int32_t *)_curBuff->buffer->bytes;
|
||||
memcpy(samples + _curBuff->sample_count, inSamples, writeSize * 4);
|
||||
_curBuff->sample_count += writeSize;
|
||||
inSamples += writeSize;
|
||||
written += writeSize;
|
||||
wantToWrite -= writeSize;
|
||||
if (_curBuff->sample_count == _curBuff->max_sample_count) {
|
||||
_audio_format.sample_freq = _freq;
|
||||
give_audio_buffer(_pool, _curBuff);
|
||||
_curBuff = nullptr;
|
||||
}
|
||||
}
|
||||
return written;
|
||||
return _arb->read((uint32_t *)val, sync);
|
||||
}
|
||||
|
||||
I2SClass I2S;
|
||||
bool I2S::read8(int8_t *l, int8_t *r) {
|
||||
if (!_running || _isOutput) {
|
||||
return false;
|
||||
}
|
||||
if (_wasHolding) {
|
||||
*l = (_holdWord >> 8) & 0xff;
|
||||
*r = (_holdWord >> 0) & 0xff;
|
||||
_wasHolding = 0;
|
||||
} else {
|
||||
read(&_holdWord, true);
|
||||
_wasHolding = 16;
|
||||
*l = (_holdWord >> 24) & 0xff;
|
||||
*r = (_holdWord >> 16) & 0xff;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2S::read16(int16_t *l, int16_t *r) {
|
||||
if (!_running || _isOutput) {
|
||||
return false;
|
||||
}
|
||||
int32_t o;
|
||||
read(&o, true);
|
||||
*l = (o >> 16) & 0xffff;
|
||||
*r = (o >> 0) & 0xffff;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2S::read24(int32_t *l, int32_t *r) {
|
||||
if (!_running || _isOutput) {
|
||||
return false;
|
||||
}
|
||||
read32(l, r);
|
||||
// 24-bit samples are read right-aligned, so left-align them to keep the binary point between 33.32
|
||||
*l <<= 8;
|
||||
*r <<= 8;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool I2S::read32(int32_t *l, int32_t *r) {
|
||||
if (!_running || _isOutput) {
|
||||
return false;
|
||||
}
|
||||
read(l, true);
|
||||
read(r, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t I2S::write(const uint8_t *buffer, size_t size) {
|
||||
// We can only write 32-bit chunks here
|
||||
if (size & 0x3) {
|
||||
return 0;
|
||||
}
|
||||
size_t writtenSize = 0;
|
||||
int32_t *p = (int32_t *)buffer;
|
||||
while (size) {
|
||||
if (!write((int32_t)*p)) {
|
||||
// Blocked, stop write here
|
||||
return writtenSize;
|
||||
} else {
|
||||
p++;
|
||||
size -= 4;
|
||||
writtenSize += 4;
|
||||
}
|
||||
}
|
||||
return writtenSize;
|
||||
}
|
||||
|
||||
int I2S::availableForWrite() {
|
||||
if (!_running || !_isOutput) {
|
||||
return 0;
|
||||
}
|
||||
return _arb->available();
|
||||
}
|
||||
|
||||
+80
-42
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
I2S Master library for the Raspberry Pi Pico RP2040
|
||||
I2SIn and I2SOut for Raspberry Pi Pico
|
||||
Implements one or more I2S interfaces using DMA
|
||||
|
||||
Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
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
|
||||
@@ -19,72 +20,109 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "pico/audio_i2s.h"
|
||||
#include <vector>
|
||||
#include "AudioRingBuffer.h"
|
||||
|
||||
class I2SClass : public Stream {
|
||||
class I2S : public Stream {
|
||||
public:
|
||||
I2SClass();
|
||||
I2S(PinMode direction = OUTPUT);
|
||||
virtual ~I2S();
|
||||
|
||||
// Only 16 bitsPerSample are allowed by the PIO code. Only write, no read.
|
||||
bool setBCLK(pin_size_t pin);
|
||||
bool setDOUT(pin_size_t pin);
|
||||
bool begin(long sampleRate);
|
||||
bool setDATA(pin_size_t pin);
|
||||
bool setBitsPerSample(int bps);
|
||||
bool setBuffers(size_t buffers, size_t bufferWords, int32_t silenceSample = 0);
|
||||
bool setFrequency(int newFreq);
|
||||
|
||||
bool begin(long sampleRate) {
|
||||
setFrequency(sampleRate);
|
||||
return begin();
|
||||
}
|
||||
|
||||
bool begin();
|
||||
void end();
|
||||
|
||||
// from Stream
|
||||
virtual int available() override {
|
||||
return -1;
|
||||
}
|
||||
virtual int read() override {
|
||||
return -1;
|
||||
}
|
||||
virtual int peek() override {
|
||||
return -1;
|
||||
}
|
||||
virtual int available() override;
|
||||
virtual int read() override;
|
||||
virtual int peek() override;
|
||||
virtual void flush() override;
|
||||
|
||||
// from Print (see notes on write() methods below)
|
||||
virtual size_t write(uint8_t) override;
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) override;
|
||||
virtual int availableForWrite() override;
|
||||
|
||||
bool setFrequency(int newFreq);
|
||||
// Try and make I2S::write() do what makes sense, namely write
|
||||
// one sample (L or R) at the I2S configured bit width
|
||||
virtual size_t write(uint8_t s) override {
|
||||
return _writeNatural(s & 0xff);
|
||||
}
|
||||
size_t write(int8_t s) {
|
||||
return write((uint8_t)s);
|
||||
}
|
||||
size_t write(uint16_t s) {
|
||||
return _writeNatural(s & 0xffff);
|
||||
}
|
||||
size_t write(int16_t s) {
|
||||
return write((uint16_t)s);
|
||||
}
|
||||
size_t write(uint32_t s) {
|
||||
return _writeNatural(s);
|
||||
}
|
||||
size_t write(int32_t s) {
|
||||
return write((uint32_t)s);
|
||||
}
|
||||
|
||||
// Write a single L:R sample to the I2S device. Blocking until write succeeds
|
||||
size_t write(int16_t);
|
||||
// Write up to size samples to the I2S device. Non-blocking, will write
|
||||
// from 0...size samples and return that count. Be sure your app handles
|
||||
// partial writes (i.e. by yield()ing and then retrying to write the
|
||||
// remaining data.
|
||||
size_t write(const void *buffer, size_t lrsamples);
|
||||
// Write 32 bit value to port, user responsbile for packing/alignment, etc.
|
||||
size_t write(int32_t val, bool sync);
|
||||
|
||||
// Write sample to I2S port, will block until completed
|
||||
size_t write8(int8_t l, int8_t r);
|
||||
size_t write16(int16_t l, int16_t r);
|
||||
size_t write24(int32_t l, int32_t r); // Note that 24b must have values left-aligned (i.e. 0xABCDEF00)
|
||||
size_t write32(int32_t l, int32_t r);
|
||||
|
||||
// Read 32 bit value to port, user responsbile for packing/alignment, etc.
|
||||
size_t read(int32_t *val, bool sync);
|
||||
|
||||
// Read samples from I2S port, will block until data available
|
||||
bool read8(int8_t *l, int8_t *r);
|
||||
bool read16(int16_t *l, int16_t *r);
|
||||
bool read24(int32_t *l, int32_t *r); // Note that 24b reads will be left-aligned (see above)
|
||||
bool read32(int32_t *l, int32_t *r);
|
||||
|
||||
// Note that these callback are called from **INTERRUPT CONTEXT** and hence
|
||||
// must be both stored in IRAM and not perform anything that's not legal in
|
||||
// an interrupt
|
||||
//void onTransmit(void(*)(void)); -- Not yet implemented, need to edit pico-extra to get callback
|
||||
//void onReceive(void(*)(void)); -- no I2S input yet
|
||||
// should be in RAM, not FLASH, and should be quick to execute.
|
||||
void onTransmit(void(*)(void));
|
||||
void onReceive(void(*)(void));
|
||||
|
||||
private:
|
||||
pin_size_t _pinBCLK;
|
||||
pin_size_t _pinDOUT;
|
||||
int _bps;
|
||||
int _freq;
|
||||
size_t _buffers;
|
||||
size_t _bufferWords;
|
||||
int32_t _silenceSample;
|
||||
bool _isOutput;
|
||||
|
||||
bool _running;
|
||||
|
||||
// Audio format/pool config
|
||||
audio_format_t _audio_format;
|
||||
audio_buffer_format_t _producer_format;
|
||||
audio_i2s_config_t _config;
|
||||
bool _hasPeeked;
|
||||
int32_t _peekSaved;
|
||||
|
||||
// We manage our own buffer pool here...
|
||||
audio_buffer_pool_t *_pool;
|
||||
audio_buffer_t *_curBuff;
|
||||
|
||||
// Support for ::write(x) on 16b quantities
|
||||
size_t _writeNatural(int32_t s);
|
||||
uint32_t _writtenData;
|
||||
bool _writtenHalf;
|
||||
};
|
||||
|
||||
extern I2SClass I2S;
|
||||
int32_t _holdWord = 0;
|
||||
int _wasHolding = 0;
|
||||
|
||||
void (*_cb)();
|
||||
|
||||
AudioRingBuffer *_arb;
|
||||
PIOProgram *_i2s;
|
||||
PIO _pio;
|
||||
int _sm;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
; pio_i2s for the Raspberry Pi Pico RP2040
|
||||
;
|
||||
; Based loosely off of the MicroPython I2S code in
|
||||
; https://github.com/micropython/micropython/blob/master/ports/rp2/machine_i2s.c
|
||||
;
|
||||
; 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
|
||||
|
||||
|
||||
.program pio_i2s_out
|
||||
.side_set 2 ; 0 = bclk, 1=wclk
|
||||
|
||||
; The C code should place (number of bits/sample - 2) in Y and
|
||||
; also update the SHIFTCTRL to be 24 or 32 as appropriate
|
||||
|
||||
; +----- WCLK
|
||||
; |+---- BCLK
|
||||
mov x, y side 0b01
|
||||
left:
|
||||
out pins, 1 side 0b00
|
||||
jmp x--, left side 0b01
|
||||
out pins, 1 side 0b10 ; Last bit of left has WCLK change per I2S spec
|
||||
|
||||
mov x, y side 0b11
|
||||
right:
|
||||
out pins, 1 side 0b10
|
||||
jmp x--, right side 0b11
|
||||
out pins, 1 side 0b00 ; Last bit of right also has WCLK change
|
||||
; Loop back to beginning...
|
||||
|
||||
|
||||
.program pio_i2s_in ; Note this is the same as _out, just "in" and not "out"
|
||||
.side_set 2 ; 0 = bclk, 1=wclk
|
||||
|
||||
; The C code should place (number of bits/sample - 2) in Y and
|
||||
; also update the SHIFTCTRL to be 24 or 32 as appropriate
|
||||
|
||||
; +----- WCLK
|
||||
; |+---- BCLK
|
||||
mov x, y side 0b00
|
||||
left:
|
||||
in pins, 1 side 0b01
|
||||
jmp x--, left side 0b00
|
||||
in pins, 1 side 0b11 ; Last bit of left has WCLK change per I2S spec
|
||||
|
||||
mov x, y side 0b10
|
||||
right:
|
||||
in pins, 1 side 0b11
|
||||
jmp x--, right side 0b10
|
||||
in pins, 1 side 0b01 ; Last bit of right also has WCLK change
|
||||
; Loop back to beginning...
|
||||
|
||||
|
||||
|
||||
% c-sdk {
|
||||
|
||||
static inline void pio_i2s_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits) {
|
||||
pio_gpio_init(pio, data_pin);
|
||||
pio_gpio_init(pio, clock_pin_base);
|
||||
pio_gpio_init(pio, clock_pin_base + 1);
|
||||
|
||||
pio_sm_config sm_config = pio_i2s_out_program_get_default_config(offset);
|
||||
|
||||
sm_config_set_out_pins(&sm_config, data_pin, 1);
|
||||
sm_config_set_sideset_pins(&sm_config, clock_pin_base);
|
||||
sm_config_set_out_shift(&sm_config, false, true, (bits <= 16) ? 2 * bits : bits);
|
||||
sm_config_set_fifo_join(&sm_config, PIO_FIFO_JOIN_TX);
|
||||
|
||||
pio_sm_init(pio, sm, offset, &sm_config);
|
||||
|
||||
uint pin_mask = (1u << data_pin) | (3u << clock_pin_base);
|
||||
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
|
||||
pio_sm_set_pins(pio, sm, 0); // clear pins
|
||||
|
||||
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
|
||||
}
|
||||
|
||||
static inline void pio_i2s_in_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits) {
|
||||
pio_gpio_init(pio, data_pin);
|
||||
pio_gpio_init(pio, clock_pin_base);
|
||||
pio_gpio_init(pio, clock_pin_base + 1);
|
||||
|
||||
pio_sm_config sm_config = pio_i2s_in_program_get_default_config(offset);
|
||||
|
||||
sm_config_set_in_pins(&sm_config, data_pin);
|
||||
sm_config_set_sideset_pins(&sm_config, clock_pin_base);
|
||||
sm_config_set_in_shift(&sm_config, false, true, (bits <= 16) ? 2 * bits : bits);
|
||||
sm_config_set_fifo_join(&sm_config, PIO_FIFO_JOIN_RX);
|
||||
|
||||
pio_sm_init(pio, sm, offset, &sm_config);
|
||||
|
||||
uint pin_mask = 3u << clock_pin_base;
|
||||
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
|
||||
pio_sm_set_pins(pio, sm, 0); // clear pins
|
||||
|
||||
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
|
||||
}
|
||||
|
||||
%}
|
||||
@@ -0,0 +1,112 @@
|
||||
// -------------------------------------------------- //
|
||||
// This file is autogenerated by pioasm; do not edit! //
|
||||
// -------------------------------------------------- //
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !PICO_NO_HARDWARE
|
||||
#include "hardware/pio.h"
|
||||
#endif
|
||||
|
||||
// ----------- //
|
||||
// pio_i2s_out //
|
||||
// ----------- //
|
||||
|
||||
#define pio_i2s_out_wrap_target 0
|
||||
#define pio_i2s_out_wrap 7
|
||||
|
||||
static const uint16_t pio_i2s_out_program_instructions[] = {
|
||||
// .wrap_target
|
||||
0xa822, // 0: mov x, y side 1
|
||||
0x6001, // 1: out pins, 1 side 0
|
||||
0x0841, // 2: jmp x--, 1 side 1
|
||||
0x7001, // 3: out pins, 1 side 2
|
||||
0xb822, // 4: mov x, y side 3
|
||||
0x7001, // 5: out pins, 1 side 2
|
||||
0x1845, // 6: jmp x--, 5 side 3
|
||||
0x6001, // 7: out pins, 1 side 0
|
||||
// .wrap
|
||||
};
|
||||
|
||||
#if !PICO_NO_HARDWARE
|
||||
static const struct pio_program pio_i2s_out_program = {
|
||||
.instructions = pio_i2s_out_program_instructions,
|
||||
.length = 8,
|
||||
.origin = -1,
|
||||
};
|
||||
|
||||
static inline pio_sm_config pio_i2s_out_program_get_default_config(uint offset) {
|
||||
pio_sm_config c = pio_get_default_sm_config();
|
||||
sm_config_set_wrap(&c, offset + pio_i2s_out_wrap_target, offset + pio_i2s_out_wrap);
|
||||
sm_config_set_sideset(&c, 2, false, false);
|
||||
return c;
|
||||
}
|
||||
#endif
|
||||
|
||||
// ---------- //
|
||||
// pio_i2s_in //
|
||||
// ---------- //
|
||||
|
||||
#define pio_i2s_in_wrap_target 0
|
||||
#define pio_i2s_in_wrap 7
|
||||
|
||||
static const uint16_t pio_i2s_in_program_instructions[] = {
|
||||
// .wrap_target
|
||||
0xa022, // 0: mov x, y side 0
|
||||
0x4801, // 1: in pins, 1 side 1
|
||||
0x0041, // 2: jmp x--, 1 side 0
|
||||
0x5801, // 3: in pins, 1 side 3
|
||||
0xb022, // 4: mov x, y side 2
|
||||
0x5801, // 5: in pins, 1 side 3
|
||||
0x1045, // 6: jmp x--, 5 side 2
|
||||
0x4801, // 7: in pins, 1 side 1
|
||||
// .wrap
|
||||
};
|
||||
|
||||
#if !PICO_NO_HARDWARE
|
||||
static const struct pio_program pio_i2s_in_program = {
|
||||
.instructions = pio_i2s_in_program_instructions,
|
||||
.length = 8,
|
||||
.origin = -1,
|
||||
};
|
||||
|
||||
static inline pio_sm_config pio_i2s_in_program_get_default_config(uint offset) {
|
||||
pio_sm_config c = pio_get_default_sm_config();
|
||||
sm_config_set_wrap(&c, offset + pio_i2s_in_wrap_target, offset + pio_i2s_in_wrap);
|
||||
sm_config_set_sideset(&c, 2, false, false);
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline void pio_i2s_out_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits) {
|
||||
pio_gpio_init(pio, data_pin);
|
||||
pio_gpio_init(pio, clock_pin_base);
|
||||
pio_gpio_init(pio, clock_pin_base + 1);
|
||||
pio_sm_config sm_config = pio_i2s_out_program_get_default_config(offset);
|
||||
sm_config_set_out_pins(&sm_config, data_pin, 1);
|
||||
sm_config_set_sideset_pins(&sm_config, clock_pin_base);
|
||||
sm_config_set_out_shift(&sm_config, false, true, (bits <= 16) ? 2 * bits : bits);
|
||||
sm_config_set_fifo_join(&sm_config, PIO_FIFO_JOIN_TX);
|
||||
pio_sm_init(pio, sm, offset, &sm_config);
|
||||
uint pin_mask = (1u << data_pin) | (3u << clock_pin_base);
|
||||
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
|
||||
pio_sm_set_pins(pio, sm, 0); // clear pins
|
||||
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
|
||||
}
|
||||
static inline void pio_i2s_in_program_init(PIO pio, uint sm, uint offset, uint data_pin, uint clock_pin_base, uint bits) {
|
||||
pio_gpio_init(pio, data_pin);
|
||||
pio_gpio_init(pio, clock_pin_base);
|
||||
pio_gpio_init(pio, clock_pin_base + 1);
|
||||
pio_sm_config sm_config = pio_i2s_in_program_get_default_config(offset);
|
||||
sm_config_set_in_pins(&sm_config, data_pin);
|
||||
sm_config_set_sideset_pins(&sm_config, clock_pin_base);
|
||||
sm_config_set_in_shift(&sm_config, false, true, (bits <= 16) ? 2 * bits : bits);
|
||||
sm_config_set_fifo_join(&sm_config, PIO_FIFO_JOIN_RX);
|
||||
pio_sm_init(pio, sm, offset, &sm_config);
|
||||
uint pin_mask = 3u << clock_pin_base;
|
||||
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
|
||||
pio_sm_set_pins(pio, sm, 0); // clear pins
|
||||
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -307,5 +307,12 @@ void SPIClassRP2040::setClockDivider(uint8_t uc_div) {
|
||||
(void) uc_div; // no-op
|
||||
}
|
||||
|
||||
SPIClassRP2040 SPI(spi0, PIN_SPI0_MISO, PIN_SPI0_SS, PIN_SPI0_SCK, PIN_SPI0_MOSI);
|
||||
SPIClassRP2040 SPI1(spi1, PIN_SPI1_MISO, PIN_SPI1_SS, PIN_SPI1_SCK, PIN_SPI1_MOSI);
|
||||
#ifndef __SPI0_DEVICE
|
||||
#define __SPI0_DEVICE spi0
|
||||
#endif
|
||||
#ifndef __SPI1_DEVICE
|
||||
#define __SPI1_DEVICE spi1
|
||||
#endif
|
||||
|
||||
SPIClassRP2040 SPI(__SPI0_DEVICE, PIN_SPI0_MISO, PIN_SPI0_SS, PIN_SPI0_SCK, PIN_SPI0_MOSI);
|
||||
SPIClassRP2040 SPI1(__SPI1_DEVICE, PIN_SPI1_MISO, PIN_SPI1_SS, PIN_SPI1_SCK, PIN_SPI1_MOSI);
|
||||
@@ -126,13 +126,12 @@ void TwoWire::begin(uint8_t addr) {
|
||||
i2c_set_slave_mode(_i2c, true, addr);
|
||||
|
||||
// Our callback IRQ
|
||||
_i2c->hw->intr_mask = (1 << 10) | (1 << 9) | (1 << 6) | (1 << 5) | (1 << 2);
|
||||
_i2c->hw->intr_mask = (1 << 12) | (1 << 10) | (1 << 9) | (1 << 6) | (1 << 5) | (1 << 2);
|
||||
|
||||
int irqNo = I2C0_IRQ + i2c_hw_index(_i2c);
|
||||
irq_set_exclusive_handler(irqNo, i2c_hw_index(_i2c) == 0 ? _handler0 : _handler1);
|
||||
irq_set_enabled(irqNo, true);
|
||||
|
||||
|
||||
gpio_set_function(_sda, GPIO_FUNC_I2C);
|
||||
gpio_pull_up(_sda);
|
||||
gpio_set_function(_scl, GPIO_FUNC_I2C);
|
||||
@@ -142,6 +141,15 @@ void TwoWire::begin(uint8_t addr) {
|
||||
}
|
||||
|
||||
void TwoWire::onIRQ() {
|
||||
if (_i2c->hw->intr_stat & (1 << 12)) {
|
||||
if (_onReceiveCallback && _buffLen) {
|
||||
_onReceiveCallback(_buffLen);
|
||||
}
|
||||
_buffLen = 0;
|
||||
_buffOff = 0;
|
||||
_slaveStartDet = false;
|
||||
_i2c->hw->clr_restart_det;
|
||||
}
|
||||
if (_i2c->hw->intr_stat & (1 << 10)) {
|
||||
_buffLen = 0;
|
||||
_buffOff = 0;
|
||||
@@ -183,7 +191,15 @@ void TwoWire::end() {
|
||||
// ERROR
|
||||
return;
|
||||
}
|
||||
|
||||
if (_slave) {
|
||||
int irqNo = I2C0_IRQ + i2c_hw_index(_i2c);
|
||||
irq_remove_handler(irqNo, i2c_hw_index(_i2c) == 0 ? _handler0 : _handler1);
|
||||
irq_set_enabled(irqNo, false);
|
||||
}
|
||||
|
||||
i2c_deinit(_i2c);
|
||||
|
||||
pinMode(_sda, INPUT);
|
||||
pinMode(_scl, INPUT);
|
||||
_running = false;
|
||||
@@ -207,7 +223,7 @@ size_t TwoWire::requestFrom(uint8_t address, size_t quantity, bool stopBit) {
|
||||
}
|
||||
|
||||
_buffLen = i2c_read_blocking_until(_i2c, address, _buff, quantity, !stopBit, make_timeout_time_ms(_timeout));
|
||||
if (_buffLen == PICO_ERROR_GENERIC) {
|
||||
if ((_buffLen == PICO_ERROR_GENERIC) || (_buffLen == PICO_ERROR_TIMEOUT)) {
|
||||
_buffLen = 0;
|
||||
}
|
||||
_buffOff = 0;
|
||||
@@ -368,5 +384,12 @@ void TwoWire::onRequest(void(*function)(void)) {
|
||||
_onRequestCallback = function;
|
||||
}
|
||||
|
||||
TwoWire Wire(i2c0, PIN_WIRE0_SDA, PIN_WIRE0_SCL);
|
||||
TwoWire Wire1(i2c1, PIN_WIRE1_SDA, PIN_WIRE1_SCL);
|
||||
#ifndef __WIRE0_DEVICE
|
||||
#define __WIRE0_DEVICE i2c0
|
||||
#endif
|
||||
#ifndef __WIRE1_DEVICE
|
||||
#define __WIRE1_DEVICE i2c1
|
||||
#endif
|
||||
|
||||
TwoWire Wire(__WIRE0_DEVICE, PIN_WIRE0_SDA, PIN_WIRE0_SCL);
|
||||
TwoWire Wire1(__WIRE1_DEVICE, PIN_WIRE1_SDA, PIN_WIRE1_SCL);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "framework-arduinopico",
|
||||
"version": "1.20000.0",
|
||||
"version": "1.20201.0",
|
||||
"description": "Arduino Wiring-based Framework (RPi Pico RP2040)",
|
||||
"keywords": [
|
||||
"framework",
|
||||
|
||||
@@ -110,20 +110,12 @@ sed 's/^tools.uf2conv.cmd=.*//g' | \
|
||||
sed 's/^#tools.uf2conv.cmd=/tools.uf2conv.cmd=/g' | \
|
||||
sed 's/^tools.picoprobe.cmd=.*//g' | \
|
||||
sed 's/^#tools.picoprobe.cmd=/tools.picoprobe.cmd=/g' | \
|
||||
sed 's/^tools.picodebug.cmd=.*//g' | \
|
||||
sed 's/^#tools.picodebug.cmd=/tools.picodebug.cmd=/g' | \
|
||||
sed "s/version=.*/version=$ver/g" |\
|
||||
sed -E "s/name=([a-zA-Z0-9\ -]+).*/name=\1($ver)/g"\
|
||||
> $outdir/platform.txt
|
||||
|
||||
# Put core version and short hash of git version into core_version.h
|
||||
ver_define=`echo $plain_ver | tr "[:lower:].\055" "[:upper:]_"`
|
||||
echo Ver define: $ver_define
|
||||
echo \#define ARDUINO_RP2040_GIT_VER 0x`git rev-parse --short=8 HEAD 2>/dev/null` >$outdir/cores/rp2040/core_version.h
|
||||
echo \#define ARDUINO_RP2040_GIT_DESC `git describe --tags 2>/dev/null` >>$outdir/cores/rp2040/core_version.h
|
||||
echo \#define ARDUINO_RP2040_RELEASE_$ver_define >>$outdir/cores/rp2040/core_version.h
|
||||
echo \#define ARDUINO_RP2040_RELEASE \"$ver_define\" >>$outdir/cores/rp2040/core_version.h
|
||||
|
||||
sed -i 's/"version": .*/"version": "'$visible_ver'"/' $outdir/package.json
|
||||
|
||||
# Zip the package
|
||||
pushd package/versions/$visible_ver
|
||||
echo "Making $package_name.zip"
|
||||
|
||||
@@ -59,6 +59,9 @@
|
||||
{
|
||||
"name": "Invector Labs Challenger RP2040 WiFi"
|
||||
},
|
||||
{
|
||||
"name": "Invector Labs Challenger RP2040 WiFi/BLE"
|
||||
},
|
||||
{
|
||||
"name": "Invector Labs Challenger NB RP2040 WiFi"
|
||||
},
|
||||
@@ -92,6 +95,12 @@
|
||||
{
|
||||
"name": "WIZnet W5100S-EVB-Pico"
|
||||
},
|
||||
{
|
||||
"name": "WIZnet 5500-EVB-Pico"
|
||||
},
|
||||
{
|
||||
"name": "WIZnet WizFi360-EVB-Pico"
|
||||
},
|
||||
{
|
||||
"name": "Generic RP2040 Module"
|
||||
}
|
||||
@@ -99,22 +108,22 @@
|
||||
"toolsDependencies": [
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-gcc"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-mklittlefs"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-elf2uf2"
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-pioasm"
|
||||
},
|
||||
{
|
||||
@@ -124,7 +133,7 @@
|
||||
},
|
||||
{
|
||||
"packager": "rp2040",
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-openocd"
|
||||
}
|
||||
],
|
||||
@@ -135,57 +144,57 @@
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-openocd",
|
||||
"systems": [
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
|
||||
"checksum": "SHA-256:d1d95978101c69c3bc777e61ba70077bf9dc4b3245aa7dd93171acaec4d29fb1",
|
||||
"size": "5607214"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/aarch64-linux-gnu.openocd-e3428fadb.220619.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.openocd-e3428fadb.220619.tar.gz",
|
||||
"checksum": "SHA-256:8cdddf73090b6d7f5ef7fdb1b60e9f755166ce494d774b91004e6655a80abfa1",
|
||||
"size": "5607149"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.openocd-e3428fadb.220212.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.openocd-e3428fadb.220212.tar.gz",
|
||||
"checksum": "SHA-256:81373c1e12a88e382a587688343c2e2f2f1f999d38334b7b6ded174929cc9b88",
|
||||
"size": "5344032"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/arm-linux-gnueabihf.openocd-e3428fadb.220619.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.openocd-e3428fadb.220619.tar.gz",
|
||||
"checksum": "SHA-256:07d4e170396f57d5180569168d9bc24b258207900fbc8c87b38056ac1b2fed1e",
|
||||
"size": "5344134"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.openocd-e3428fadb.220212.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.openocd-e3428fadb.220212.tar.gz",
|
||||
"checksum": "SHA-256:6a4dd98422a187c7725fc349b045b55e4742166c65461847d1bd59537242b0be",
|
||||
"size": "5168258"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-linux-gnu.openocd-e3428fadb.220619.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.openocd-e3428fadb.220619.tar.gz",
|
||||
"checksum": "SHA-256:9e3f18ccfb47ee4051bb93c8b9b177e3135eedbbfb3fd9207524b649efe09aed",
|
||||
"size": "5168404"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
|
||||
"checksum": "SHA-256:0643903fcd887a8423cb4ba5329565b499c206921f77ad2e59ae32c472a26dd7",
|
||||
"size": "2156820"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-w64-mingw32.openocd-e3428fadb.220619.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.openocd-e3428fadb.220619.zip",
|
||||
"checksum": "SHA-256:c38bf855c099d933c09d92d57fd1473853eee205957fe22b618e3514d638fe4f",
|
||||
"size": "2156831"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.openocd-e3428fadb.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.openocd-e3428fadb.220212.tar.gz",
|
||||
"checksum": "SHA-256:913b65baeeef1b60caf202e69cde4cd5a3ba0ed2f75f2600adfb3dcf4b3899ef",
|
||||
"size": "2002482"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-apple-darwin14.openocd-e3428fadb.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.openocd-e3428fadb.220619.tar.gz",
|
||||
"checksum": "SHA-256:c36483c5cecfdeba8466b6e112552736c99a2409e6f8e80287b80a3f8d8fdb16",
|
||||
"size": "2002506"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.openocd-e3428fadb.220212.tar.gz",
|
||||
"checksum": "SHA-256:63b2be48c1438d2a09f4ed65d89e555176f18753886555cf48f861e9288d7dc1",
|
||||
"size": "5540524"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-linux-gnu.openocd-e3428fadb.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.openocd-e3428fadb.220619.tar.gz",
|
||||
"checksum": "SHA-256:57083723758814567f6b54e4f81713ce1ce070c6878362a97636da73362f00c9",
|
||||
"size": "5540547"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.openocd-e3428fadb.220212.zip",
|
||||
"checksum": "SHA-256:0643903fcd887a8423cb4ba5329565b499c206921f77ad2e59ae32c472a26dd7",
|
||||
"size": "2156820"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-w64-mingw32.openocd-e3428fadb.220619.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.openocd-e3428fadb.220619.zip",
|
||||
"checksum": "SHA-256:b05d1dbf32d277e214664ae44dd86be96bae61f615c0bac6c1c1c281d6b52b71",
|
||||
"size": "2156832"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -252,226 +261,226 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-gcc",
|
||||
"systems": [
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"checksum": "SHA-256:7773b43b9c0bf5b7cdb2299e9d1b151df97e0a2ded4428809ec68264ac9818a9",
|
||||
"size": "102741416"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/aarch64-linux-gnu.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"checksum": "SHA-256:27dd4a1fe0b6010588928acc9b61937d149ebcd7a4aa47ce944506d71827c460",
|
||||
"size": "77881122"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"checksum": "SHA-256:c422910ef0e29528939e037ea3c518a532726111604b85b27f3f245820680ccb",
|
||||
"size": "95383443"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/arm-linux-gnueabihf.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"checksum": "SHA-256:3e3547998b6c2382d7c6e91b43f0a7a3190e2955160bb471de4cc204b599a757",
|
||||
"size": "73345531"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"checksum": "SHA-256:6306791b43de955c4a4d0a1b8972e0f696206591a810eefc16b906b157322bd3",
|
||||
"size": "105350371"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-linux-gnu.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"checksum": "SHA-256:fca37e1e49a6e25dd507a24e2e9a6947fd0eec7d0a8a30f4bdcac524c9bd18a1",
|
||||
"size": "79497966"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
|
||||
"checksum": "SHA-256:b00aa3594d1911bea07c1dbf31b9a63430f4dcb91c7b3b1341f8551d361d405f",
|
||||
"size": "105568357"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-w64-mingw32.arm-none-eabi-cb31b54.220619.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.arm-none-eabi-cb31b54.220619.zip",
|
||||
"checksum": "SHA-256:61f31ae875a67e8334e031c188fbe30d98c5f1bceb33305acf49d985d9ca71ce",
|
||||
"size": "82625221"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"checksum": "SHA-256:e93b967d1fb6ed0fc7cf6a5161e22a597dd05080c1353ac74e2a42ddf8dfe98d",
|
||||
"size": "107429038"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-apple-darwin14.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"checksum": "SHA-256:d32c7797be2c31d20dc4b5182a0dd77be67324c3c6a52737bfb4e63e1d622f80",
|
||||
"size": "82123114"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-ed6d983.220212.tar.gz",
|
||||
"checksum": "SHA-256:047c4d482cf77e09bd8069fc9d5b28b1e0c76440ad81583a0fc3a8e809959bb8",
|
||||
"size": "106740897"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-linux-gnu.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.arm-none-eabi-cb31b54.220619.tar.gz",
|
||||
"checksum": "SHA-256:470cbe690b2553d3b780ece36cda9fc26c7b53db47362ced3a937d701e696e9e",
|
||||
"size": "80361816"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-ed6d983.220212.zip",
|
||||
"checksum": "SHA-256:5c15725628a3dbd47a8fa8f9a9aab7a2221815ec9bf85dc2080ce19166316ae6",
|
||||
"size": "110420777"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-w64-mingw32.arm-none-eabi-cb31b54.220619.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.arm-none-eabi-cb31b54.220619.zip",
|
||||
"checksum": "SHA-256:7b50d3f34cd602a28d8cf1580c65dd22e683088ce5b954be5bfb67ba50094134",
|
||||
"size": "86068608"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-elf2uf2",
|
||||
"systems": [
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:8cb7ce703b0fa6f2fce6b124ae6f34ad0b866aa4a58096f22b66b1251c1b11c0",
|
||||
"size": "79853"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/aarch64-linux-gnu.elf2uf2-2062372.220619.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.elf2uf2-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:74dd8cf38160bd9f972ea22e02bd6fa6b11bc510aa7738b603c7fbd016fe4b50",
|
||||
"size": "79874"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.elf2uf2-2062372.220212.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:790d46b411c16a4a210a91436eb4bdc81fb34f0119148a8f9c4b09489489a54d",
|
||||
"size": "54244"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/arm-linux-gnueabihf.elf2uf2-2062372.220619.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.elf2uf2-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:efa24ac288a5eacad7b535ce4d9ac66a25686d993f80daf86248858310b3fc63",
|
||||
"size": "54265"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.elf2uf2-2062372.220212.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.elf2uf2-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:7c05c70f761bb6caa986d24ac1065367fe906ff7f0434cf4b0112ace331f74bc",
|
||||
"size": "87891"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-linux-gnu.elf2uf2-2062372.220619.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.elf2uf2-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:c0816a703fe5821a1d1bf60dcb584d98185b83e926d532fd37c69e8801e211ff",
|
||||
"size": "87908"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.elf2uf2-2062372.220212.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.elf2uf2-2062372.220212.zip",
|
||||
"checksum": "SHA-256:e6f0578ea781b160390994d3e95bedfec01e212d47243b1adb84f910a06bcba4",
|
||||
"size": "70405"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-w64-mingw32.elf2uf2-2062372.220619.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.elf2uf2-2062372.220619.zip",
|
||||
"checksum": "SHA-256:7a2f86735220fef0946856f418a136ff4ed3ad4cf0cacc17d8016f6cbd1ca735",
|
||||
"size": "70416"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.elf2uf2-2062372.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.elf2uf2-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:d65de7218eaf01c9bf58fa22bd9e1e7c10c054213948b4b62f648a058d09b4de",
|
||||
"size": "81981"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-apple-darwin14.elf2uf2-2062372.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.elf2uf2-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:2ae3ffd477eaabb891e68e1b4525e3d4d4b2fee3c6f70e6ae68c45746c03fb54",
|
||||
"size": "81995"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.elf2uf2-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:ba7795ed49c54f3f52caee675b0fd078f6fb8498a47bf7e5d7457065271df338",
|
||||
"size": "79585"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-linux-gnu.elf2uf2-2062372.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.elf2uf2-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:2be1052db1e676418c59a4331ef688f686b4a31053330c90348219ab1ecd6bcf",
|
||||
"size": "79610"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.elf2uf2-2062372.220212.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-2062372.220212.zip",
|
||||
"checksum": "SHA-256:02c7684ed1aea4e18216ec6bbbcedeb482c5f23ad7d5eb9dcb942b8ae6cad5ae",
|
||||
"size": "78279"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-w64-mingw32.elf2uf2-2062372.220619.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.elf2uf2-2062372.220619.zip",
|
||||
"checksum": "SHA-256:2a39f7f20e42c5b981286dfdf50bc3d7201cbe63d191caf38a0ffa306422ed08",
|
||||
"size": "78291"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-pioasm",
|
||||
"systems": [
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.pioasm-2062372.220212.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.pioasm-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:9ea17ecf0e492bc6a971f6a78780c3b3c6ee644d52e056cba08a708ac225add2",
|
||||
"size": "453558"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/aarch64-linux-gnu.pioasm-2062372.220619.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.pioasm-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:71887999ad64e64f75658a1883029b337cb9738d87e04944b1dbc0321d3c7a67",
|
||||
"size": "453580"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.pioasm-2062372.220212.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.pioasm-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:c7af69227a3b3c54ccf87122b18842460a263bd711abf93336794ce5f905c284",
|
||||
"size": "360559"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/arm-linux-gnueabihf.pioasm-2062372.220619.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.pioasm-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:5b2e863e5764b0c4d53f536b5ea217e2a27f02f04b74da799e19b1fa6c8b39a8",
|
||||
"size": "360581"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.pioasm-2062372.220212.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.pioasm-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:f66b9bde3d6859d43049b019fb639dd0bfafcd43f1389ffc499d18949bcf1808",
|
||||
"size": "511397"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-linux-gnu.pioasm-2062372.220619.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.pioasm-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:fd5ec8b1940e51db6ec2e2beea73d7be7f1e9cf09f6e66d739e3ed1be177a7a6",
|
||||
"size": "511417"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.pioasm-2062372.220212.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.pioasm-2062372.220212.zip",
|
||||
"checksum": "SHA-256:89cfa44101dade30000cfaa5985de7f0e7aba93d03dc45ba962f97226ae4e41f",
|
||||
"size": "385748"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-w64-mingw32.pioasm-2062372.220619.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.pioasm-2062372.220619.zip",
|
||||
"checksum": "SHA-256:6a4a5f4f3c0b7a3bc08b2b3bd8111d33a5619633de9b04e03bf0bca6f17d1337",
|
||||
"size": "385759"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.pioasm-2062372.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.pioasm-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:d531c911e6eba0333379af04dd807917659bd4d34be9f4bd6792aeff55ab15a9",
|
||||
"size": "480495"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-apple-darwin14.pioasm-2062372.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.pioasm-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:9d9d7a3addaaca00712fdf5516a21fdae94926210f12f7ae16dc8ebf7beacfe8",
|
||||
"size": "480510"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.pioasm-2062372.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.pioasm-2062372.220212.tar.gz",
|
||||
"checksum": "SHA-256:2cd4aa8af98558461cb7b85b21830ea854a430a3e57668d618c5f1cd5e389809",
|
||||
"size": "458730"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-linux-gnu.pioasm-2062372.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.pioasm-2062372.220619.tar.gz",
|
||||
"checksum": "SHA-256:be77c350eb7777de01c93312919c370e4ef3e5e281f122f46a2348a21693c480",
|
||||
"size": "458738"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.pioasm-2062372.220212.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.pioasm-2062372.220212.zip",
|
||||
"checksum": "SHA-256:ba586e67f4b309690a51fca70fdd26f38b68951b0fee4dc8333183ef6429833a",
|
||||
"size": "408649"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-w64-mingw32.pioasm-2062372.220619.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.pioasm-2062372.220619.zip",
|
||||
"checksum": "SHA-256:451ad335a5cebcee3b6acda73d887a488f98c4a8839b8e98d557425f8d7f47ea",
|
||||
"size": "408660"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.3.3-a-ed6d983",
|
||||
"version": "1.4.0-b-cb31b54",
|
||||
"name": "pqt-mklittlefs",
|
||||
"systems": [
|
||||
{
|
||||
"host": "aarch64-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/aarch64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
|
||||
"checksum": "SHA-256:2455f5ca6cb1f7b73ed1cb55d4d2261d249c1b24915bd4e66e28f037a0a13116",
|
||||
"size": "47271"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/aarch64-linux-gnu.mklittlefs-affa497.220619.tar.gz",
|
||||
"archiveFileName": "aarch64-linux-gnu.mklittlefs-affa497.220619.tar.gz",
|
||||
"checksum": "SHA-256:1752294e6cc6ce3edd8b417e773c8703a1dc4e616f158ed6c928b62bec7289b5",
|
||||
"size": "47286"
|
||||
},
|
||||
{
|
||||
"host": "arm-linux-gnueabihf",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/arm-linux-gnueabihf.mklittlefs-affa497.220212.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-affa497.220212.tar.gz",
|
||||
"checksum": "SHA-256:f4b71138f1469e4b9ce82b3b21252aca265a88d56a5d48513dbb5c6d58b19841",
|
||||
"size": "40807"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/arm-linux-gnueabihf.mklittlefs-affa497.220619.tar.gz",
|
||||
"archiveFileName": "arm-linux-gnueabihf.mklittlefs-affa497.220619.tar.gz",
|
||||
"checksum": "SHA-256:07e182ca15cf60d0f266030ff796ffc566c78e5e1fd148948a6ec3cbab444103",
|
||||
"size": "40823"
|
||||
},
|
||||
{
|
||||
"host": "i686-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-linux-gnu.mklittlefs-affa497.220212.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.mklittlefs-affa497.220212.tar.gz",
|
||||
"checksum": "SHA-256:ed1011230c75447dad3d912b7b5607ddcc59e093ee7ebd653fb05274bc876f4c",
|
||||
"size": "50909"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-linux-gnu.mklittlefs-affa497.220619.tar.gz",
|
||||
"archiveFileName": "i686-linux-gnu.mklittlefs-affa497.220619.tar.gz",
|
||||
"checksum": "SHA-256:774657fbfaca1793acd8461e90399de1be0e99715b9135af0b935adc40211c72",
|
||||
"size": "50926"
|
||||
},
|
||||
{
|
||||
"host": "i686-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/i686-w64-mingw32.mklittlefs-affa497.220212.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.mklittlefs-affa497.220212.zip",
|
||||
"checksum": "SHA-256:1289f51c674ebdc568843b82c88db21eb4c295f3b15c26398d31266b9da63b4c",
|
||||
"size": "334050"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/i686-w64-mingw32.mklittlefs-affa497.220619.zip",
|
||||
"archiveFileName": "i686-w64-mingw32.mklittlefs-affa497.220619.zip",
|
||||
"checksum": "SHA-256:473ba014d011737d97e703059cf2819d9ee2328f2af2f93f52c43eba53e34f55",
|
||||
"size": "334062"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-apple-darwin",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-apple-darwin14.mklittlefs-affa497.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.mklittlefs-affa497.220212.tar.gz",
|
||||
"checksum": "SHA-256:0c0d7d8c80739ed79bc5a41e831d0229b6378e87f4c58f148d884814f1ad46d2",
|
||||
"size": "365757"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-apple-darwin14.mklittlefs-affa497.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-apple-darwin14.mklittlefs-affa497.220619.tar.gz",
|
||||
"checksum": "SHA-256:ffc1fef60f4c359978f6476a8cc33995638d826e4820ca96fc17f3cf47250bec",
|
||||
"size": "365767"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-pc-linux-gnu",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.mklittlefs-affa497.220212.tar.gz",
|
||||
"checksum": "SHA-256:c504429c24cfea9bf841cbf0caa29bbe0115e72c94c18f949451ffa540d6cacc",
|
||||
"size": "49766"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-linux-gnu.mklittlefs-affa497.220619.tar.gz",
|
||||
"archiveFileName": "x86_64-linux-gnu.mklittlefs-affa497.220619.tar.gz",
|
||||
"checksum": "SHA-256:0a05281f13ae48a1ce4894107525e7027258746c1cac3a568b51b8082f99e93f",
|
||||
"size": "49786"
|
||||
},
|
||||
{
|
||||
"host": "x86_64-mingw32",
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.3.3-a/x86_64-w64-mingw32.mklittlefs-affa497.220212.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-affa497.220212.zip",
|
||||
"checksum": "SHA-256:4ada867888513596fa51bf78c98d9e970de9b8f1eec4f88d85e6e7621704fb91",
|
||||
"size": "347602"
|
||||
"url": "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/1.4.0-b/x86_64-w64-mingw32.mklittlefs-affa497.220619.zip",
|
||||
"archiveFileName": "x86_64-w64-mingw32.mklittlefs-affa497.220619.zip",
|
||||
"checksum": "SHA-256:039981ec41f38a9c89de3466d9fd8c9e7c0723ab53798223ceb4d122fdcac914",
|
||||
"size": "347613"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
-1
Submodule pico-extras deleted from 77eae28366
+1
-1
Submodule pico-sdk updated: 2062372d20...e7267f99fe
+9
-7
@@ -20,7 +20,7 @@
|
||||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=Raspberry Pi RP2040 Boards
|
||||
version=2.0.0
|
||||
version=2.2.1
|
||||
|
||||
runtime.tools.pqt-gcc.path={runtime.platform.path}/system/arm-none-eabi
|
||||
runtime.tools.pqt-python3.path={runtime.platform.path}/system/python3
|
||||
@@ -43,19 +43,18 @@ compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualif
|
||||
|
||||
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|
||||
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt"
|
||||
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections -fno-exceptions
|
||||
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect}
|
||||
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
|
||||
compiler.libpico="{runtime.platform.path}/lib/libpico.a"
|
||||
compiler.libstdcpp="-lstdc++"
|
||||
|
||||
compiler.c.cmd=arm-none-eabi-gcc
|
||||
compiler.c.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} {compiler.includes} -std=gnu17 -g
|
||||
compiler.c.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} -MMD {compiler.includes} -std=gnu17 -g
|
||||
compiler.c.elf.cmd=arm-none-eabi-g++
|
||||
compiler.c.elf.flags={compiler.warning_flags} {compiler.defines} {compiler.flags} {build.flags.optimize} -u _printf_float -u _scanf_float
|
||||
compiler.S.cmd=arm-none-eabi-gcc
|
||||
compiler.S.flags=-c {compiler.warning_flags} -g -x assembler-with-cpp -MMD {compiler.includes} -g
|
||||
compiler.cpp.cmd=arm-none-eabi-g++
|
||||
compiler.cpp.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} {compiler.includes} {build.flags.rtti} -std=gnu++17 -g
|
||||
compiler.cpp.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} -MMD {compiler.includes} {build.flags.rtti} -std=gnu++17 -g
|
||||
|
||||
compiler.ar.cmd=arm-none-eabi-ar
|
||||
compiler.ar.flags=rcs
|
||||
@@ -88,6 +87,9 @@ build.flags.rtti=-fno-rtti
|
||||
build.fs_start=
|
||||
build.fs_end=
|
||||
build.usbstack_flags=
|
||||
build.flags.libstdcpp=-lstdc++
|
||||
build.flags.exceptions=-fno-exceptions
|
||||
build.flags.stackprotect=
|
||||
|
||||
build.boot2=boot2_generic_03h_4_padded_checksum
|
||||
|
||||
@@ -119,7 +121,7 @@ recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3
|
||||
recipe.hooks.linking.prelink.2.pattern="{compiler.path}{compiler.S.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -c "{runtime.platform.path}/boot2/{build.boot2}.S" "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" -o "{build.path}/boot2.o"
|
||||
|
||||
## Combine gc-sections, archives, and objects
|
||||
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.ldflags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/{archive_file}" "{build.path}/boot2.o" {compiler.libraries.ldflags} {compiler.libpico} -lm -lc {compiler.libstdcpp} -lc -Wl,--end-group
|
||||
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.ldflags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/{archive_file}" "{build.path}/boot2.o" {compiler.libraries.ldflags} {compiler.libpico} -lm -lc {build.flags.libstdcpp} -lc -Wl,--end-group
|
||||
|
||||
## Create output (UF2 file)
|
||||
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
|
||||
@@ -146,7 +148,6 @@ tools.uf2conv.upload.params.verbose=
|
||||
tools.uf2conv.upload.params.quiet=
|
||||
tools.uf2conv.upload.pattern="{cmd}" -I "{runtime.platform.path}/tools/uf2conv.py" --serial "{serial.port}" --family RP2040 --deploy "{build.path}/{build.project_name}.uf2"
|
||||
|
||||
|
||||
#tools.picoprobe.cmd={runtime.tools.pqt-openocd.path}
|
||||
tools.picoprobe.cmd={runtime.platform.path}/system/openocd
|
||||
tools.picoprobe.upload.protocol=picoprobe
|
||||
@@ -154,6 +155,7 @@ tools.picoprobe.upload.params.verbose=
|
||||
tools.picoprobe.upload.params.quiet=
|
||||
tools.picoprobe.upload.pattern="{cmd}/bin/openocd" -f "interface/picoprobe.cfg" -f "target/rp2040.cfg" -s "{cmd}/share/openocd/scripts" -c "program {{build.path}/{build.project_name}.elf} verify reset exit"
|
||||
|
||||
#tools.picodebug.cmd={runtime.tools.pqt-openocd.path}
|
||||
tools.picodebug.cmd={runtime.platform.path}/system/openocd
|
||||
tools.picodebug.upload.protocol=pico-debug
|
||||
tools.picodebug.upload.params.verbose=
|
||||
|
||||
@@ -14,23 +14,3 @@
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
edbg.name=Atmel EDBG
|
||||
edbg.communication=USB
|
||||
edbg.protocol=
|
||||
edbg.program.protocol=
|
||||
edbg.program.tool=openocd
|
||||
edbg.program.extra_params=
|
||||
|
||||
atmel_ice.name=Atmel-ICE
|
||||
atmel_ice.communication=USB
|
||||
atmel_ice.protocol=
|
||||
atmel_ice.program.protocol=
|
||||
atmel_ice.program.tool=openocd
|
||||
atmel_ice.program.extra_params=
|
||||
|
||||
sam_ice.name=Atmel SAM-ICE
|
||||
sam_ice.communication=USB
|
||||
sam_ice.protocol=
|
||||
sam_ice.program.protocol=
|
||||
sam_ice.program.tool=openocd
|
||||
sam_ice.program.extra_params=
|
||||
|
||||
@@ -23,6 +23,8 @@ function skip_ino()
|
||||
/msc_sd/
|
||||
/msc_sdfat/
|
||||
/midi_pizza_box_dj/
|
||||
/msc_esp32_file_browser/
|
||||
/DualRole/
|
||||
EOL
|
||||
echo $ino | grep -q -F "$skiplist"
|
||||
echo $(( 1 - $? ))
|
||||
|
||||
+2
-8
@@ -161,7 +161,7 @@ function install_libraries()
|
||||
function install_ide()
|
||||
{
|
||||
local idever='nightly'
|
||||
local ideurl='https://www.arduino.cc/download.php?f=/arduino-nightly'
|
||||
local ideurl='https://downloads.arduino.cc/arduino-nightly' #'https://www.arduino.cc/download.php?f=/arduino-nightly'
|
||||
|
||||
#local idever='1.8.10'
|
||||
#local ideurl="https://downloads.arduino.cc/arduino-$idever"
|
||||
@@ -212,7 +212,7 @@ function install_ide()
|
||||
cat rp2040/platform.local.txt
|
||||
echo -e "\n----\n"
|
||||
cd rp2040/tools
|
||||
python3 get.py -q
|
||||
python3 get.py
|
||||
if [ "$WINDOWS" = "1" ]; then
|
||||
# Because the symlinks don't work well under Win32, we need to add the path to this copy, not the original...
|
||||
relbin=$(realpath $PWD/../system/arm-none-eabi/bin)
|
||||
@@ -226,12 +226,10 @@ function install_arduino()
|
||||
{
|
||||
local debug=$1
|
||||
# Install Arduino IDE and required libraries
|
||||
echo -e "travis_fold:start:sketch_test_env_prepare"
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
install_libraries
|
||||
echo -e "travis_fold:end:sketch_test_env_prepare"
|
||||
}
|
||||
|
||||
function build_sketches_with_arduino()
|
||||
@@ -241,15 +239,11 @@ function build_sketches_with_arduino()
|
||||
local build_extra=$3
|
||||
|
||||
# Compile sketches
|
||||
echo -e "travis_fold:start:sketch_test"
|
||||
build_sketches $HOME/arduino_ide $HOME/arduino_ide/examples "-l $HOME/Arduino/libraries ${build_extra}" $build_mod $build_rem
|
||||
build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries ${build_extra}" $build_mod $build_rem
|
||||
echo -e "travis_fold:end:sketch_test"
|
||||
|
||||
# Generate size report
|
||||
echo -e "travis_fold:start:size_report"
|
||||
cat size.log
|
||||
echo -e "travis_fold:end:size_report"
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-12
@@ -15,8 +15,6 @@ import tarfile
|
||||
import zipfile
|
||||
import re
|
||||
|
||||
verbose = True
|
||||
|
||||
if sys.version_info[0] == 3:
|
||||
from urllib.request import urlretrieve
|
||||
else:
|
||||
@@ -40,8 +38,7 @@ def mkdir_p(path):
|
||||
raise
|
||||
|
||||
def report_progress(count, blockSize, totalSize):
|
||||
global verbose
|
||||
if verbose:
|
||||
if sys.stdout.isatty():
|
||||
percent = int(count*blockSize*100/totalSize)
|
||||
percent = min(100, percent)
|
||||
sys.stdout.write("\r%d%%" % percent)
|
||||
@@ -121,14 +118,6 @@ def identify_platform():
|
||||
return arduino_platform_names[sys_name][bits]
|
||||
|
||||
def main():
|
||||
global verbose
|
||||
# Support optional "-q" quiet mode simply
|
||||
if len(sys.argv) == 2:
|
||||
if sys.argv[1] == "-q":
|
||||
verbose = False
|
||||
# Remove a symlink generated in 2.6.3 which causes later issues since the tarball can't properly overwrite it
|
||||
if (os.path.exists('python3/python3')):
|
||||
os.unlink('python3/python3')
|
||||
print('Platform: {0}'.format(identify_platform()))
|
||||
tools_to_download = load_tools_list('../package/package_pico_index.template.json', identify_platform())
|
||||
mkdir_p(dist_dir)
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25x10cl_4_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80f1"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_FEATHER_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_feather",
|
||||
"boot2_source": "boot2_w25x10cl_4_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80f1",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "Feather RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_feather"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80fd"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_ITSYBITSY_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_itsybitsy",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80fd",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "ItsyBitsy RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_itsybitsy"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x8105"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_KB2040_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_kb2040",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x8105",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "KB2040"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_kb2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x8107"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_MACROPAD_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_macropad2040",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x8107",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "MacroPad RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_macropad2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80f7"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_QTPY_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_qtpy",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80f7",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "QT Py RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_qtpy"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80e3"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_STEMMAFRIEND_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_stemmafriend",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x80e3",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "STEMMA Friend RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_stemmafriend"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x8109"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ADAFRUIT_TRINKEYQT_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "adafruit_trinkeyrp2040qt",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x239a",
|
||||
"usb_pid": "0x8109",
|
||||
"usb_manufacturer": "Adafruit",
|
||||
"usb_product": "Trinkey RP2040 QT"
|
||||
}
|
||||
}
|
||||
"variant": "adafruit_trinkeyrp2040qt"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Adafruit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2341",
|
||||
"usb_pid": "0x0058"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_NANO_RP2040_CONNECT -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "arduino_nano_connect",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2341",
|
||||
"usb_pid": "0x0058",
|
||||
"usb_manufacturer": "Arduino",
|
||||
"usb_product": "Nano RP2040 Connect"
|
||||
}
|
||||
}
|
||||
"variant": "arduino_nano_connect"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Arduino"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1023"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CHALLENGER_2040_LORA_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "challenger_2040_lora",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1023",
|
||||
"usb_manufacturer": "iLabs",
|
||||
"usb_product": "Challenger 2040 LoRa"
|
||||
}
|
||||
}
|
||||
"variant": "challenger_2040_lora"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x100b"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CHALLENGER_2040_LTE_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "challenger_2040_lte",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x100b",
|
||||
"usb_manufacturer": "iLabs",
|
||||
"usb_product": "Challenger 2040 LTE"
|
||||
}
|
||||
}
|
||||
"variant": "challenger_2040_lte"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1006"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CHALLENGER_2040_WIFI_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "challenger_2040_wifi",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1006",
|
||||
"usb_manufacturer": "iLabs",
|
||||
"usb_product": "Challenger 2040 WiFi"
|
||||
}
|
||||
}
|
||||
"variant": "challenger_2040_wifi"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x102C"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CHALLENGER_2040_WIFI_BLE_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "challenger_2040_wifi_ble"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "Challenger 2040 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": [
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x100b"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CHALLENGER_NB_2040_WIFI_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "challenger_nb_2040_wifi",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x100b",
|
||||
"usb_manufacturer": "iLabs",
|
||||
"usb_product": "Challenger NB 2040 WiFi"
|
||||
}
|
||||
}
|
||||
"variant": "challenger_nb_2040_wifi"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x100f"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CYTRON_MAKER_NANO_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "cytron_maker_nano_rp2040",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x100f",
|
||||
"usb_manufacturer": "Cytron",
|
||||
"usb_product": "Maker Nano RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "cytron_maker_nano_rp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Cytron"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1000"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_CYTRON_MAKER_PI_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "cytron_maker_pi_rp2040",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1000",
|
||||
"usb_manufacturer": "Cytron",
|
||||
"usb_product": "Maker Pi RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "cytron_maker_pi_rp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Cytron"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x3343",
|
||||
"usb_pid": "0x4253"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_DFROBOT_BEETLE_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "dfrobot_beetle_rp2040",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x3343",
|
||||
"usb_pid": "0x4253",
|
||||
"usb_manufacturer": "DFRobot",
|
||||
"usb_product": "Beetle RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "dfrobot_beetle_rp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "DFRobot"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x008a"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_FLYBOARD2040_CORE -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "flyboard2040_core",
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x008a",
|
||||
"usb_manufacturer": "DeRuiLab",
|
||||
"usb_product": "FlyBoard2040Core"
|
||||
}
|
||||
}
|
||||
"variant": "flyboard2040_core"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "DeRuiLab"
|
||||
}
|
||||
}
|
||||
|
||||
+9
-11
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0xf00a"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_GENERIC_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "generic",
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0xf00a",
|
||||
"usb_manufacturer": "Generic",
|
||||
"usb_product": "RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "generic"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Generic"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1010"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_ILABS_2040_RPICO32_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "ilabs_rpico32",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1010",
|
||||
"usb_manufacturer": "iLabs",
|
||||
"usb_product": "RPICO32"
|
||||
}
|
||||
}
|
||||
"variant": "ilabs_rpico32"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "iLabs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1005"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_MELOPERO_SHAKE_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "melopero_shake_rp2040",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1005",
|
||||
"usb_manufacturer": "Melopero",
|
||||
"usb_product": "Shake RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "melopero_shake_rp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Melopero"
|
||||
}
|
||||
}
|
||||
|
||||
+9
-11
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x000a"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_RASPBERRY_PI_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "rpipico",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x000a",
|
||||
"usb_manufacturer": "Raspberry Pi",
|
||||
"usb_product": "Pico"
|
||||
}
|
||||
}
|
||||
"variant": "rpipico"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Raspberry Pi"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x000a"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_SEEED_XAIO_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "seeed_xiao_rp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "XAIO 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": [
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Seeed"
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x1209",
|
||||
"usb_pid": "0xa182"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_SOLDERPARTY_RP2040_STAMP -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=500",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "solderparty_rp2040_stamp",
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x1209",
|
||||
"usb_pid": "0xa182",
|
||||
"usb_manufacturer": "Solder Party",
|
||||
"usb_product": "RP2040 Stamp"
|
||||
}
|
||||
}
|
||||
"variant": "solderparty_rp2040_stamp"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "Solder Party"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x1b4f",
|
||||
"usb_pid": "0x0026"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_SPARKFUN_PROMICRO_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "sparkfun_promicrorp2040",
|
||||
"boot2_source": "boot2_generic_03h_4_padded_checksum.S",
|
||||
"usb_vid": "0x1b4f",
|
||||
"usb_pid": "0x0026",
|
||||
"usb_manufacturer": "SparkFun",
|
||||
"usb_product": "ProMicro RP2040"
|
||||
}
|
||||
}
|
||||
"variant": "sparkfun_promicrorp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "SparkFun"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x1b4f",
|
||||
"usb_pid": "0x0026"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_SPARKFUN_THINGPLUS_RP2040 -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "sparkfun_thingplusrp2040"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "Thing Plus RP2040",
|
||||
"upload": {
|
||||
"maximum_ram_size": 270336,
|
||||
"maximum_size": 16777216,
|
||||
"require_upload_port": true,
|
||||
"native_usb": true,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": false,
|
||||
"protocol": "picotool",
|
||||
"protocols": [
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "SparkFun"
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1007"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_UPESY_RP2040_DEVKIT -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "upesy_rp2040_devkit",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1007",
|
||||
"usb_manufacturer": "uPesy",
|
||||
"usb_product": "RP2040 DevKit"
|
||||
}
|
||||
}
|
||||
"variant": "upesy_rp2040_devkit"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "uPesy"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1027"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_WIZNET_5100S_EVB_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
@@ -11,16 +18,7 @@
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "wiznet_5100s_evb_pico",
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1008",
|
||||
"usb_manufacturer": "WIZnet",
|
||||
"usb_product": "W5100S-EVB-Pico"
|
||||
}
|
||||
}
|
||||
"variant": "wiznet_5100s_evb_pico"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -49,4 +47,4 @@
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "WIZnet"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1029"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_WIZNET_5500_EVB_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "wiznet_5500_evb_pico"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "W5500-EVB-Pico",
|
||||
"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": [
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "WIZnet"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||
"usb_vid": "0x2e8a",
|
||||
"usb_pid": "0x1028"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_WIZNET_WIZFI360_EVB_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||
"f_cpu": "133000000L",
|
||||
"hwids": [
|
||||
[
|
||||
"0x2E8A",
|
||||
"0x00C0"
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"variant": "wiznet_wizfi360_evb_pico"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
"openocd_target": "rp2040.cfg",
|
||||
"svd_path": "rp2040.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino"
|
||||
],
|
||||
"name": "WizFi360-EVB-Pico",
|
||||
"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": [
|
||||
"cmsis-dap",
|
||||
"jlink",
|
||||
"raspberrypi-swd",
|
||||
"picotool",
|
||||
"picoprobe"
|
||||
]
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "WIZnet"
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
include(pico_sdk_import.cmake)
|
||||
include(pico_extras_import.cmake)
|
||||
|
||||
project(pico_lib C CXX ASM)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
@@ -22,6 +21,7 @@ target_compile_definitions(pico PUBLIC
|
||||
|
||||
target_compile_options(pico PUBLIC
|
||||
-fno-exceptions
|
||||
-Os
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
|
||||
)
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
# This is a copy of <PICO_EXTRAS_PATH>/external/pico_extras_import.cmake
|
||||
|
||||
# This can be dropped into an external project to help locate pico-extras
|
||||
# It should be include()ed prior to project()
|
||||
|
||||
if (DEFINED ENV{PICO_EXTRAS_PATH} AND (NOT PICO_EXTRAS_PATH))
|
||||
set(PICO_EXTRAS_PATH $ENV{PICO_EXTRAS_PATH})
|
||||
message("Using PICO_EXTRAS_PATH from environment ('${PICO_EXTRAS_PATH}')")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{PICO_EXTRAS_FETCH_FROM_GIT} AND (NOT PICO_EXTRAS_FETCH_FROM_GIT))
|
||||
set(PICO_EXTRAS_FETCH_FROM_GIT $ENV{PICO_EXTRAS_FETCH_FROM_GIT})
|
||||
message("Using PICO_EXTRAS_FETCH_FROM_GIT from environment ('${PICO_EXTRAS_FETCH_FROM_GIT}')")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{PICO_EXTRAS_FETCH_FROM_GIT_PATH} AND (NOT PICO_EXTRAS_FETCH_FROM_GIT_PATH))
|
||||
set(PICO_EXTRAS_FETCH_FROM_GIT_PATH $ENV{PICO_EXTRAS_FETCH_FROM_GIT_PATH})
|
||||
message("Using PICO_EXTRAS_FETCH_FROM_GIT_PATH from environment ('${PICO_EXTRAS_FETCH_FROM_GIT_PATH}')")
|
||||
endif ()
|
||||
|
||||
if (NOT PICO_EXTRAS_PATH)
|
||||
if (PICO_EXTRAS_FETCH_FROM_GIT)
|
||||
include(FetchContent)
|
||||
set(FETCHCONTENT_BASE_DIR_SAVE ${FETCHCONTENT_BASE_DIR})
|
||||
if (PICO_EXTRAS_FETCH_FROM_GIT_PATH)
|
||||
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_EXTRAS_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
|
||||
endif ()
|
||||
FetchContent_Declare(
|
||||
pico_extras
|
||||
GIT_REPOSITORY https://github.com/raspberrypi/pico-extras
|
||||
GIT_TAG master
|
||||
)
|
||||
if (NOT pico_extras)
|
||||
message("Downloading Raspberry Pi Pico Extras")
|
||||
FetchContent_Populate(pico_extras)
|
||||
set(PICO_EXTRAS_PATH ${pico_extras_SOURCE_DIR})
|
||||
endif ()
|
||||
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
|
||||
else ()
|
||||
if (PICO_SDK_PATH AND EXISTS "${PICO_SDK_PATH}/../pico-extras")
|
||||
set(PICO_EXTRAS_PATH ${PICO_SDK_PATH}/../pico-extras)
|
||||
message("Defaulting PICO_EXTRAS_PATH as sibling of PICO_SDK_PATH: ${PICO_EXTRAS_PATH}")
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"PICO EXTRAS location was not specified. Please set PICO_EXTRAS_PATH or set PICO_EXTRAS_FETCH_FROM_GIT to on to fetch from git."
|
||||
)
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(PICO_EXTRAS_PATH "${PICO_EXTRAS_PATH}" CACHE PATH "Path to the PICO EXTRAS")
|
||||
set(PICO_EXTRAS_FETCH_FROM_GIT "${PICO_EXTRAS_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of PICO EXTRAS from git if not otherwise locatable")
|
||||
set(PICO_EXTRAS_FETCH_FROM_GIT_PATH "${PICO_EXTRAS_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download EXTRAS")
|
||||
|
||||
get_filename_component(PICO_EXTRAS_PATH "${PICO_EXTRAS_PATH}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
|
||||
if (NOT EXISTS ${PICO_EXTRAS_PATH})
|
||||
message(FATAL_ERROR "Directory '${PICO_EXTRAS_PATH}' not found")
|
||||
endif ()
|
||||
|
||||
set(PICO_EXTRAS_PATH ${PICO_EXTRAS_PATH} CACHE PATH "Path to the PICO EXTRAS" FORCE)
|
||||
|
||||
add_subdirectory(${PICO_EXTRAS_PATH} pico_extras)
|
||||
@@ -73,7 +73,7 @@
|
||||
#define CFG_TUD_HID (2)
|
||||
#define CFG_TUD_CDC (1)
|
||||
#define CFG_TUD_MSC (0)
|
||||
#define CFG_TUD_MIDI (1)
|
||||
#define CFG_TUD_MIDI (0)
|
||||
#define CFG_TUD_VENDOR (0)
|
||||
|
||||
#define CFG_TUD_CDC_RX_BUFSIZE (256)
|
||||
|
||||
+32
-13
@@ -32,7 +32,7 @@ def BuildDebugLevel(name):
|
||||
print("%s.menu.dbglvl.%s.build.debug_level=%s" % (name, l[0], l[1]))
|
||||
|
||||
def BuildFreq(name):
|
||||
for f in [ 133, 50, 100, 125, 150, 175, 200, 225, 250, 275, 300]:
|
||||
for f in [ 133, 50, 100, 120, 125, 150, 175, 200, 225, 240, 250, 275, 300]:
|
||||
warn = ""
|
||||
if f > 133: warn = " (Overclock)"
|
||||
print("%s.menu.freq.%s=%s MHz%s" % (name, f, f, warn))
|
||||
@@ -50,6 +50,20 @@ def BuildRTTI(name):
|
||||
print("%s.menu.rtti.Enabled=Enabled" % (name))
|
||||
print("%s.menu.rtti.Enabled.build.flags.rtti=" % (name))
|
||||
|
||||
def BuildStackProtect(name):
|
||||
print("%s.menu.stackprotect.Disabled=Disabled" % (name))
|
||||
print("%s.menu.stackprotect.Disabled.build.flags.stackprotect=" % (name))
|
||||
print("%s.menu.stackprotect.Enabled=Enabled" % (name))
|
||||
print("%s.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector" % (name))
|
||||
|
||||
def BuildExceptions(name):
|
||||
print("%s.menu.exceptions.Disabled=Disabled" % (name))
|
||||
print("%s.menu.exceptions.Disabled.build.flags.exceptions=-fno-exceptions" % (name))
|
||||
print("%s.menu.exceptions.Disabled.build.flags.libstdcpp=-lstdc++" % (name))
|
||||
print("%s.menu.exceptions.Enabled=Enabled" % (name))
|
||||
print("%s.menu.exceptions.Enabled.build.flags.exceptions=-fexceptions" % (name))
|
||||
print("%s.menu.exceptions.Enabled.build.flags.libstdcpp=-lstdc++-exc" % (name))
|
||||
|
||||
def BuildBoot(name):
|
||||
for l in [ ("Generic SPI /2", "boot2_generic_03h_2_padded_checksum"), ("Generic SPI /4", "boot2_generic_03h_4_padded_checksum"),
|
||||
("IS25LP080 QSPI /2", "boot2_is25lp080_2_padded_checksum"), ("IS25LP080 QSPI /4", "boot2_is25lp080_4_padded_checksum"),
|
||||
@@ -112,6 +126,8 @@ def BuildGlobalMenuList():
|
||||
print("menu.freq=CPU Speed")
|
||||
print("menu.opt=Optimize")
|
||||
print("menu.rtti=RTTI")
|
||||
print("menu.stackprotect=Stack Protector")
|
||||
print("menu.exceptions=C++ Exceptions")
|
||||
print("menu.dbgport=Debug Port")
|
||||
print("menu.dbglvl=Debug Level")
|
||||
print("menu.boot2=Boot Stage 2")
|
||||
@@ -146,6 +162,8 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flash
|
||||
BuildFreq(n)
|
||||
BuildOptimize(n)
|
||||
BuildRTTI(n)
|
||||
BuildStackProtect(n)
|
||||
BuildExceptions(n)
|
||||
BuildDebugPort(n)
|
||||
BuildDebugLevel(n)
|
||||
if a == "picodebug":
|
||||
@@ -159,6 +177,13 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flash
|
||||
def MakeBoardJSON(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flashsizemb, boot2):
|
||||
json = """{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"boot2_source": "BOOT2.S",
|
||||
"usb_vid": "VID",
|
||||
"usb_pid": "PID"
|
||||
}
|
||||
},
|
||||
"core": "earlephilhower",
|
||||
"cpu": "cortex-m0plus",
|
||||
"extra_flags": "-D ARDUINO_BOARDDEFINE -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=USBPWR",
|
||||
@@ -170,16 +195,7 @@ def MakeBoardJSON(name, vendor_name, product_name, vid, pid, pwr, boarddefine, f
|
||||
]
|
||||
],
|
||||
"mcu": "rp2040",
|
||||
"arduino": {
|
||||
"earlephilhower": {
|
||||
"variant": "VARIANTNAME",
|
||||
"boot2_source": "BOOT2.S",
|
||||
"usb_vid": "VID",
|
||||
"usb_pid": "PID",
|
||||
"usb_manufacturer": "VENDORNAME",
|
||||
"usb_product": "PRODUCTNAME"
|
||||
}
|
||||
}
|
||||
"variant": "VARIANTNAME"
|
||||
},
|
||||
"debug": {
|
||||
"jlink_device": "RP2040_M0_0",
|
||||
@@ -208,7 +224,7 @@ def MakeBoardJSON(name, vendor_name, product_name, vid, pid, pwr, boarddefine, f
|
||||
},
|
||||
"url": "https://www.raspberrypi.org/products/raspberry-pi-pico/",
|
||||
"vendor": "VENDORNAME"
|
||||
}""".replace('VARIANTNAME', name).replace('BOARDDEFINE', boarddefine).replace('BOOT2', boot2).replace('VID', vid).replace('PID', pid).replace('VENDORNAME', vendor_name).replace('PRODUCTNAME', product_name).replace('FLASHSIZE', str(1024*1024*flashsizemb)).replace('USBPWR', str(pwr))
|
||||
}\n""".replace('VARIANTNAME', name).replace('BOARDDEFINE', boarddefine).replace('BOOT2', boot2).replace('VID', vid).replace('PID', pid).replace('VENDORNAME', vendor_name).replace('PRODUCTNAME', product_name).replace('FLASHSIZE', str(1024*1024*flashsizemb)).replace('USBPWR', str(pwr))
|
||||
jsondir = os.path.abspath(os.path.dirname(__file__)) + "/json"
|
||||
f = open(jsondir + "/" + name + ".json", "w")
|
||||
f.write(json)
|
||||
@@ -251,6 +267,7 @@ MakeBoard("dfrobot_beetle_rp2040", "DFRobot", "Beetle RP2040", "0x3343", "0x4253
|
||||
MakeBoard("challenger_2040_lora", "iLabs", "Challenger 2040 LoRa", "0x2e8a", "0x1023", 250, "CHALLENGER_2040_LORA_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("challenger_2040_wifi", "iLabs", "Challenger 2040 WiFi", "0x2e8a", "0x1006", 250, "CHALLENGER_2040_WIFI_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("challenger_2040_lte", "iLabs", "Challenger 2040 LTE", "0x2e8a", "0x100b", 500, "CHALLENGER_2040_LTE_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("challenger_2040_wifi_ble", "iLabs", "Challenger 2040 WiFi/BLE", "0x2e8a", "0x102C", 500, "CHALLENGER_2040_WIFI_BLE_RP2040", 8, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("challenger_nb_2040_wifi", "iLabs", "Challenger NB 2040 WiFi", "0x2e8a", "0x100b", 500, "CHALLENGER_NB_2040_WIFI_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")
|
||||
|
||||
@@ -271,7 +288,9 @@ MakeBoard("upesy_rp2040_devkit", "uPesy", "RP2040 DevKit", "0x2e8a", "0x1007", 2
|
||||
MakeBoard("seeed_xiao_rp2040", "Seeed", "XAIO RP2040", "0x2e8a", "0x000a", 250, "SEEED_XAIO_RP2040", 2, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
# WIZnet
|
||||
MakeBoard("wiznet_5100s_evb_pico", "WIZnet", "W5100S-EVB-Pico", "0x2e8a", "0x1008", 250, "WIZNET_5100S_EVB_PICO", 2, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("wiznet_5100s_evb_pico", "WIZnet", "W5100S-EVB-Pico", "0x2e8a", "0x1027", 250, "WIZNET_5100S_EVB_PICO", 2, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("wiznet_wizfi360_evb_pico", "WIZnet", "WizFi360-EVB-Pico", "0x2e8a", "0x1028", 250, "WIZNET_WIZFI360_EVB_PICO", 2, "boot2_w25q080_2_padded_checksum")
|
||||
MakeBoard("wiznet_5500_evb_pico", "WIZnet", "W5500-EVB-Pico", "0x2e8a", "0x1029", 250, "WIZNET_5500_EVB_PICO", 2, "boot2_w25q080_2_padded_checksum")
|
||||
|
||||
# Generic
|
||||
MakeBoard("generic", "Generic", "RP2040", "0x2e8a", "0xf00a", 250, "GENERIC_RP2040", 16, "boot2_generic_03h_4_padded_checksum")
|
||||
|
||||
@@ -27,6 +27,53 @@ ram_size = 256 * 1024 # not the 264K, which is 256K SRAM + 2*4K SCRATCH(X/Y).
|
||||
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinopico")
|
||||
assert os.path.isdir(FRAMEWORK_DIR)
|
||||
|
||||
# read includes from this file to add them into CPPPATH later for good IDE intellisense
|
||||
# will use original -iprefix <prefix> @<file> for compilation though.
|
||||
includes_file = os.path.join(FRAMEWORK_DIR, "lib", "platform_inc.txt")
|
||||
file_lines = []
|
||||
includes = []
|
||||
with open(includes_file, "r") as fp:
|
||||
file_lines = fp.readlines()
|
||||
for l in file_lines:
|
||||
path = l.strip().replace("-iwithprefixbefore/", "").replace("/", os.sep)
|
||||
# emulate -iprefix <framework path>.
|
||||
path = os.path.join(FRAMEWORK_DIR, path)
|
||||
# prevent non-existent paths from being added
|
||||
if os.path.isdir(path):
|
||||
includes.append(path)
|
||||
|
||||
def is_pio_build():
|
||||
from SCons.Script import COMMAND_LINE_TARGETS
|
||||
return "idedata" not in COMMAND_LINE_TARGETS and "_idedata" not in COMMAND_LINE_TARGETS
|
||||
|
||||
# get all activated macros
|
||||
flatten_cppdefines = env.Flatten(env['CPPDEFINES'])
|
||||
|
||||
#
|
||||
# Exceptions
|
||||
#
|
||||
stdcpp_lib = None
|
||||
if "PIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS" in flatten_cppdefines:
|
||||
env.Append(
|
||||
CXXFLAGS=["-fexceptions"]
|
||||
)
|
||||
stdcpp_lib = "stdc++-exc"
|
||||
else:
|
||||
env.Append(
|
||||
CXXFLAGS=["-fno-exceptions"]
|
||||
)
|
||||
stdcpp_lib = "stdc++"
|
||||
|
||||
#
|
||||
# RTTI
|
||||
#
|
||||
# standard is -fno-rtti flag. If special macro is present, don't
|
||||
# add that flag.
|
||||
if not "PIO_FRAMEWORK_ARDUINO_ENABLE_RTTI" in flatten_cppdefines:
|
||||
env.Append(
|
||||
CXXFLAGS=["-fno-rtti"]
|
||||
)
|
||||
|
||||
# update progsize expression to also check for bootloader.
|
||||
env.Replace(
|
||||
SIZEPROGREGEXP=r"^(?:\.boot2|\.text|\.data|\.rodata|\.text.align|\.ARM.exidx)\s+(\d+).*"
|
||||
@@ -36,14 +83,14 @@ env.Append(
|
||||
ASFLAGS=env.get("CCFLAGS", [])[:],
|
||||
|
||||
CCFLAGS=[
|
||||
"-Os", # Optimize for size by default
|
||||
"-Werror=return-type",
|
||||
"-march=armv6-m",
|
||||
"-mcpu=cortex-m0plus",
|
||||
"-mthumb",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-iprefix" + os.path.join(FRAMEWORK_DIR),
|
||||
"@%s" % os.path.join(FRAMEWORK_DIR, "lib", "platform_inc.txt")
|
||||
"-fdata-sections"
|
||||
# -iprefix etc. added lader if in build mode
|
||||
],
|
||||
|
||||
CFLAGS=[
|
||||
@@ -52,8 +99,6 @@ env.Append(
|
||||
|
||||
CXXFLAGS=[
|
||||
"-std=gnu++17",
|
||||
"-fno-exceptions",
|
||||
"-fno-rtti",
|
||||
],
|
||||
|
||||
CPPDEFINES=[
|
||||
@@ -96,9 +141,18 @@ env.Append(
|
||||
# link lib/libpico.a by full path, ignore libstdc++
|
||||
LIBS=[
|
||||
File(os.path.join(FRAMEWORK_DIR, "lib", "libpico.a")),
|
||||
"m", "c", "stdc++", "c"]
|
||||
"m", "c", stdcpp_lib, "c"]
|
||||
)
|
||||
|
||||
# expand with read includes for IDE, but use -iprefix command for actual building
|
||||
if not is_pio_build():
|
||||
env.Append(CPPPATH=includes)
|
||||
else:
|
||||
env.Append(CCFLAGS=[
|
||||
"-iprefix" + os.path.join(FRAMEWORK_DIR),
|
||||
"@%s" % os.path.join(FRAMEWORK_DIR, "lib", "platform_inc.txt")
|
||||
])
|
||||
|
||||
|
||||
def configure_usb_flags(cpp_defines):
|
||||
global ram_size
|
||||
@@ -204,8 +258,8 @@ linkerscript_cmd = env.Command(
|
||||
|
||||
# if no custom linker script is provided, we use the command that we prepared to generate one.
|
||||
if not board.get("build.ldscript", ""):
|
||||
# execute fetch filesystem info stored in env to alawys have that info ready
|
||||
env["fetch_fs_size"](env)
|
||||
# execute fetch filesystem info stored in env to always have that info ready
|
||||
env["__fetch_fs_size"](env)
|
||||
env.Depends("$BUILD_DIR/${PROGNAME}.elf", linkerscript_cmd)
|
||||
env.Replace(LDSCRIPT_PATH=os.path.join("$BUILD_DIR", "memmap_default.ld"))
|
||||
|
||||
|
||||
+21
-30
@@ -262,6 +262,21 @@ def get_drives():
|
||||
for d in os.listdir(rootpath):
|
||||
drives.append(os.path.join(rootpath, d))
|
||||
|
||||
if (len(drives) == 0) and (sys.platform == "linux"):
|
||||
globexpr = "/dev/disk/by-id/usb-RPI_RP2*-part1"
|
||||
rpidisk = glob.glob(globexpr)
|
||||
if len(rpidisk) > 0:
|
||||
try:
|
||||
cmd = ["udisksctl", "mount", "--block-device", os.path.realpath(rpidisk[0])]
|
||||
proc_out = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
if proc_out.returncode == 0:
|
||||
stdoutput = proc_out.stdout.decode("UTF-8")
|
||||
match = re.search(r'Mounted\s+.*\s+at\s+([^\.\r\n]*)', stdoutput)
|
||||
if match:
|
||||
drives = [match.group(1)]
|
||||
except Exception as ex:
|
||||
print("Exception executing udisksctl. Exception: {}".format(ex))
|
||||
# If it fails, no problem since it was a heroic attempt
|
||||
|
||||
def has_info(d):
|
||||
try:
|
||||
@@ -335,9 +350,7 @@ def main():
|
||||
ser = serial.Serial(args.serial, 1200)
|
||||
ser.dtr = False
|
||||
except:
|
||||
print("Caught exception during reset!")
|
||||
# Probably should be smart and check for device appearance or something
|
||||
time.sleep(10)
|
||||
pass # Ignore error in the case it is already in upload mode
|
||||
except:
|
||||
pass
|
||||
if args.list:
|
||||
@@ -368,33 +381,11 @@ def main():
|
||||
if args.output == None:
|
||||
args.output = "flash." + ext
|
||||
else:
|
||||
drives = get_drives()
|
||||
if (len(drives) == 0) and (sys.platform == "linux"):
|
||||
globexpr = "/dev/disk/by-id/usb-RPI_RP2*-part1"
|
||||
rpidisk = glob.glob(globexpr)
|
||||
if len(rpidisk) == 0:
|
||||
print("Unable to find disk by ID using expression: {}".format(globexpr))
|
||||
else:
|
||||
try:
|
||||
cmd = ["udisksctl", "mount", "--block-device", os.path.realpath(rpidisk[0])]
|
||||
proc_out = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
if proc_out.returncode == 0:
|
||||
stdoutput = proc_out.stdout.decode("UTF-8")
|
||||
match = re.search(r'Mounted\s+.*\s+at\s+([^\.\r\n]*)', stdoutput)
|
||||
if match is None:
|
||||
print("Warn: {} did not print mount point. Attempting to locate mounted drive in file system. StdOut={}".format(cmd[0], stdoutput))
|
||||
drives = get_drives()
|
||||
else:
|
||||
drives = [match.group(1)]
|
||||
else:
|
||||
print("Error executing command {}. Return Code: {} Std Output: {} StdError: {}".format(" ".join(cmd),
|
||||
proc_out.returncode,
|
||||
proc_out.stdout.decode("UTF-8"),
|
||||
proc_out.stderr.decode("UTF-8")))
|
||||
|
||||
except Exception as ex:
|
||||
print("Exception executing udisksctl. Exception: {}".format(ex))
|
||||
# If it fails, no problem since it was a heroic attempt
|
||||
now = time.time()
|
||||
drives = []
|
||||
while (time.time() - now < 10.0) and (len(drives) == 0):
|
||||
time.sleep(0.5) # Avoid 100% CPU use while waiting for drive to appear
|
||||
drives = get_drives()
|
||||
|
||||
if args.output:
|
||||
write_file(args.output, outbuf)
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
#define PIN_NEOPIXEL (12u)
|
||||
#define NEOPIXEL_POWER (11u)
|
||||
|
||||
// Serial1 not pinned out
|
||||
#define PIN_SERIAL1_TX (31u)
|
||||
#define PIN_SERIAL1_RX (31u)
|
||||
// Serial1
|
||||
#define PIN_SERIAL1_TX (28u) // marked A1 on the Board
|
||||
#define PIN_SERIAL1_RX (29u) // marked A0 on the Board
|
||||
|
||||
// Serial2 is the only one labelled
|
||||
#define PIN_SERIAL2_TX (20u)
|
||||
#define PIN_SERIAL2_RX (5u)
|
||||
// Serial2
|
||||
#define PIN_SERIAL2_TX (20u) // marked TX on the Board
|
||||
#define PIN_SERIAL2_RX (5u) // marked RX on the Board
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (4u)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
ESP8285 helper class for the Challenger RP2040 WiFi boards
|
||||
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
|
||||
|
||||
Copyright (c) 2021 P. Oldberg <pontus@ilabs.se>
|
||||
Copyright (c) 2021,2022 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
|
||||
@@ -21,31 +21,33 @@
|
||||
#include <Arduino.h>
|
||||
#include <ChallengerWiFi.h>
|
||||
|
||||
Challenger2040WiFiClass::Challenger2040WiFiClass() {
|
||||
pinMode(PIN_ESP8285_RST, OUTPUT);
|
||||
digitalWrite(PIN_ESP8285_RST, LOW); // Hold ESP8285 in reset
|
||||
pinMode(PIN_ESP8285_MODE, OUTPUT);
|
||||
digitalWrite(PIN_ESP8285_MODE, HIGH); // Prepare for normal start
|
||||
Challenger2040WiFiClass::Challenger2040WiFiClass(HardwareSerial* serial) {
|
||||
_serial = 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
|
||||
}
|
||||
|
||||
// Do a HW reset by applying a low pulse to the reset line for 1mSec
|
||||
void Challenger2040WiFiClass::doHWReset() {
|
||||
digitalWrite(PIN_ESP8285_RST, LOW); // Hold ESP8285 in reset
|
||||
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
|
||||
delay(1);
|
||||
digitalWrite(PIN_ESP8285_RST, HIGH); // Release ESP8285 reset
|
||||
digitalWrite(PIN_ESP_RST, HIGH); // Release ESP reset
|
||||
}
|
||||
|
||||
// Set the mode flag high to indicate normal run operation and do a HW
|
||||
// reset.
|
||||
void Challenger2040WiFiClass::runReset() { // Prepare ESP8285 for normal op
|
||||
digitalWrite(PIN_ESP8285_MODE, HIGH); // Prepare for normal start
|
||||
void Challenger2040WiFiClass::runReset() { // Prepare ESP for normal op
|
||||
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
|
||||
doHWReset();
|
||||
}
|
||||
|
||||
// Set the mode flag low to indicate flash operation and do a HW
|
||||
// reset.
|
||||
void Challenger2040WiFiClass::flashReset() { // Prepare ESP8285 for flashing
|
||||
digitalWrite(PIN_ESP8285_MODE, LOW); // Prepare for normal start
|
||||
void Challenger2040WiFiClass::flashReset() { // Prepare ESP for flashing
|
||||
digitalWrite(PIN_ESP_MODE, LOW); // Prepare for normal start
|
||||
doHWReset();
|
||||
}
|
||||
|
||||
@@ -55,53 +57,82 @@ void Challenger2040WiFiClass::flashReset() { // Prepare ESP8285 for flashing
|
||||
bool Challenger2040WiFiClass::waitForReady() {
|
||||
int timeout = 20; // Aprox max 2 sec
|
||||
|
||||
Serial2.begin(DEFAULT_ESP8285_BAUDRATE);
|
||||
Serial2.setTimeout(100);
|
||||
String rdy = Serial2.readStringUntil('\n');
|
||||
_serial->setTimeout(100);
|
||||
String rdy = _serial->readStringUntil('\n');
|
||||
while(!rdy.startsWith("ready") && timeout--) {
|
||||
rdy = Serial2.readStringUntil('\n');
|
||||
rdy = _serial->readStringUntil('\n');
|
||||
}
|
||||
Serial2.setTimeout(1000); // Reset default timeout to 1000
|
||||
_serial->setTimeout(1000); // Reset default timeout to 1000
|
||||
if (timeout)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the ESP8285 and wait for the "ready" prompt to be returned.
|
||||
// Reset the ESP and wait for the "ready" prompt to be returned.
|
||||
bool Challenger2040WiFiClass::reset() {
|
||||
runReset();
|
||||
_serial->begin(DEFAULT_ESP_BAUDRATE);
|
||||
return waitForReady();
|
||||
}
|
||||
|
||||
// Checks to see if the modem responds to the "AT" poll command.
|
||||
bool Challenger2040WiFiClass::isAlive() {
|
||||
int timeout = 5;
|
||||
int timeout = 100;
|
||||
|
||||
Serial2.setTimeout(250);
|
||||
Serial2.println(F("AT"));
|
||||
String rdy = Serial2.readStringUntil('\n');
|
||||
_serial->setTimeout(250);
|
||||
_serial->println(F("AT"));
|
||||
String rdy = _serial->readStringUntil('\n');
|
||||
while(!rdy.startsWith(F("OK")) && timeout--) {
|
||||
rdy = Serial2.readStringUntil('\n');
|
||||
_serial->println(F("AT"));
|
||||
rdy = _serial->readStringUntil('\n');
|
||||
}
|
||||
Serial2.setTimeout(1000);
|
||||
_serial->setTimeout(1000);
|
||||
|
||||
if (timeout)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Change the baud rate of the ESP8285 as well as the local UART.
|
||||
// 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 ESP8285 is
|
||||
// baud rates are valid. The function ends by checking if the ESP is
|
||||
// reachable by doing an "AT" poll.
|
||||
bool Challenger2040WiFiClass::changeBaudRate(int baud) {
|
||||
Serial2.print(F("AT+UART_CUR="));
|
||||
Serial2.print(baud);
|
||||
Serial2.println(F(",8,1,0,0"));
|
||||
_serial->print(F("AT+UART_CUR="));
|
||||
_serial->print(baud);
|
||||
_serial->println(F(",8,1,0,0"));
|
||||
delay(100);
|
||||
Serial2.end();
|
||||
Serial2.begin(baud);
|
||||
_serial->end();
|
||||
_serial->begin(baud);
|
||||
return isAlive();
|
||||
}
|
||||
|
||||
// This method should be called id the builtin object isn't needed any more
|
||||
// It basically just releases the UART pins for other use.
|
||||
void Challenger2040WiFiClass::release() {
|
||||
_serial->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 Challenger2040WiFiClass::setSerial(HardwareSerial* serial) {
|
||||
|
||||
release();
|
||||
_serial = 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* Challenger2040WiFiClass::getSerial() {
|
||||
return _serial;
|
||||
}
|
||||
|
||||
Challenger2040WiFiClass Challenger2040WiFi;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
ESP8285 helper class for the Challenger RP2040 WiFi boards
|
||||
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
|
||||
|
||||
Copyright (c) 2021 P. Oldberg <pontus@ilabs.se>
|
||||
Copyright (c) 2021,2022 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
|
||||
@@ -17,20 +17,27 @@
|
||||
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_ESP8285_BAUDRATE 115200
|
||||
#define DEFAULT_ESP8285_BAUDRATE 115200
|
||||
#define DEFAULT_ESP_BAUDRATE DEFAULT_ESP8285_BAUDRATE
|
||||
|
||||
class Challenger2040WiFiClass {
|
||||
public:
|
||||
Challenger2040WiFiClass();
|
||||
Challenger2040WiFiClass(HardwareSerial* = &ESP_SERIAL_PORT);
|
||||
void doHWReset();
|
||||
void runReset();
|
||||
void flashReset();
|
||||
bool waitForReady();
|
||||
bool reset();
|
||||
bool isAlive();
|
||||
bool changeBaudRate(int baud);
|
||||
bool changeBaudRate(int);
|
||||
void release();
|
||||
void setSerial(HardwareSerial*);
|
||||
HardwareSerial* getSerial();
|
||||
private:
|
||||
HardwareSerial* _serial;
|
||||
};
|
||||
|
||||
extern Challenger2040WiFiClass Challenger2040WiFi;
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
#define PIN_SERIAL2_RX (5u)
|
||||
#define PIN_ESP8285_RST (19u)
|
||||
#define PIN_ESP8285_MODE (13u)
|
||||
#define ESP8285_SERIAL Serial2
|
||||
// Uart define esp serial abstraction pins
|
||||
#define PIN_ESP_TX PIN_SERIAL2_TX
|
||||
#define PIN_ESP_RX PIN_SERIAL2_RX
|
||||
#define PIN_ESP_RST PIN_ESP8285_RST
|
||||
#define PIN_ESP_MODE PIN_ESP8285_MODE
|
||||
#define ESP_SERIAL_PORT ESP8285_SERIAL
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (24u)
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
|
||||
|
||||
Copyright (c) 2021,2022 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 <ChallengerWiFi.h>
|
||||
|
||||
Challenger2040WiFiClass::Challenger2040WiFiClass(HardwareSerial* serial) {
|
||||
_serial = 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
|
||||
}
|
||||
|
||||
// Do a HW reset by applying a low pulse to the reset line for 1mSec
|
||||
void Challenger2040WiFiClass::doHWReset() {
|
||||
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 Challenger2040WiFiClass::runReset() { // Prepare ESP for normal op
|
||||
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
|
||||
doHWReset();
|
||||
}
|
||||
|
||||
// Set the mode flag low to indicate flash operation and do a HW
|
||||
// reset.
|
||||
void Challenger2040WiFiClass::flashReset() { // Prepare ESP for flashing
|
||||
digitalWrite(PIN_ESP_MODE, LOW); // Prepare for normal start
|
||||
doHWReset();
|
||||
}
|
||||
|
||||
// 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 Challenger2040WiFiClass::waitForReady() {
|
||||
int timeout = 20; // Aprox max 2 sec
|
||||
|
||||
_serial->setTimeout(100);
|
||||
String rdy = _serial->readStringUntil('\n');
|
||||
while(!rdy.startsWith("ready") && timeout--) {
|
||||
rdy = _serial->readStringUntil('\n');
|
||||
}
|
||||
_serial->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 Challenger2040WiFiClass::reset() {
|
||||
runReset();
|
||||
_serial->begin(DEFAULT_ESP_BAUDRATE);
|
||||
return waitForReady();
|
||||
}
|
||||
|
||||
// Checks to see if the modem responds to the "AT" poll command.
|
||||
bool Challenger2040WiFiClass::isAlive() {
|
||||
int timeout = 100;
|
||||
|
||||
_serial->setTimeout(250);
|
||||
_serial->println(F("AT"));
|
||||
String rdy = _serial->readStringUntil('\n');
|
||||
while(!rdy.startsWith(F("OK")) && timeout--) {
|
||||
_serial->println(F("AT"));
|
||||
rdy = _serial->readStringUntil('\n');
|
||||
}
|
||||
_serial->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 Challenger2040WiFiClass::changeBaudRate(int baud) {
|
||||
_serial->print(F("AT+UART_CUR="));
|
||||
_serial->print(baud);
|
||||
_serial->println(F(",8,1,0,0"));
|
||||
delay(100);
|
||||
_serial->end();
|
||||
_serial->begin(baud);
|
||||
return isAlive();
|
||||
}
|
||||
|
||||
// This method should be called id the builtin object isn't needed any more
|
||||
// It basically just releases the UART pins for other use.
|
||||
void Challenger2040WiFiClass::release() {
|
||||
_serial->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 Challenger2040WiFiClass::setSerial(HardwareSerial* serial) {
|
||||
|
||||
release();
|
||||
_serial = 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* Challenger2040WiFiClass::getSerial() {
|
||||
return _serial;
|
||||
}
|
||||
|
||||
Challenger2040WiFiClass Challenger2040WiFi;
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
|
||||
|
||||
Copyright (c) 2021,2022 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_ESP32_BAUDRATE 115200
|
||||
#define DEFAULT_ESP_BAUDRATE DEFAULT_ESP32_BAUDRATE
|
||||
|
||||
class Challenger2040WiFiClass {
|
||||
public:
|
||||
Challenger2040WiFiClass(HardwareSerial* = &ESP_SERIAL_PORT);
|
||||
void doHWReset();
|
||||
void runReset();
|
||||
void flashReset();
|
||||
bool waitForReady();
|
||||
bool reset();
|
||||
bool isAlive();
|
||||
bool changeBaudRate(int);
|
||||
void release();
|
||||
void setSerial(HardwareSerial*);
|
||||
HardwareSerial* getSerial();
|
||||
private:
|
||||
HardwareSerial* _serial;
|
||||
};
|
||||
|
||||
extern Challenger2040WiFiClass Challenger2040WiFi;
|
||||
@@ -0,0 +1,87 @@
|
||||
#pragma once
|
||||
|
||||
#define PINS_COUNT (24u)
|
||||
#define NUM_DIGITAL_PINS (24u)
|
||||
#define NUM_ANALOG_INPUTS (4u)
|
||||
#define NUM_ANALOG_OUTPUTS (0u)
|
||||
#define ADC_RESOLUTION (12u)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED (10u)
|
||||
|
||||
// Board serial port (Uart0)
|
||||
#define PIN_SERIAL1_TX (16u)
|
||||
#define PIN_SERIAL1_RX (17u)
|
||||
|
||||
// Uart connected to ESP32C3 (Uart1)
|
||||
#define PIN_SERIAL2_TX (4u)
|
||||
#define PIN_SERIAL2_RX (5u)
|
||||
#define PIN_ESP32_RST (19u)
|
||||
#define PIN_ESP32_MODE (24u)
|
||||
#define ESP32_SERIAL Serial2
|
||||
// Uart define esp serial abstraction pins
|
||||
#define PIN_ESP_TX PIN_SERIAL2_TX
|
||||
#define PIN_ESP_RX PIN_SERIAL2_RX
|
||||
#define PIN_ESP_RST PIN_ESP32_RST
|
||||
#define PIN_ESP_MODE PIN_ESP32_MODE
|
||||
#define ESP_SERIAL_PORT ESP32_SERIAL
|
||||
|
||||
// SPI
|
||||
#define PIN_SPI0_MISO (24u)
|
||||
#define PIN_SPI0_MOSI (23u)
|
||||
#define PIN_SPI0_SCK (22u)
|
||||
#define PIN_SPI0_SS (21u)
|
||||
|
||||
// SPI connected to ESP32C3
|
||||
#define PIN_SPI1_MISO (12u)
|
||||
#define PIN_SPI1_MOSI (15u)
|
||||
#define PIN_SPI1_SCK (14u)
|
||||
#define PIN_SPI1_SS (13u)
|
||||
// Handshake signal from ESP32C3
|
||||
#define ESP32_HS (18u)
|
||||
#define ESP32_SPI SPI1
|
||||
|
||||
// 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 (2u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
#define LED_BUILTIN PIN_LED
|
||||
#define NEOPIXEL (11u)
|
||||
|
||||
static const uint8_t D0 = (16u);
|
||||
static const uint8_t D1 = (17u);
|
||||
static const uint8_t D2 = (20u);
|
||||
static const uint8_t D3 = (23u);
|
||||
static const uint8_t D4 = (22u);
|
||||
static const uint8_t D5 = (2u);
|
||||
static const uint8_t D6 = (3u);
|
||||
static const uint8_t D7 = (0u);
|
||||
static const uint8_t D8 = (1u);
|
||||
static const uint8_t D9 = (6u);
|
||||
static const uint8_t D10 = (7u);
|
||||
static const uint8_t D11 = (8u);
|
||||
static const uint8_t D12 = (9u);
|
||||
static const uint8_t D13 = (10u);
|
||||
static const uint8_t D14 = (11u);
|
||||
static const uint8_t D15 = (12u);
|
||||
static const uint8_t D16 = (13u);
|
||||
static const uint8_t D17 = (14u);
|
||||
static const uint8_t D18 = (15u);
|
||||
static const uint8_t D19 = (18u);
|
||||
static const uint8_t D20 = (19u);
|
||||
static const uint8_t D21 = (24u);
|
||||
|
||||
static const uint8_t A0 = (26u);
|
||||
static const uint8_t A1 = (27u);
|
||||
static const uint8_t A2 = (28u);
|
||||
static const uint8_t A3 = (29u);
|
||||
static const uint8_t A4 = (25u);
|
||||
static const uint8_t A5 = (21u);
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
ESP8285 helper class for the Challenger RP2040 WiFi boards
|
||||
ESP8285/ESP32C3 helper class for the Challenger RP2040 WiFi enabled boards
|
||||
|
||||
Copyright (c) 2021 P. Oldberg <pontus@ilabs.se>
|
||||
Copyright (c) 2021,2022 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
|
||||
@@ -21,31 +21,33 @@
|
||||
#include <Arduino.h>
|
||||
#include <ChallengerWiFi.h>
|
||||
|
||||
Challenger2040WiFiClass::Challenger2040WiFiClass() {
|
||||
pinMode(PIN_ESP8285_RST, OUTPUT);
|
||||
digitalWrite(PIN_ESP8285_RST, LOW); // Hold ESP8285 in reset
|
||||
pinMode(PIN_ESP8285_MODE, OUTPUT);
|
||||
digitalWrite(PIN_ESP8285_MODE, HIGH); // Prepare for normal start
|
||||
Challenger2040WiFiClass::Challenger2040WiFiClass(HardwareSerial* serial) {
|
||||
_serial = 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
|
||||
}
|
||||
|
||||
// Do a HW reset by applying a low pulse to the reset line for 1mSec
|
||||
void Challenger2040WiFiClass::doHWReset() {
|
||||
digitalWrite(PIN_ESP8285_RST, LOW); // Hold ESP8285 in reset
|
||||
digitalWrite(PIN_ESP_RST, LOW); // Hold ESP in reset
|
||||
delay(1);
|
||||
digitalWrite(PIN_ESP8285_RST, HIGH); // Release ESP8285 reset
|
||||
digitalWrite(PIN_ESP_RST, HIGH); // Release ESP reset
|
||||
}
|
||||
|
||||
// Set the mode flag high to indicate normal run operation and do a HW
|
||||
// reset.
|
||||
void Challenger2040WiFiClass::runReset() { // Prepare ESP8285 for normal op
|
||||
digitalWrite(PIN_ESP8285_MODE, HIGH); // Prepare for normal start
|
||||
void Challenger2040WiFiClass::runReset() { // Prepare ESP for normal op
|
||||
digitalWrite(PIN_ESP_MODE, HIGH); // Prepare for normal start
|
||||
doHWReset();
|
||||
}
|
||||
|
||||
// Set the mode flag low to indicate flash operation and do a HW
|
||||
// reset.
|
||||
void Challenger2040WiFiClass::flashReset() { // Prepare ESP8285 for flashing
|
||||
digitalWrite(PIN_ESP8285_MODE, LOW); // Prepare for normal start
|
||||
void Challenger2040WiFiClass::flashReset() { // Prepare ESP for flashing
|
||||
digitalWrite(PIN_ESP_MODE, LOW); // Prepare for normal start
|
||||
doHWReset();
|
||||
}
|
||||
|
||||
@@ -55,53 +57,82 @@ void Challenger2040WiFiClass::flashReset() { // Prepare ESP8285 for flashing
|
||||
bool Challenger2040WiFiClass::waitForReady() {
|
||||
int timeout = 20; // Aprox max 2 sec
|
||||
|
||||
Serial2.begin(DEFAULT_ESP8285_BAUDRATE);
|
||||
Serial2.setTimeout(100);
|
||||
String rdy = Serial2.readStringUntil('\n');
|
||||
_serial->setTimeout(100);
|
||||
String rdy = _serial->readStringUntil('\n');
|
||||
while(!rdy.startsWith("ready") && timeout--) {
|
||||
rdy = Serial2.readStringUntil('\n');
|
||||
rdy = _serial->readStringUntil('\n');
|
||||
}
|
||||
Serial2.setTimeout(1000); // Reset default timeout to 1000
|
||||
_serial->setTimeout(1000); // Reset default timeout to 1000
|
||||
if (timeout)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset the ESP8285 and wait for the "ready" prompt to be returned.
|
||||
// Reset the ESP and wait for the "ready" prompt to be returned.
|
||||
bool Challenger2040WiFiClass::reset() {
|
||||
runReset();
|
||||
_serial->begin(DEFAULT_ESP_BAUDRATE);
|
||||
return waitForReady();
|
||||
}
|
||||
|
||||
// Checks to see if the modem responds to the "AT" poll command.
|
||||
bool Challenger2040WiFiClass::isAlive() {
|
||||
int timeout = 5;
|
||||
int timeout = 100;
|
||||
|
||||
Serial2.setTimeout(250);
|
||||
Serial2.println(F("AT"));
|
||||
String rdy = Serial2.readStringUntil('\n');
|
||||
_serial->setTimeout(250);
|
||||
_serial->println(F("AT"));
|
||||
String rdy = _serial->readStringUntil('\n');
|
||||
while(!rdy.startsWith(F("OK")) && timeout--) {
|
||||
rdy = Serial2.readStringUntil('\n');
|
||||
_serial->println(F("AT"));
|
||||
rdy = _serial->readStringUntil('\n');
|
||||
}
|
||||
Serial2.setTimeout(1000);
|
||||
_serial->setTimeout(1000);
|
||||
|
||||
if (timeout)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Change the baud rate of the ESP8285 as well as the local UART.
|
||||
// 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 ESP8285 is
|
||||
// baud rates are valid. The function ends by checking if the ESP is
|
||||
// reachable by doing an "AT" poll.
|
||||
bool Challenger2040WiFiClass::changeBaudRate(int baud) {
|
||||
Serial2.print(F("AT+UART_CUR="));
|
||||
Serial2.print(baud);
|
||||
Serial2.println(F(",8,1,0,0"));
|
||||
_serial->print(F("AT+UART_CUR="));
|
||||
_serial->print(baud);
|
||||
_serial->println(F(",8,1,0,0"));
|
||||
delay(100);
|
||||
Serial2.end();
|
||||
Serial2.begin(baud);
|
||||
_serial->end();
|
||||
_serial->begin(baud);
|
||||
return isAlive();
|
||||
}
|
||||
|
||||
// This method should be called id the builtin object isn't needed any more
|
||||
// It basically just releases the UART pins for other use.
|
||||
void Challenger2040WiFiClass::release() {
|
||||
_serial->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 Challenger2040WiFiClass::setSerial(HardwareSerial* serial) {
|
||||
|
||||
release();
|
||||
_serial = 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* Challenger2040WiFiClass::getSerial() {
|
||||
return _serial;
|
||||
}
|
||||
|
||||
Challenger2040WiFiClass Challenger2040WiFi;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user