Skip to content

Commit

Permalink
embassy-usb support (esp-rs#1517)
Browse files Browse the repository at this point in the history
* embassy-usb support

* Add changelog entry

* Update embassy-usb-synopsys-otg

* Change VID/PID to match the blocking example

* Add missing initialisation

* Clean up

* fmt

* Remove log init

* Use released crate

* Revert to released embassy-usb

* Update vid/pid

* Remove redundant TAIT feature gate
  • Loading branch information
bugadani authored and MabezDev committed May 2, 2024
1 parent 3164bff commit d37ae69
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 70 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ESP32-PICO-V3-02: Initial support (#1155)
- `time::current_time` API (#1503)
- ESP32-S3: Add LCD_CAM Camera driver (#1483)
- `embassy-usb` support (#1517)

### Fixed

Expand Down
79 changes: 42 additions & 37 deletions esp-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,41 @@ features = ["embedded-hal", "esp32c6"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitflags = "2.5.0"
bitfield = "0.15.0"
cfg-if = "1.0.0"
critical-section = "1.1.2"
defmt = { version = "0.3.6", optional = true }
document-features = "0.2.8"
embassy-executor = { version = "0.5.0", optional = true }
embassy-futures = { version = "0.1.1", optional = true }
embassy-sync = { version = "0.5.0", optional = true }
embassy-time-driver = { version = "0.1.0", optional = true }
embedded-can = { version = "0.4.1", optional = true }
embedded-dma = "0.2.0"
embedded-hal-02 = { version = "0.2.7", optional = true, features = ["unproven"], package = "embedded-hal" }
embedded-hal = { version = "1.0.0", optional = true }
embedded-hal-async = { version = "1.0.0", optional = true }
embedded-hal-nb = { version = "1.0.0", optional = true }
embedded-io = { version = "0.6.1", optional = true }
embedded-io-async = { version = "0.6.1", optional = true }
enumset = "1.1.3"
esp-synopsys-usb-otg = { version = "0.4.1", optional = true, features = ["fs", "esp32sx"] }
fugit = "0.3.7"
log = { version = "0.4.21", optional = true }
nb = "1.1.0"
paste = "1.0.14"
portable-atomic = { version = "1.6.0", default-features = false }
procmacros = { version = "0.10.0", features = ["enum-dispatch", "interrupt", "ram"], package = "esp-hal-procmacros", path = "../esp-hal-procmacros" }
riscv = { version = "0.11.1", optional = true }
strum = { version = "0.26.2", default-features = false, features = ["derive"] }
void = { version = "1.0.2", default-features = false }
usb-device = { version = "0.3.2", optional = true }
rand_core = "0.6.4"
ufmt-write = { version = "0.1.0", optional = true }
xtensa-lx = { version = "0.9.0", optional = true }
bitflags = "2.5.0"
bitfield = "0.15.0"
cfg-if = "1.0.0"
critical-section = "1.1.2"
defmt = { version = "0.3.6", optional = true }
document-features = "0.2.8"
embassy-executor = { version = "0.5.0", optional = true }
embassy-futures = { version = "0.1.1", optional = true }
embassy-sync = { version = "0.5.0", optional = true }
embassy-time-driver = { version = "0.1.0", optional = true }
embassy-usb-driver = { version = "0.1.0", optional = true }
embassy-usb-synopsys-otg = { version = "0.1.0", optional = true }
embedded-can = { version = "0.4.1", optional = true }
embedded-dma = "0.2.0"
embedded-hal-02 = { version = "0.2.7", optional = true, features = ["unproven"], package = "embedded-hal" }
embedded-hal = { version = "1.0.0", optional = true }
embedded-hal-async = { version = "1.0.0", optional = true }
embedded-hal-nb = { version = "1.0.0", optional = true }
embedded-io = { version = "0.6.1", optional = true }
embedded-io-async = { version = "0.6.1", optional = true }
enumset = "1.1.3"
esp-synopsys-usb-otg = { version = "0.4.1", optional = true, features = ["fs", "esp32sx"] }
fugit = "0.3.7"
log = { version = "0.4.21", optional = true }
nb = "1.1.0"
paste = "1.0.14"
portable-atomic = { version = "1.6.0", default-features = false }
procmacros = { version = "0.10.0", features = ["enum-dispatch", "interrupt", "ram"], package = "esp-hal-procmacros", path = "../esp-hal-procmacros" }
riscv = { version = "0.11.1", optional = true }
strum = { version = "0.26.2", default-features = false, features = ["derive"] }
void = { version = "1.0.2", default-features = false }
usb-device = { version = "0.3.2", optional = true }
rand_core = "0.6.4"
ufmt-write = { version = "0.1.0", optional = true }
xtensa-lx = { version = "0.9.0", optional = true }

# IMPORTANT:
# Each supported device MUST have its PAC included below along with a
Expand Down Expand Up @@ -128,13 +130,16 @@ rv-init-rtc-data = ["esp-riscv-rt/init-rtc-fast-data", "esp-riscv-rt/init-rtc-fa
#! ### Trait Implementation Feature Flags
## Enable support for asynchronous operation, with interfaces provided by
## `embedded-hal-async` and `embedded-io-async`.
## Also enables `embassy-usb` support for ESP32-S2 and ESP32-S3.
async = [
"embedded-hal",
"embedded-hal-async",
"embassy-sync",
"embassy-futures",
"embedded-io",
"embedded-io-async",
"embassy-sync",
"embassy-futures",
"embassy-usb-driver",
"embassy-usb-synopsys-otg"
]
## Implement `defmt::Format` on certain types.
defmt = [
Expand Down Expand Up @@ -171,11 +176,11 @@ embassy = ["embassy-time-driver", "procmacros/embassy", "embassy-executor"]
## by the time driver.
embassy-integrated-timers = ["embassy-executor?/integrated-timers"]
## Enable the embassy time driver using the `SYSTIMER` peripheral. The
## `SYSTIMER` peripheral has three alarams available for use. Do **not**
## `SYSTIMER` peripheral has three alarams available for use. Do **not**
## use when targeting an `esp32s2`.
embassy-time-systick-16mhz = ["embassy-time-driver/tick-hz-16_000_000"]
## Enable the embassy time driver using the `SYSTIMER` peripheral. The
## `SYSTIMER` peripheral has three alarams available for use. Must only
## `SYSTIMER` peripheral has three alarams available for use. Must only
## be used when targeting an `esp32s2`.
embassy-time-systick-80mhz = ["embassy-time-driver/tick-hz-80_000_000"]
## Enable the embassy time driver using the `TIMG0` peripheral. The `TIMG0`
Expand Down
Loading

0 comments on commit d37ae69

Please sign in to comment.