-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/idf-5.2' into develop
* dev/idf-5.2: Test with rp2040, esp32s2 Ensure HID device is ready when sendReport called Lazy-initialise flush timer UsbSerial conditional on CDC Don't implement descriptor callbacks unless building for device Enable python UTF8 mode for usbconfig tool Add CI support Move initialisation code into separate Arch source file, fix for ESP32 Update to tinyusb master Revert "ESP32 broken for IDF 5.2"
- Loading branch information
Showing
21 changed files
with
239 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: CI Dispatch | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
sming_repo: | ||
description: 'Full URL for Sming repository' | ||
default: 'https://github.com/SmingHub/Sming' | ||
sming_branch: | ||
description: 'Sming branch to run against' | ||
default: 'develop' | ||
|
||
jobs: | ||
build: | ||
uses: SmingHub/Sming/.github/workflows/library.yml@develop | ||
with: | ||
sming_repo: ${{ inputs.sming_repo }} | ||
sming_branch: ${{ inputs.sming_branch }} | ||
alias: USB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: CI Push | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
uses: SmingHub/Sming/.github/workflows/library.yml@develop | ||
with: | ||
alias: USB |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/**** | ||
* USB.cpp | ||
* | ||
* Copyright 2023 mikee47 <mike@sillyhouse.net> | ||
* | ||
* This file is part of the Sming USB Library | ||
* | ||
* This library is free software: you can redistribute it and/or modify it under the terms of the | ||
* GNU General Public License as published by the Free Software Foundation, version 3 or later. | ||
* | ||
* 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this library. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @author: 2018 - Mikee47 <mike@sillyhouse.net> | ||
* | ||
****/ | ||
|
||
#include <USB.h> | ||
|
||
#include <esp_rom_gpio.h> | ||
#include <hal/gpio_ll.h> | ||
#include <soc/periph_defs.h> | ||
#include <driver/periph_ctrl.h> | ||
|
||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0) | ||
#include <soc/usb_periph.h> | ||
#include <soc/usb_reg.h> | ||
#include <hal/usb_fsls_phy_hal.h> | ||
#include <hal/usb_fsls_phy_ll.h> | ||
#else | ||
#include <hal/usb_ll.h> | ||
#endif | ||
|
||
namespace | ||
{ | ||
void configure_pins() | ||
{ | ||
for(auto iopin = usb_periph_iopins; iopin->pin >= 0; ++iopin) { | ||
if(iopin->ext_phy_only) { | ||
continue; | ||
} | ||
esp_rom_gpio_pad_select_gpio(iopin->pin); | ||
if(iopin->is_output) { | ||
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false); | ||
} else { | ||
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false); | ||
if((iopin->pin != GPIO_MATRIX_CONST_ZERO_INPUT) && (iopin->pin != GPIO_MATRIX_CONST_ONE_INPUT)) { | ||
gpio_ll_input_enable(&GPIO, gpio_num_t(iopin->pin)); | ||
} | ||
} | ||
esp_rom_gpio_pad_unhold(iopin->pin); | ||
} | ||
gpio_ll_set_drive_capability(&GPIO, gpio_num_t(USBPHY_DM_NUM), GPIO_DRIVE_CAP_3); | ||
gpio_ll_set_drive_capability(&GPIO, gpio_num_t(USBPHY_DM_NUM), GPIO_DRIVE_CAP_3); | ||
} | ||
|
||
} // namespace | ||
|
||
namespace USB | ||
{ | ||
void initHardware() | ||
{ | ||
periph_module_reset(PERIPH_USB_MODULE); | ||
periph_module_enable(PERIPH_USB_MODULE); | ||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0) | ||
usb_fsls_phy_ll_usb_wrap_pad_enable(&USB_WRAP, true); | ||
usb_fsls_phy_ll_int_otg_enable(&USB_WRAP); | ||
#else | ||
usb_ll_int_phy_enable(); | ||
#endif | ||
configure_pins(); | ||
} | ||
|
||
} // namespace USB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/**** | ||
* USB.cpp | ||
* | ||
* Copyright 2023 mikee47 <mike@sillyhouse.net> | ||
* | ||
* This file is part of the Sming USB Library | ||
* | ||
* This library is free software: you can redistribute it and/or modify it under the terms of the | ||
* GNU General Public License as published by the Free Software Foundation, version 3 or later. | ||
* | ||
* 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this library. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @author: 2018 - Mikee47 <mike@sillyhouse.net> | ||
* | ||
****/ | ||
|
||
#include <USB.h> | ||
|
||
namespace USB | ||
{ | ||
void initHardware() | ||
{ | ||
} | ||
|
||
} // namespace USB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/**** | ||
* USB.cpp | ||
* | ||
* Copyright 2023 mikee47 <mike@sillyhouse.net> | ||
* | ||
* This file is part of the Sming USB Library | ||
* | ||
* This library is free software: you can redistribute it and/or modify it under the terms of the | ||
* GNU General Public License as published by the Free Software Foundation, version 3 or later. | ||
* | ||
* 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this library. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @author: 2018 - Mikee47 <mike@sillyhouse.net> | ||
* | ||
****/ | ||
|
||
#include <USB.h> | ||
|
||
namespace USB | ||
{ | ||
void initHardware() | ||
{ | ||
} | ||
|
||
} // namespace USB |
Oops, something went wrong.