253 Commits

Author SHA1 Message Date
Jesse Braham
6fdc1ea5de
Implement embedded_hal_nb::serial::* traits for UsbSerialJtag (#498)
* Implement `embedded-hal-nb` serial traits for `UsbSerialJtag`

* Fix warnings in `usb_serial_jtag` examples
2023-05-02 12:14:15 +01:00
bjoernQ
69d259f597 Call common_init on all targets 2023-04-25 16:50:26 +02:00
Jesse Braham
304e0116d7 Remove unnecessary generic from UsbSerialJtag driver 2023-04-24 09:19:49 -07:00
icedrocket
2b662a8486 doc: remove #[doc(inline)] from esp-hal-common re-exports 2023-04-24 06:35:34 -07:00
Jesse Braham
5c5d7f9876
Update embedded-hal-async and embassy-* dependencies (#488)
* Update all dependencies to their latest versions

* Update `embassy-executor` and add new required features
2023-04-21 07:48:25 -07:00
Jesse Braham
5950a043c0
Update to embedded-hal@1.0.0-alpha.10 and embedded-hal-nb@1.0.0-alpha.2 (#487)
* Update `embedded-hal-1` and `embedded-hal-nb` dependencies to latest versions

* Update the `Delay` and `I2c` trait implementations

* Update the `SpiDevice` trait, implement `SpiDeviceRead` and `SpiDeviceWrite`
2023-04-21 06:52:06 -07:00
Björn Quentin
e01a569c69
Merge pull request #474 from BryanKadzban/add-open-drain
Let users configure the LEDC output_pin as open-drain
2023-04-20 17:00:33 +02:00
Björn Quentin
ab79b142f7
Add DEBUG-ASSIST functionality (#484)
* Add DEBUG-ASSIST functionality

* Reformat `lib.rs`

* Reformat ESP32-C2 example
2023-04-20 07:38:55 -07:00
onsdagens
dd1be32387 Fixed comments 2023-04-18 13:47:49 +02:00
onsdagens
613136a5ef Fixed comments 2023-04-18 13:20:00 +02:00
Bryan Kadzban
9c78a9c6c9 Fix ledc example code for non-esp32c3 devices 2023-04-17 13:56:40 -07:00
onsdagens
3d3b71924b Added software interrupt API, examples for all of the MCUs 2023-04-14 18:53:49 +02:00
sreehari prasad
9ff3837537
rsa peripheral support (#467) 2023-04-11 11:58:10 +01:00
Juraj Sadel
40bf086a0c
Add PeripheralClockControl argument to timg, wdt, sha, usb-serial-jtag and uart constructors (#463)
* PeripheralClockControl timer

* Add PeripheralClockControl to timg, wdt, sha, usb-serial-jtag and uart

* ESP32 updated examples

* ESP32C2 updated examples

* ESP32C3 updated examples

* ESP32S2 updated examples

* ESP32S3 updated examples

* ESP32C6 updated examples

* cargo fmt
2023-03-31 09:51:34 +02:00
Jesse Braham
a9104020fc
Minor documentation improvements (#460)
* Add README, improve documentation for `esp-hal-procmacros`

* Improve documentation for `esp-hal-smartled`

* Use esp-rs logo for all packages' documentation
2023-03-30 06:05:28 -07:00
bjoernQ
01f35245f8 Fix 802.15.4 clock enabling (ESP32-C6) 2023-03-28 13:41:21 +02:00
Jesse Braham
aac83644af New releases for all packages 2023-03-27 10:38:46 -07:00
Juraj Sadel
0244c6d6fc
Feature/reset functionalities (#452)
* add `software_reset`, `software_reset_cpu` and `rtc_get_wakeup_cause`

* Add SOC wakeup symbols

* Add SleepSource and WakeupReason enums and get_wakeup_cause() function

* Add other SOC wakeups

* fixups and fmt

* address review comments

* Update symbols in WakeupReason enum

* fmt

---------

Co-authored-by: Anthony Grondin <104731965+AnthonyGrondin@users.noreply.github.com>
2023-03-24 20:37:24 +01:00
Scott Mabin
192f4678db Apply fix to esp32s2 & esp32s3 2023-03-24 15:50:23 +00:00
Björn Quentin
593dcb875b
Merge pull request #444 from bjoernQ/feature/spi-half-duplex
Half-duplex SPI
2023-03-23 08:35:25 +01:00
bjoernQ
ba75b151c3 Fix embassy_spi example 2023-03-22 09:06:37 +01:00
bjoernQ
6c7875afef Half-duplex SPI 2023-03-21 15:44:16 +01:00
Scott Mabin
9a5a546228
Unify linker scripts (#443)
* esp32 & esp32s2 sharing scripts

* add wokwi files

* Add fixup section for esp32s2, fix ordering of sectino includes

* Remove debug asm file

* Use shared linker scripts for s3 with fixups

* Add external.x sections back

* Move ld scripts into esp-hal-common

* esp32c3 unified linker scripts

- rework original c3 script to use the xtensa named sections
  (e.g, _SECTIONNAME_start)
- Add fixups in esp32c3 specific linker
- Remove useless text section start and end (not required when using any
  form of bootloader)

* Add RTC alias'. Move some shared fixups to a file

* comment and cleanup

* unify c2 linker script

* unify c6 linker script

* remove debug configs

* use new esp-riscv-rt

* fmt

* align db symbol names

* fix s3 db
2023-03-20 08:12:14 -07:00
Jesse Braham
536adac991
Clean up cfg gating and prelude module (#442)
* Add additional `cfg` gates to re-exports in `esp-hal-common`

This leaves only `clock`, `delay`, `peripheral`, `prelude`, `rom`, and `soc` *not* behind `cfg`s

* Simplify the prelude, update its `cfg`s, and re-export some missing traits

* Update various dependencies
2023-03-20 11:22:55 +00:00
Jesse Braham
a0b72bdfa5 Use latest PACs and make required changes 2023-03-14 06:23:58 -07:00
Jesse Braham
5747ddee14
Extract the esp-hal-smartled package (#429)
* Extract the `esp-hal-smartled` package

This (finally) eliminates the `esp_hal_common::utils` module!

* Remove all references to the old `smartled` feature from CI
2023-03-10 10:36:07 +00:00
Jesse Braham
f7830e2750
Reduce duplication, simplify re-exports, and general cleanup/organization (#424)
* Move some linker scripts into `esp-hal-common` and update the build script

* Move `EspDefaultHandler` and `DefaultHandler` definitions into `esp-hal-common`

* Re-export everything from `esp-hal-common`

* Add a couple cfg symbols, cleanup/organize some exports/modules
2023-03-08 06:35:59 -08:00
Scott Mabin
fd4e8e2778 ensure _heap_end symbol excludes reserved for boot section 2023-03-07 07:33:04 -08:00
Jesse Braham
72b9bcb015 Re-export Peripheral 2023-03-07 06:42:29 -08:00
Sergio Gasquez
1076f54462 docs: 📝 Add comma 2023-03-07 10:36:29 +01:00
Sergio Gasquez
1f69d29316 docs: 📝 Fix typo 2023-03-07 10:35:19 +01:00
Sergio Gasquez
d8c41b47af docs: 📝 Update install instructions 2023-03-07 10:34:52 +01:00
Jesse Braham
dc0911aa0d Use latest version of esp-backtrace for all devices 2023-02-28 09:25:55 -08:00
Jesse Braham
39b4db0cf9 Add examples for the RNG peripheral for all supported devices 2023-02-28 07:58:38 -08:00
Jesse Braham
984b7fc042
Refactor chip-specific code into esp_hal_common::soc module (#412)
* Create an `soc` module with a submodule for each chip, move `peripherals` in

* Move the `cpu_control` module into `soc`

* Move the `efuse` module into `soc`

* Refactor type definitions from `gpio` module into `soc`

* Put all embassy-related files in a common directory

* Change visibility of `GpioPin` constructor
2023-02-28 07:49:41 -08:00
Jesse Braham
d3969c3130 New releases for all HAL packages 2023-02-21 07:43:44 -08:00
bjoernQ
f385a7dfd2 Make sure to re-export xtensa-lx-rt 2023-02-13 10:09:20 +01:00
Björn Quentin
4e88e48bbe
Remove unnecessary rt crate dependencies (#391)
* Remove unnecessary `rt` crate dependencies

* Bump versions, update to latest released dependencies
2023-02-10 07:24:12 -08:00
Björn Quentin
ab9aeb2443 AnyPin 2023-02-08 14:31:54 +01:00
Scott Mabin
3f7181fece
Async SPI (#385)
* ground work for async dma (gdma only atm)

* Add async DMA (GDMA) - esp32c3/esp32c2

* Add Async SPI impl for esp32c3/c2

* Remove private modules from DMA

* add async spi example for esp32c3

* Switch to assoc wakers instead of a static array

* add support for esp32/esp32s2

* add support for esp32s3

* run fmt

* add c2 example, fix CI

* Remove redundant comments
2023-02-08 11:02:03 +00:00
Scott Mabin
0eac22eba1
Async: GPIO (#333)
* Add `is_listening` to `Pin` trait

* Add `Wait` impl for Gpio Input

* Add GPIO wait example for C3

* Ensure correct bank is accessed in interrupt

* Add esp32c2 wait example

* Add esp32s3 wait example

* Add esp32s2 wait example

* Add esp32 wait example

* Run fmt

* Add example to cargo tomls

* Add top level docs for embassy examples

* Mention the higher MSRV for async in the README

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
2023-01-27 10:44:08 -08:00
Jesse Braham
d03c267084 New releases for all HAL packages 2023-01-26 08:51:24 -08:00
mhead
586276fd34 aes accelerator implementation 2023-01-24 10:04:57 -08:00
Jesse Braham
832f9ef4d4
Refactor the clock module, provide ROM functions via linker scripts (#353)
* Refactor `clock` and `clocks_ll` into a common module

* Add a ROM function linker script to each HAL and provide some functions

* Use the provided ROM functions instead of transmuting addresses

* Fix CI workflow for ESP32-S2
2023-01-23 07:12:33 -08:00
Jesse Braham
d29c4b1dcf
Update a number of dependencies to get RISC-V HALs building again (#350)
* Update `riscv`, `riscv-rt` dependencies, plus PACs for RISC-V chips

* Update `riscv-atomic-emulation-trap` package

* Update the `embassy-executor` dev dependency to a newer version
2023-01-18 14:08:30 -08:00
liebman
ac206af656
pulse counter implementation (#328)
* start of pulse counter implementation

* implement interrupts
implement pcnt for esp32, esp32s2, and esp32s3

* implement pcnt for esp32s2

* fix esp32 PCNT signal names

* update PCNT register/fields for cleaned up PAC

* implement events/get_events (choosing what events interrupt)

* added pcnt example: simple encoder configuration

* restrict pcnt::channel::Channel::new() to super

* PcntPin -> PcntSignal
added range checks for thresholds and limits

* PcntSource is a better name I think

* handle error for PCNT Unit configure() in example

* update pac versions for status register change

* cargo fmt

* cargo fmt (examples)

* PcntSource now only stores the source id.
add a critical section to protect the ctrl & isr_en registers

* cargo fmt
2023-01-17 17:04:22 +00:00
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
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
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
bjoernQ
dc8963c0a8 Support ESP32-C2 with 26MHz Xtal 2022-12-13 05:15:10 -08:00