Commit Graph

431 Commits

Author SHA1 Message Date
dimpolo
ba43157c5a
enable TWAI on ESP32-S3 (#325)
* enable TWAI on ESP32-S3

* add esp32-s3 TWAI example
2023-01-03 10:02:01 -08:00
Alex Bohm
1f6803776c
Initial TWAI Driver Implementation (#192)
* wip: initial implementation of transmission only.

* Moved TWAI to its own directory and added initial reception of packets.

* Added extended id transmit and receive.

* Added maybe better code for making packet filters.

* Fixed bug with ids and improved methods of copying data to the peripheral.

* Added some guards against Bus Off

* Added reception of remote frames.

* Clean up of comments, etc

* Updated TWAI naming and cleaned up example a bit.

* Updated bitselector to include better unpacking methods.

* Add embedded-can and limit initial TWAI implementation to esp32c3.

* Added embedded-can to esp32c3 twai example.

* Switched twai filter to using bytestrings.

Co-authored-by: dimi <dimi.polonski@gmail.com>

* Implemented new() for twai filters.

* Clean up TWAI docs and example.

* Fix filter constructors and add examples.

* pre driver PeripheralRef update.

* PeripheralRef/twai

* Format comments with nightly rustfmt.

* Add gpio PeripheralRef and use volatile for direct register access.

Co-authored-by: dimi <dimi.polonski@gmail.com>
2022-12-22 00:54:06 +00:00
Scott Mabin
452fde2c12
Peripheral ref/gpio (#323)
* Implement Peripheral for all GPIO pins

* Update i2c & i2s to use the new gpio peripherals ref

* gpio pref: usb

* gpio pref: pulse control (RMT)

* gpio pref: spi

* gpio pref: uart

* gpio pref: ledc

* gpio pref: mcpwm

* fixup smartleds to use new pulse controller traits

* dump msrv

* bump rust-version in cargo tomls
2022-12-19 14:40:29 +00:00
Juraj Sadel
4598df6ed6
Peripheral ref/adc (#321)
* PeripheralRef: ADC

* PeripheralRef: DAC
2022-12-15 16:03:38 +01:00
Björn Quentin
4a780bd1f5
PeripheralRef: TIMG (#320) 2022-12-15 14:03:41 +01:00
Björn Quentin
5ebd800d0e
PeripheralRef: RTC (#319) 2022-12-15 11:21:13 +01:00
Björn Quentin
945a0d66c1
PeripheralRef: USB_OTG (#318) 2022-12-15 09:29:01 +01:00
Björn Quentin
a90aa3a2cc
PeripheralRef: DMA (#317) 2022-12-15 08:12:43 +01:00
Scott Mabin
c6a6010443
PeripheralRef: MCPWM (#314) 2022-12-14 16:42:30 +01:00
Björn Quentin
42f6f8ac4a
PeripheralRef for ClockControl (#316) 2022-12-14 15:09:46 +00:00
Juraj Sadel
ca4c573660 PeripheralRef: I2S 2022-12-14 15:09:19 +01:00
Scott Mabin
3a57eb98fe
Completely remove pac references in hal drivers (#309)
* Peripheral ref/sha (#312)

* Add SHA to list of peripherals to be created

* Refactor SHA peripheral to use PeripheralRef

* Update SHA examples to get them building again

* Fix async time drivers

* Fix usb otg

* Fix s3

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2022-12-14 13:15:45 +00:00
Jesse Braham
220f812625
Peripheral ref/sha (#312)
* Add SHA to list of peripherals to be created

* Refactor SHA peripheral to use PeripheralRef

* Update SHA examples to get them building again
2022-12-14 12:19:53 +00:00
Juraj Sadel
7817e270c2
PeripheralRef: RMT (#310) 2022-12-14 11:47:50 +00:00
Scott Mabin
a9661e68be
Peripheral ref/rng (#306) (#307)
* Add RNG to list of peripherals to be created

* Refactor RNG driver to use PeripheralRef

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2022-12-14 09:34:43 +00:00
Jesse Braham
f2b59538df
Peripheral ref/rng (#306)
* Add RNG to list of peripherals to be created

* Refactor RNG driver to use PeripheralRef
2022-12-14 09:20:01 +00:00
Björn Quentin
39c5a04d05
PeripheralRef for SYSTEM/DPORT (#305) 2022-12-14 08:40:50 +00:00
Sergio Gasquez
0774018df5 revert: ️ impl Peripheral only for USB_DEVICE 2022-12-13 17:19:11 +01:00
Sergio Gasquez
7d4cfa2070 refactor: ♻️ impl Peripheral for USB_DEVICE, USB0, and USB_WARP 2022-12-13 17:17:24 +01:00
Sergio Gasquez
76afaa3692 refactor: ♻️ PeripheralRef usb serial 2022-12-13 17:13:47 +01:00
Jesse Braham
d7babe6ef6
Peripheral ref/i2c (#303)
* Add I2C to list of peripherals to be created

* Refactor I2C driver to use PeripheralRef
2022-12-13 07:06:27 -08:00
Scott Mabin
c7f420199e
Peripheral ref/systimer (#302)
* impl Peripheral for SYSTIMER

* PeripheralRef the Systimer driver
2022-12-13 06:52:51 -08:00
bjoernQ
dc8963c0a8 Support ESP32-C2 with 26MHz Xtal 2022-12-13 05:15:10 -08:00
Scott Mabin
cfe83827cf
PeripheralRef/spi (#299)
* Add missing UART instances

* Add SPI to list of peripherals to be created

* Refactor SPI driver to use PeripheralRef
2022-12-13 00:36:18 -08:00
Scott Mabin
248fb356f8
PeripheralRef init: uart (#272)
* Add the peripheral module plus some helper macros in preparation

* peripheral macro

* Add peripheral generation macro

* Fixes after rebase

* Update the signature of Peripherals::take

* syncronise hello world example

* fmt the entire repo

Co-authored-by: Jesse Braham <jesse@beta7.io>
2022-12-12 14:45:33 +00:00
Jesse Braham
03d94a0ba2 New releases for all HALs 2022-12-12 01:29:49 -08:00
IsaacDynamo
66b757847f Missed some changes 2022-12-10 01:51:14 +01:00
IsaacDynamo
7d985dc36a Added start_duty_without_fade() and update_channel() to set_duty() in order for the new duty-cycle to take effect 2022-12-10 01:06:02 +01:00
IsaacDynamo
2aa26863dd Allow a duty-cycle of 0% 2022-12-09 21:50:51 +01:00
Scott Mabin
0a5947c7f9 Correct Systimer delay implementation
Closes #229
2022-12-09 05:34:53 -08:00
Scott Mabin
0000d46ac5 Embassy init updates:
- Rename timg feature to timg0 to better refect which TG is being used
- Use the time_driver::TimerType in the signature of init to fix #268
- Update examples
- Fix CI features
- Add timg0 cfg to build.rs
2022-12-08 06:36:42 -08:00
Jesse Braham
91f18c882d Add cfg symbols for i2s and mcpwm 2022-12-07 15:38:52 +01:00
bjoernQ
4ab05e8923 Pass trap frame to CPU interrupt handlers (Xtensa) 2022-12-06 02:07:49 -08:00
Josh Weberruss
bc39cdae86 Add Rx and interrupts to UsbSerialJtag
Add non-blocking Write
2022-12-01 22:02:47 +11:00
Björn Quentin
c46719e112
Merge pull request #255 from dimpolo/mcpwm
MCPWM MVP implementation
2022-12-01 08:34:16 +01:00
Jesse Braham
5d48e77d5e
Fix clippy warnings, update READMEs (#284)
* Fix a couple clippy warnings

* Create features for architecture-specific depdendencies

* README updates
2022-11-30 10:13:40 -08:00
Björn Quentin
bc4e180a1a
Merge pull request #280 from bjoernQ/gpio-refactoring
GPIO module refactoring
2022-11-30 08:15:13 +01:00
dimi
0a75d3c64a resolve mcpwm FIXME 2022-11-30 00:55:58 +01:00
dimi
1369943710 resolve TODO 2022-11-30 00:55:39 +01:00
dimi
e1a812bc59 add SAFETY comments 2022-11-30 00:55:39 +01:00
dimi
257664da74 add direction to Timer::set_counter 2022-11-30 00:55:39 +01:00
dimi
ab74fc47fd rename const generics 2022-11-30 00:55:39 +01:00
dimi
f0876952b7 implement Timer::set_counter 2022-11-30 00:55:39 +01:00
dimi
89535a26dd WIP docs 2022-11-30 00:55:39 +01:00
dimi
2d81313475 add PeripheralClockConfig and TimerClockConfig 2022-11-30 00:55:39 +01:00
dimi
4327506bb2 use Clocks.pwm_clock on ESP32 2022-11-30 00:55:38 +01:00
dimi
408243d7e1 improve mcpwm::operator, add PwmPinConfig 2022-11-30 00:55:38 +01:00
dimi
6d2b8a6718 PwmClock changes 2022-11-30 00:55:38 +01:00
dimi
18c7ef7802 WIP MCPWM implementation 2022-11-30 00:55:38 +01:00
dimi
7a51433944 remove i2c::SetupError and make i2c::I2C::new infallible 2022-11-29 14:19:45 +01:00
bjoernQ
878bbc4c0c GPIO module refactoring 2022-11-29 12:03:04 +01:00
Björn Quentin
82e66bc9dc
Merge pull request #276 from IsaacDynamo/pub-signals
Export InputSignal and OutputSignal
2022-11-29 08:15:52 +01:00
C2D
59d02f5f6e
Add SHA accelerator implementation (#257)
* Add untested basic SHA for esp-sX/cX chips

* Fix ptr type inconsistency for S2

* Add ESP32 impl & fix process_buffer latch issue

* Add debug example for SHA accelerator

* Clean up no-op buffer prints

* Test vector parity (on esp32s3)

* Checkpoint for converting to alignment helper

* Finish refactoring & additional parity tests on esp32s3

* Remove core_intrinsics requirement for now

* Fix case where (src.len() % 4) == 3

* Finish sha2 example with performance comparison (12-61x speedup)

* Refactor ESP32 to alignment helper & Clean up example

* Prevent out-of-bounds reads in ESP32 version

* Revert Cargo debug changes

* Remove cargo config.toml

* Clean up example

* Remove common/rust-toolchain & ignore in future

* Might as well use actual size_of const

* Remove SHA512/SHA384 for C2/C3

* Directly import nb::block! to remove unused import warning & fix c2 feature detect

* Remove stray newlines

* Fix esp32c2 having SHA256

* ESP32 also has SHA384

* Remove comments that don't have a purpose

* Clean up example & finish() handling

* Add examples & add ESP32 free()

* Update C2/C3 examples to show accurate algorithm used

* Fix busy check for ESP32

* Remove outdated TODO comment

* Update PAC for ESP3 and (actually) fix busy check

* Refactor ESP32 version to reduce search space

* Add debug printlns to sha example & clean up comments

* Fix ESP32 version, finally

Co-authored-by: ferris <ferris@devdroplets.com>
Co-authored-by: Jesse Braham <jesse@beta7.io>
2022-11-28 14:20:31 -08:00
IsaacDynamo
e1c0ac540e Export InputSignal and OutputSignal 2022-11-26 16:38:02 +01:00
bjoernQ
fbd912a3a5 Finalize I2S RX Implementation 2022-11-24 10:16:08 -08:00
icedrocket
177d278223
Add more trait re-exports to prelude module (#260)
* Add more trait re-exports to prelude module

* Don't expose usb_serial_jtag module

* Add missing system module re-exports
2022-11-23 07:24:47 -08:00
Ryan Butler
8ab01225bd Implemented ability to write bytes in UsbSerialJtag 2022-11-22 10:52:05 -08:00
Jesse Braham
096ff3439d
New releases for all HALs (#265)
* Update all dependencies to their latest versions

* Bump version numbers
2022-11-17 09:13:41 -08:00
bjoernQ
4afa8fda92 Preliminary I2S Implementation 2022-11-17 08:24:43 -08:00
Jesse Braham
d9135350e7 Add more configuration symbols and simplify the build script 2022-11-17 07:29:35 -08:00
Björn Quentin
9b3e644e30
Detangle I2C clock calculation (#263)
* Detangle I2C clock calculation

- fixes ESP32-C2 in release mode
- fixes the MPU6050 init problem

* Converted NOTE to FIXME
2022-11-16 11:31:04 +00:00
Josh Weberruss
5523a7b8b9 Fix UART unlisten calls so they clear the interrupt enable bit instead of setting it 2022-11-13 12:30:13 +11:00
Jesse Braham
86049a53de
Update all PACs (#259) 2022-11-10 09:02:18 -08:00
Scott Mabin
9064177e99
Initial embassy support (#225)
* wip: timg embassy driver

- read_raw on timg renamed to now()
- timg initialized and stored in static for use in the embassy driver
- timg sets alarm value
- untested whether alarms actually trigger

* TIMG timer driver for esp32, esp32s3

- Adds the timg timer block as a time driver for embassy
- Not enabled on the C3 as it only has one timer block, better to use
  systimer
- s2 example added but can't build due to atomic requirements in
  futures-core

* Add S2 atomic support with emulation, fixup embassy support for the S2

* Move executor & static-cell to dev deps. Make eha optional

* Add c2 support, run fmt

* Update to crates.io embassy releases

* Update eha

* update timg time driver to new trait

* Remove exception feature of esp-backtrace and use the user handler for backtracing

* Add async testing workflow

* Update systick example

* Fix S2 examples

* Update xtensa-toolchain

* set rustflags for s2 target

* Disable systick for esp32s2 until we can fix the noted issues

* review improvements

- Fix intr prio array being off by one
- emabssy time prio interrupt set to max prio
- use cfg instead of feature for systick detection

* Update example time delays
2022-11-09 08:04:38 -08:00
Björn Quentin
8bdf11b287
I2C Driver Refactoring (#233)
* I2C Driver Refactoring

* Improve I2C error handling and robustness
2022-11-09 06:34:55 -08:00
dimi
ece70e99a4 Add Mcpwm0 and Mcpwm1 to system::Peripheral 2022-11-07 13:24:17 -08:00
Björn Quentin
da3cbca61e
Merge pull request #251 from dimpolo/outputsignal
add/correct docs for gpio::OutputSignal and add PWM output signal to ESP32-S3
2022-11-07 10:21:58 +01:00
dimi
7df93cb359 add/correct docs for gpio::OutputSignal and add PWM output signal to ESP32-S3 2022-11-07 02:13:53 +01:00
Jesse Braham
ced5941871 Add LEDC support for ESP32-C2 2022-11-04 08:19:53 -07:00
Jesse Braham
251e60c20f Update to newest PACs for C2/C3/S3 and clean up GDMA implementation 2022-11-03 11:17:51 -07:00
Juraj Sadel
f6ba237e76
ADC: Refactor, join S2 and S3 together and C2 and C3 as well (#245)
* ADC: Refactor, join S2 and S3 together and C2 and C3 as well

* S3: Update PAC version
2022-11-02 10:38:03 -07:00
bjoernQ
a876d8d344 Support USB-DEVICE on ESP32-S3 and ESP32-S2 2022-11-02 07:14:50 -07:00
Björn Quentin
fae2f1add3
Merge pull request #244 from bjoernQ/fix-esp32c2-apbclock
ESP32-C2 APB clock is 40MHz, not 80MHz
2022-11-02 13:59:26 +01:00
bjoernQ
ec60c4b5fe ESP32-C2 APB clock is 40MHz, not 80MHz 2022-11-02 13:11:00 +01:00
icedrocket
e28a7d1ba0 Fix typo 2022-11-01 20:32:55 +09:00
bjoernQ
ad1970c6b7 Offer DMA channel 3 and 4 on ESP32-S3 2022-10-31 07:09:15 -07:00
dimi
2f3b6c843c remove lifetime annotations from cpu_control::start_app_core 2022-10-31 14:46:31 +01:00
dimi
5cf6079054 cpu_control::start_app_core improvements
* add `Send` bound
* move `#[must_use]` to `AppCoreGuard`
* remove redundant `-> ()`
* document guard behaviour
2022-10-31 13:28:56 +01:00
Björn Quentin
8ec46df825
Merge pull request #234 from jessebraham/feature/dma
Add DMA support for ESP32-C2 and ESP32-S3
2022-10-28 16:15:28 +02:00
Jesse Braham
4f18e2c846 Update the priority enum and add missing channels for ESP32-S3 2022-10-28 06:51:10 -07:00
JCF
a7d561ec26 Added method to change bus frequency to Spi struct 2022-10-28 11:15:39 +02:00
Jesse Braham
c642c79297 Add DMA support for ESP32-S3 2022-10-27 12:08:23 -07:00
Jesse Braham
e2df98da52 Add DMA support for ESP32-C2 2022-10-27 11:22:30 -07:00
bjoernQ
3e4710b822 Add DMA support for ESP32-S2 2022-10-25 07:38:45 -07:00
Gustavo Henrique Nihei
3ff5da5aa7 esp-hal-common: Remove unnecessary unsafe block
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-24 09:52:46 -03:00
playfulFence
4fb77df6ce Fix lifetime error 2022-10-24 13:09:06 +02:00
Björn Quentin
9744d12484
SPI-DMA for ESP32 (#216)
* SPI-DMA for ESP32

* MSRV Fix
2022-10-20 09:12:31 -07:00
Juraj Sadel
d850b76246 ESP32S3: Add ADC support 2022-10-20 17:44:08 +02:00
Jesse Braham
00cba4485c Update esp-hal-common to use the newest PACs 2022-10-19 07:00:20 -07:00
bjoernQ
9cb24bb79f Basic DMA for ESP32-C3 2022-10-13 10:14:51 -07:00
Jesse Braham
f13c47f28f
Merge pull request #211 from jessebraham/feature/esp32c2
Add support for the ESP32-C2/ESP8684
2022-10-13 08:52:44 -07:00
Jesse Braham
908fb48e6c Remove some unused constants 2022-10-13 07:34:02 -07:00
Jesse Braham
e2b2d55bf8 Fix a bunch of cfg gates, use published version of PAC 2022-10-12 12:25:15 -07:00
Jesse Braham
2880ca4ca0 More corrections to clocks 2022-10-12 09:28:34 -07:00
Jesse Braham
d3f92db2ec Get the ADC example building, clean up some cfg gates
Note that this example still doesn't seem to be working correctly
2022-10-12 09:28:34 -07:00
Jesse Braham
312c41cee2 All examples building, many still have issues at runtime 2022-10-12 09:28:34 -07:00
Andreas Hartmann
159fe3b29b common/spi: Use constructor in add_device
to create a new `SpiBusDevice` instead of directly instantiating the
struct. `SpiBusDevice::new` takes care of setting up the CS line to be a
default-high output, too, which the raw struct doesn't.
2022-10-12 08:52:02 +02:00
Jesse Braham
76f803ae63 Make some corrections to clock/RTC_CNTL (still not working) 2022-10-11 10:12:42 -07:00
Jesse Braham
05fd5a64de Update dependencies, fix some errors after rebase, add RTC_CNTL 2022-10-11 10:12:42 -07:00
Jesse Braham
3019b78d6a Fix clock and GPIO drivers, add analog GPIO pins 2022-10-11 10:11:36 -07:00
Jesse Braham
f5f475923f Add startup code and build/linker scripts, add ADC, eFuse, GPIO, and TIMG 2022-10-11 10:11:36 -07:00
Jesse Braham
455965d471 Create the esp32c2-hal package and add it to the workspace
Add a feature for the ESP32-C2 to`esp-hal-common` and update some `cfg`s


Organize the `esp-hal-common` imports and exports and update to include the ESP32-C2
2022-10-11 08:03:43 -07:00
Andreas Hartmann
2b98932028 common/spi: Implement hardware CS
Removes a lot of generic arguments and hard-codes the `SpiBusController`
and `SpiBusDevice` to work with the `Spi<T>` defined in the HAL instead.
This allows us to access the `cs_signal()` trait function from `T:
Instance`, which we need to connect/disconnect the CS I/O as
appropriate.
2022-10-11 16:06:45 +02:00
Björn Quentin
af745ac7b0
Fix ESP32-C3 interrupt/exception handling (#207)
* Fix ESP32-C3 interrupt/exception handling

* Use riscv-atomic-emulation-trap 0.2.0
2022-10-05 14:15:17 +01:00
Jesse Braham
5054681ba3 Update to newest embedded-hal alpha and add embedded-hal-nb 2022-09-29 16:07:49 +02:00
Jesse Braham
7889a992d7 Add cfg symbols for SYSTIMER and USB_SERIAL_JTAG peripherals 2022-09-20 16:41:39 +02:00
Juraj Sadel
0f9fdb7c15 RMT: Shouldn't be possible to assign pins multiple times into channel 2022-09-20 12:33:17 +02:00
Jesse Braham
5ca771a12e
Inject configuration symbols in build script, simplify cfg gating (#187)
* Update the build script to inject a configuration value for the enabled chip

* Update all cfg gates to use the new symbols instead of the chip features

* Inject architecture and core count symbols as well, update as needed

* Organize the imports and exports of `esp-hal-common`
2022-09-14 07:46:23 -07:00
Jesse Braham
ee7e9bd0a1 Bump version numbers and update dependencies 2022-09-13 21:01:08 +02:00
Jesse Braham
252fa27c2e Change target_arch cfgs to chip features
This hopefully will allow the documentation's build to succeed on docs.rs, as it uses the `x86_64-unknown-linux-gnu` target by default
2022-09-13 19:46:41 +02:00
Juraj Sadel
3ebfbc44c3 ADC: Add compile time check for using unconfigured PIN, add AdcPin wrapper around PIN 2022-09-13 08:41:04 +02:00
Juraj Sadel
f11a23dddb Make it impossible to create multiple instances of LEDC 2022-09-06 11:37:05 +02:00
bjoernQ
b9f38aae7c Pin version of paste to fix build errors 2022-08-31 11:28:42 +02:00
har7an
8b9fd8b7a0
embedded-hal SpiDevice on all esp32 variants (#106)
* WIP: common/spi: Implement `SpiDevice`

to get shared access to an SPI bus directly via the HAL.

* WIP: common/spi: add SpiBusDevice::new

to create instances via a function call.

* esp32/examples: Add example for spi device trait

* common/spi: Finish "SpiDevice" implementation

for esp32. Abandons the approach of having the user pass in some generic
mutex in favor of creating the Mutex as part of the API so it isn't
exposed to the user in the first place.

* common/spi: Add more thorough docs

* esp32/examples: Fix example for eh1 "SpiDevice"

* common/spi: Implement `SpiDevice` for xtensa arch

and move the code into a submodule that is fenced with conditional
compilation directives.

* esp32/examples: Update spi device example

to the changed APIs for the timers and clocks, and add more transmission
tests to the example code.

* common/spi: Create devices from buscontroller

directly, instead of offering only the `new` method.

* common/spi: Finish `SpiBusDevice` trait

from embedded-hal 1.0.0-alpha.8.

* esp32: Update `SpiBusDevice` usage example.

* common/spi: Fix mutex types for xtensa32 esp

because the esp32/esp32s3 can use `SpinLockMutex`, whereas the esp32s2
has access only to `CriticalSectionMutex`.

* common/spi: Implement `SpiBusDevice` for riscv

based esp32c3.

* general: Add examples for spi device loopback

to all esp variants.

* common: Use esp_backtrace in spi_eh1_device examples

* common/spi: Update module documentation.

* common/spi: Use `critical_section::Mutex`

to unify locking across all esp variants.

* esp32c3-hal: Fix spi device example

* esp32c3/examples: Fix typo in used spi pins

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2022-08-30 06:55:53 -07:00
Juraj Sadel
9911a1e359 Replace all float calculations with fixed ones 2022-08-30 13:43:48 +02:00
Maxime Borges
04c8721e60 gpio: Impl From<> 2022-08-28 01:22:33 +02:00
Jesse Braham
6f20358124
Update the Cargo manifests and top-level README (#168)
* Add the `rust-version` key to each Cargo manifest

* Normalize dependencies and features in each Cargo manifest

* Enable all features in CI when checking examples

* Update the top-level README
2022-08-25 09:20:05 -07:00
Scott Mabin
b30886cce6
Periodic system timer & esp32s2 fixes & edge interrupt fixes (#167)
* Add Periodic mode to SYSTIMER

* Deduplicate shared code in SYSTIMER

* esp32s2 edge mode systimer interrupt

- Make systimer interrupts edge mode
- fix examples for s3 & s2

* Fix TPS for esp32s2, clean up examples
2022-08-25 07:13:56 -07:00
bjoernQ
5e6234dcc4 Fix embedded-hal 0.2.x SPI implementation 2022-08-24 19:49:47 +02:00
Scott Mabin
4c943378f8 Use vscode multi-root ws for esp-hal 2022-08-23 21:24:04 +02:00
Jesse Braham
81ea741a81 No longer alias the PAC package names 2022-08-22 12:22:42 -07:00
Scott Mabin
be184a552d
critical_section implementations & esp_backtrace (#151)
* CS impl

* use CS Mutex in C3 examples

* use CS Mutex in S2 examples

* Update esp32 example

* run fmt

* Update S3 examples

* Remove uses of unsafe where no longer required

* use esp_backtrace in examples

* fix import & fmt once more

* Bump MSRV to 1.60.0

Co-authored-by: Jesse Braham <jesse@beta7.io>
2022-08-22 20:02:28 +01:00
Björn Quentin
f7c9b0869e
Merge pull request #157 from jessebraham/fixes/pacs
Use the published version of the PACs
2022-08-22 08:53:54 +02:00
Gustavo Henrique Nihei
61c0731b62 rtc: Add support for monitoring of XTAL clock
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-19 21:55:54 +02:00
Jesse Braham
f0335ade53 Use the published version of the PACs 2022-08-19 10:45:32 -07:00
har7an
2fe27536aa
SPI: Implement more SPI traits from embedded-hal 1.0.0-alpha.8 (#101)
* common/spi: Turn fifo size into const

instead of hard-coding it into the code in various places.

* common/spi: Alias `write_bytes` to `send_bytes`

since they share the same interface and the same code anyway.

* common/spi: Implement `read_bytes`

as counterpart to `send_bytes` that is responsible only for reading
bytes received via SPI.

* common/spi: Rewrite `transfer`

to use `send_bytes` and `read_bytes` under the hood and remove duplicate
code.

* common/spi: Create submodule for embedded_hal_1

that is re-exported when the `eh1` feature flag is active. This removes
lots of duplicate `#[cfg(...)]` macros previously part of the code.

* common/spi: Implement `SpiBus` and `SpiBusWrite`

traits from the `embedded-hal 1.0.0-alpha.8`.

* common/spi: Make `mosi` pin optional

* esp32-hal: Add new SPI example with `eh1` traits

* esp32-hal/examples/spi_eh1: Add huge transfer

and bump the SPI speed to 1 MHz.

* common/spi: Apply rustfmt

* common/spi: Use `memcpy` to read from registers

This cuts down the time between consecutive transfers from about 2 ms
to less than 1 ms.

* WIP: common/spi: Use `ptr::copy` to fill write FIFO

cutting down the time between transfers from just below 1 ms to ~370 us.

The implementation is currently broken in that it will always fill the
entire FIFO from the input it is given, even if that isn't FIFO-sized...

* common/spi: Add more documentation

* esp32/examples/spi_eh1: Fix `transfer_in_place`

* esp32/examples/spi_eh1: Add conditional compile

and compile a dummy instead when the "eh1" feature isn't present.

* esp32-hal: Ignore spi_eh1 example

in normal builds, where the feature flag "eh1" isn't given. Building the
example directly via `cargo build --example spi_eh1_loopback` will now
print an error that this requires a feature flag to be active.

* common/spi: Use `write_bytes`

and drop `send_bytes` instead. Previoulsy, both served the same purpose,
but `send_bytes` was introduced more recently and is hence less likely
to cause breaking changes in existing code.

* common/spi: Fix mosi pin setup

* Add SPI examples with ehal 1.0.0-alpha8 traits

to all targets.

* common/spi: Fix `read` behavior

The previous `read` implementation would only read the contents of the
SPI receive FIFO and return that as data. However, the `SpiBusRead`
trait defines that while reading, bytes should be written out to the bus
(Because SPI is transactional, without writing nothing can be read).

Reimplements the `embedded-hal` traits to correctly implement this
behavior.

* common/spi: Use full FIFO size on all variants

All esp variants except for the esp32s2 have a 64 byte FIFO, whereas the
esp32s2 has a 72 byte FIFO.

* common/spi: Use common pad byte for empty writes

* common/spi: Fix reading bytes from FIFO

by reverting to the old method of reading 32 bytes at a time and
assembling the return buffer from that. It turns out that the previous
`core::slice::from_raw_parts()` doesn't work for the esp32s2 and esp32s3
variants, returning bogus data even though the correct data is present
in the registers.

* common/spi: Fix typos

* examples: Fix spi_eh1_loopback examples
2022-08-17 11:57:55 +01:00
har7an
26a5029edf
common/gpio: Allow disconnecting IO from peripheral (#147)
* common/gpio: Allow disconnecting IO from peripheral

* common/gpio: Allow disconnecting input from peripheral

* common/gpio: Document functions for disconnecting

IOs from peripherals.

* common/gpio: Use generic alternate function

passed in from the gpio configuration.
2022-08-16 08:52:07 -07:00
Gustavo Henrique Nihei
a7c788ff02 rtc: Disable Flashboot mode when disabling RTC Watchdog timer
This commit fixes a regression to Direct Boot support introduced on
routine.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-16 11:43:57 -03:00
bjoernQ
91373ac6a0 Make RMT TX larger than one block work on ESP32-C3 and ESP32-S3 2022-08-09 16:30:19 +02:00
Gustavo Henrique Nihei
91ea205446
ESP32-C3: Add driver for RTC Watchdog Timer (RWDT) (#134)
* esp32: Fix typo in Frequency word in some identifiers

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>

* esp32c3: Add support for PLL clock configuration

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>

* clock: Move definition of Clock types to common level

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>

* esp32c3: Add support for RTC Clock configuration

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>

* esp32c3: Add example for the RTC Watchdog Timer driver

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-08 15:36:19 +01:00
bjoernQ
275cede963 Fix LEDC divider calculation, use REF_TICK when needed 2022-08-08 14:41:55 +02:00
Björn Quentin
2a1ab6da0e
Use the correct AlternateFunction for GPIO (#137) 2022-08-08 12:02:40 +01:00
Jesse Braham
601d70dd9a
Refactor the LEDC driver to reduce code duplication (#130) 2022-08-03 14:48:45 +01:00
Juraj Sadel
ec6b58ee7d Add basic LEDC support for esp32, esp32c3, esp32s2 and esp32s3 2022-07-29 12:22:27 +02:00
Gustavo Henrique Nihei
224e84d9dc
Move Super Watchdog functions into RTC_CNTL common implementation (#125)
* esp32c3: Move SWD functions into RTC_CNTL common implementation

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>

* esp32s3: Extend SWD functions to ESP32-S3

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-27 13:37:37 -07:00
bjoernQ
83ac67be23 Make it easy to leave out some of the SPI pins 2022-07-27 16:14:40 +02:00
Björn Quentin
ffc6c16575
Fix invocation of esp32_update_cpu_freq (#124)
* Fix invocation of esp32_update_cpu_freq

* Update comment for `esp32_update_cpu_freq`
2022-07-27 14:24:26 +01:00
Scott Mabin
de379897a9 perf: vectored interrupt improvements
Instead of building a table of _all_ configured interrupts,
we now only check the currently _pending_ interrupts configuration
status. This means in the best case scenario we only ever do _one_
lookup instead of the 60~ we did before.

Tested on esp32c3, gpio_interrupt:

Before: 850cycles from `handler_interrupts` to the actual handler
After: 125cycles
2022-07-26 23:30:50 +01:00
Scott Mabin
1d02bf87c3
RISCV vectored interrupts (#118)
* RISCV interrupt vectoring

- Adds support for vectoring peripheral interrupts to PAC handlers
- Currently supports level interrupts with priorities from 1-15
- Updated the gpio interrupt example to reflect the new changes

* remove .vscode files

* Support vectored edge interrupts

This is as simple as making sure we clear the CPU interrupt whenever we
receive one. This also documents further what APIs are safe to call when
the `vectored` feature is enabled.

* fix all examples to use vectoring

* doc & cleanup

* run handlers from ram

* make xtensa::interrupt::vectored private, we rexport public items

* fix default handlers

* pass interrupt into EspDefaultHandler
2022-07-26 09:24:47 -07:00
Scott Mabin
1789780d06
Xtensa vectored interrupts (#103)
* Xtensa interrupt vectoring: peripheral source

- Initial Xtensa vectoring, updated esp32 gpio example to use new interrupt macro.
- Only peripheral sources supported.
- Only level one priority supported.
- CPU & Edge interrupts still need to be handled.

* Xtensa interrupt vectoring: CPU & EDGE

- Add support for handling CPU interrupts and edge interrupts
- PR required to xtensa-lx-rt for CPU handlers

* Xtensa interrupt vectoring: Priority

- Finally implement priortization
- Only three priorities available at the moment. Xtensa programmer guide
  discourages using highpri interrupts in Rust/C. Guide also mentions
  using software priortization to increase the number of Priorities
  available

* support CPU interrupts, using patch xtensa-lx-rt

* Update example

* Add support & examples for the s2 & s3 too

* Fix formatting and missing imports

* Run interrupt handling in ram, optionally run the vector handler in ram in the examples

* Use xtensa_lx::Mutex CS when enabling interrupts

* Run clippy on each target

* Remove redundant features

* Fix C3 builds

* make enable unsafe. Add note about preallocated interrupts in vectored mode.

* Remove `INTERRUPT_LEVELS` static

The interrupt levels static introduces a few issues
  - A lock is needed when configuring interrupts to keep
    INTERRUPT_LEVELS in a consistent state
  - Interrupts enabled from outside the Rust domain wouldn't be
    serviced, this is the case with the wifi blobs

To remove it, the prioty configuration is now calculated dynamically in
the interrupt handler. Essentially INTERRUPT_LEVELS is now created once
the interrupt triggers. It has some benefits, such as only having to
look at interrupts configured on the current core, not both, but there
is of course an overhead with doing this in the interrupt.

* Allow raw interrupts on levels 4-7, whilst also supporting vectoring on levels 1-3

* rename core number features

* Fix examples and formatting

* use xtensa-lx-rt release, update pacs

* Support passing the trap frame into interrupt handlers

* cfg away the #[interrupt] macro when not using vectoring

* rename enable to map

move vectored feature to chip specific hals

* export vectored functions

- rename `enable_with_priority` to `enable`
- add docs for interrupt macro

* Update all examples to use vectored interrupts
2022-07-25 07:12:34 -07:00
bjoernQ
34b1e09662 CPU clock settings for ESP32-S2 and ESP32-S3 2022-07-22 16:09:38 +02:00
Björn Quentin
faf646375f
CPU clock settings for ESP32 and ESP32-C3 (#110)
* CPU clock settings for ESP32 and ESP32-C3

* Minor improvements to the ESP32 clock setting code
2022-07-21 21:38:46 +01:00
Jesse Braham
4ba610d38d Do not enable the smartled feature by default 2022-07-20 10:38:48 -07:00
Jesse Braham
2a00119f94 Update the xtensa-lx-rt dependency to the newest version 2022-07-20 10:37:02 -07:00
Björn Quentin
147d8de988
Separate TIMG into timer0, (timer1), wdt (#104)
* Separate TIMG into timer0, (timer1), wdt
* Apply suggestions from code review
* Remove left-over code
* Ignore settings.json
2022-07-20 06:51:39 -07:00
bjoernQ
907d43ed6f Pin the PAC dependencies 2022-07-15 12:14:27 +02:00
bjoernQ
35a58490c6 Additional UART/Serial features 2022-07-13 22:46:34 +02:00
Björn Quentin
e612bd1120
Add some config options to the UART driver (#99)
* Add some config options to the UART driver
* Use esp-println 0.2.0
* Remove the NoPin type
* Serial constructor now doesn't return a Result anymore
2022-07-12 08:00:02 -07:00
bjoernQ
887798fd6f Reading raw ADC data for ESP32-C3 2022-07-07 18:39:11 +02:00
bjoernQ
568e37c166 Reading raw ADC data on ESP32 and ESP32-S2 2022-07-07 17:55:26 +02:00
bjoernQ
1655e36c31 Implement starting a task on second core of ESP32 and ESP32-S3 2022-07-05 17:41:55 +02:00
Jared Moulton
45060bb684 Add WIP hal-1.0 SPI traits
This implemnts the functionality for SpiBusFlush and SpiBusWrite traits
2022-07-04 19:03:39 +02:00
bjoernQ
b48e9c30a3 Allow sub-seconds timer timeouts 2022-07-01 09:51:28 +02:00
Björn Quentin
7e25eebd8d
Implement DAC support for ESP32/ESP32-S2 (#92)
* Implement DAC support for ESP32/ESP32-S2
* Adapt the DAC samples after rebase
2022-06-30 11:57:16 -07:00
Jesse Braham
eb8555572b Convert the Timer to take time units for countdown instead of u64 2022-06-29 17:57:16 -07:00
Jesse Braham
54be1b328d Add a method to each GPIO type which returns its pin number 2022-06-28 14:55:33 -07:00
Jesse Braham
3d481901a5
Put the embedded-hal alpha trait implementations behind a feature (#88)
* Remove unused dependencies from HAL packages

* Put the `embedded-hal` alpha trait implementations behind a feature
2022-06-27 10:13:18 +01:00
Sergio Gasquez Arcos
fbd42865ef
Update MISO and CS pins to be optional (#89)
* Update CS and MISO pins to be optional
* Update examples
2022-06-23 10:10:57 -07:00
Jesse Braham
c5cdf68ddc Bump the xtensa-lx-rt version 2022-06-22 08:35:55 -07:00
bjoernQ
8a3a0e7cb9 Reading of some eFuses 2022-06-17 16:51:26 +02:00
bjoernQ
3841c09e5d Fix RMT driver 2022-06-15 16:40:49 +02:00
Jesse Braham
2417cd0b33 Update the prelude, adding a public module for the embedded-hal alpha traits 2022-06-14 17:28:03 +02:00
Jesse Braham
e764194f2f Implement non-blocking SPI traits from embedded-hal alpha 2022-06-14 17:28:03 +02:00
Jesse Braham
8663153e12 Implement the embedded-hal alpha traits for the GPIO and I2C drivers 2022-06-14 17:28:03 +02:00
Jesse Braham
9b033d44db Implement the embedded-hal alpha traits for the Delay and Serial drivers 2022-06-14 17:28:03 +02:00
bjoernQ
9c244ba16c Make sure that HAL users don't need to depend on esp-hal-common 2022-06-13 16:38:58 +02:00
bjoernQ
918f7a7c8e Electrical state of open drain output can be read 2022-06-13 16:38:58 +02:00
bjoernQ
86f4d02782 Fix wrong SCL for ESP32,ESP32S2 2022-06-10 19:02:12 +02:00
Björn Quentin
1752e17531
Merge pull request #78 from bjoernQ/refactor_gpio
Simplify GPIO Macros
2022-06-10 17:03:18 +02:00
Scott Mabin
4acdf2516c
[esp32c3] SYSTIMER peripheral (#76)
* initial systimer impl
* Add systimer example
* Make Alarms real singletons
  * Remove runtime Option, turn into compile error
  * Make Systimer::now() not take self
* refactor shared alarm methods
* Implement esp32c3 delay with monotonic SystemTimer::now()
* Add extend systimer support to esp32s3 and add example
* systimer: esp32s2 support
2022-06-10 07:53:45 -07:00
bjoernQ
0dd0238ce7 Simplify GPIO Macros 2022-06-10 15:04:23 +02:00
Jesse Braham
0c61e7eeef Fix build errors introduced by updating the esp-pacs dependency 2022-06-09 10:35:18 -07:00
Björn Quentin
3fd4b03144
Add boot-default ClockConfig (#77) 2022-06-09 13:51:17 +01:00
Jesse Braham
422cd5036d Use the PTR constant instead of the ptr() function for peripherals 2022-06-07 10:08:52 -07:00
Juraj Sadel
e9d25153c6 Change frequency for all Xtensa chips 2022-06-03 19:56:21 +02:00
Juraj Sadel
b382a019d4
Feature/time types (#64)
* Use fugit time types for SPI peripheral, update examples

* initial WIP

* fix CI build errors

* Use extension trait in examples

Co-authored-by: Jesse Braham <jesse@beta7.io>
2022-05-31 11:39:44 +01:00
Robert Wiewel
a55c9d77ec Add RMT output channel support for all current ESP32 variants
- Add RMT output channel support for ESP32, ESP32-S2, ESP32-S3, ESP32-C3
- Add add RMT adapter for `smart-leds` crate
- Add example `hello_rgb` for ESP32-S2, ESP32-S3 and ESP32-C3 that either
  drives one LED at the pin where a LED is located on the official devkits
- Add example `hello_rgb` for ESP32 that is driving a 12-element RGB ring.
2022-05-17 15:56:25 +02:00
Jesse Braham
67bd5837cd Make cargo manifests consistent and bump dependencies 2022-05-05 11:56:43 +02:00
Jesse Braham
e745e84869 Fix a whole bunch of clippy warnings 2022-05-05 11:51:12 +02:00
Jesse Braham
ec6a82b3f4 Clean up imports and format all packages 2022-05-05 11:16:05 +02:00
bjoernQ
23b6e17e52 Pass the right TrapFrame to the exception handler 2022-05-05 11:13:27 +02:00
bjoernQ
67f21460f8 Implement workaround for ESP32 errata 3.6 2022-05-03 10:08:24 +02:00
Jesse Braham
c0a584ecfa
Add a minimal driver for the USB_SERIAL_JTAG peripheral (#56)
* Add a minimal driver  for the USB_SERIAL_JTAG peripheral implementing core::fmt::Write
2022-05-02 03:55:36 -07:00
Björn Quentin
eb47b0fe21
Bump riscv version (#51)
* Bump riscv version

* Bump riscv version in esp-hal-common
2022-04-22 08:00:17 -07:00
bjoernQ
0f58f84873 Bump version of xtensa-lx, use correct features 2022-04-20 08:32:45 -07:00
bjoernQ
43c8f34e5f Update xtensa-lx-rt, fix interrupt related examples 2022-04-04 08:52:27 -07:00
bjoernQ
e83fd25e49 Optionally pass interrupt context to handlers for Xtensa 2022-03-29 09:31:09 -07:00
Douman
afc150165e Adds Rng::random() -> u32 2022-03-24 08:44:04 -07:00
Douman
9a3b0a530f Introduce optional ufmt support 2022-03-21 16:31:20 +09:00
Jesse Braham
4e47fc69f4 Add features for architecture, clean up common HAL manifest 2022-03-14 18:17:24 -07:00
bjoernQ
651d27430a Replace the precompiled asm.S with global-asm 2022-03-14 09:33:05 -07:00
bjoernQ
15c34c23e4 Merge branch 'main' into feature/spi 2022-03-10 17:51:18 +01:00
Jesse Braham
590df9bc21 Document the RNG's pre-conditions, add a free function 2022-03-10 08:23:26 -08:00
Jesse Braham
bad8020abe Implement the embedded-hal Read trait for the RNG peripheral 2022-03-10 08:14:39 -08:00
bjoernQ
3f7a675b1e Implement SPI 2022-03-10 11:03:20 +01:00
bjoernQ
e7eea75ef8 Add timer interrupt support and examples 2022-03-04 09:54:28 -08:00
bjoernQ
a6dc853a82 I2C peripheral name got changed for ESP32C3 2022-03-02 10:18:58 +01:00
bjoernQ
e34319b763 Apply more suggestions from code review 2022-03-02 09:38:06 +01:00
Björn Quentin
573d94bfdb
Apply suggestions from code review
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2022-03-02 08:45:08 +01:00
bjoernQ
72913a6e50 Reformat code 2022-03-01 14:38:34 +01:00
bjoernQ
af9fecb8af Address FIXME comments from #22 2022-03-01 14:25:36 +01:00
bjoernQ
9bfe643f33 Implement I2C 2022-03-01 14:16:57 +01:00
Robert Wiewel
21b64f5c28 WIP: Prototype of shared I2C implementation
- Add example for I2C display example for ESP32-C3 and ESP32
- Example works for ESP32-C3, but not yet for ESP32
- Dependent on patched and forked `esp-pacs` version (referenced
  relatively for now, please check out and place accordingly)
2022-03-01 14:16:57 +01:00
bjoernQ
4cc78c4b6b Move GPIO type definitions to esp-hal-common 2022-03-01 14:16:57 +01:00
Robert Wiewel
fd7999052c Add temporary #cfg conditionals for WDT handling to allow for build on S3 2022-02-26 11:22:15 +01:00
Robert Wiewel
f2884bd3b8 Add RWDT disable in RTC_CNTL for ESP32/S2/S3 2022-02-25 23:41:05 +01:00
bjoernQ
83f961431c Support atomic emulation for ESP32C3 if needed 2022-02-24 15:40:41 +00:00
bjoernQ
181892d02a Fix Xtensa interrupts 2022-02-22 15:33:15 +00:00
bjoernQ
7b59c9e76d Move linker scripts to sub-folders 2022-02-18 12:00:05 +01:00
bjoernQ
545f997b07 Support ESP32S3 2022-02-16 15:44:06 +00:00
bjoernQ
0039996e8e Remove obsolete FIXME comment, check ESP32S2 in CI builds 2022-02-14 18:04:48 +00:00
bjoernQ
9c5468e814 Support ESP32S2 2022-02-14 18:04:48 +00:00
bjoernQ
52f388e9a1 Use esp-rs/esp-pacs 2022-02-10 10:03:37 +01:00
bjoernQ
cac30b7544 Add basic interrupt support for ESP32C3 and ESP32 2022-01-31 16:34:45 +00:00
Jesse Braham
ef5d1ac7f4
Refactor GPIO module to make traits accessible in esp-hal-common crate (#9)
* Extract all of the enums/structs/traits that we easily can from gpio!

* Pull the remaining traits (which we're able to) out of gpio!
2022-01-24 08:34:45 -08:00
Björn Quentin
70109ffe36
Initial implementation of ram proc macro (#6)
* Add .iram section for ESP32C3, make it possible to use direct-boot or normal-boot

* Add ram proc-macro
2022-01-18 10:02:40 -08:00
Jesse Braham
c3d83db6ca Update any references from my personal account to the organization 2022-01-12 13:52:47 -08:00
Jesse Braham
fda410633b Various updates all READMEs 2022-01-12 13:52:01 -08:00
Jesse Braham
6ab5634c54 Various small improvements, formatting, making things more consistent 2022-01-11 13:27:57 -08:00
Jesse Braham
10931726eb Begin adding some doc comments, update rustfmt config 2022-01-10 15:23:01 -08:00
Jesse Braham
9a030cbf78 Implement DelayMs and DelayUs traits from embedded-hal 2022-01-10 13:52:46 -08:00
Jesse Braham
b953041da0 Format GPIO-related macros and their invocations to improve readability 2022-01-06 09:34:32 -08:00
Jesse Braham
34ca298698 Update each package's Cargo manifest 2022-01-06 08:19:28 -08:00
Jesse Braham
ed2214a9fc Update each package's README 2022-01-06 08:08:32 -08:00
Jesse Braham
2bf61d9b53 Flatten the gpio module in the esp-hal-common package 2022-01-06 08:08:11 -08:00
Björn Quentin
6d94b61268
Shared GPIO Implementation (#3)
* make esp32c3 examples run from flash / flashable
* use gpio3 for blinky
* direct boot in Cargo.toml
* have a shared gpio impl
* use PACs from their original locations again
2022-01-06 07:57:55 -08:00
Jesse Braham
4e9ad72839 Assorted updates to make most things build properly... still some errors 2021-11-23 20:12:34 -08:00
Jesse Braham
22df2dbb99 Miscellaneous cleanup 2021-10-29 11:00:31 -07:00
Jesse Braham
2b27d10aa4 Convert to workspace, shortened chip selection feature names 2021-10-29 10:24:24 -07:00
Jesse Braham
579c5ba71b Extract UART peripheral implementation, prelude into esp-hal-common 2021-10-22 11:24:18 -07:00
Jesse Braham
dfab5d6c1b Add the esp-hal-common crate and make ESP32/ESP32-C3 use its Timer 2021-10-21 17:28:11 -07:00