Commit Graph

641 Commits

Author SHA1 Message Date
Jesse Braham
728ce24109
Hide the second core in the Cpu enum for single-core devices (#432) 2023-03-10 10:52:14 +00: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
Björn Quentin
c1fa400e7c
RISCV: Separate PLIC and non-PLIC (#428)
* RISCV: Separate PLIC and non-PLIC

* De-duplicate code

* Write 0 to INTR_MAP again to disable peripheral interrupts

* Limit visibility of `get_assigned_cpu_interrupt`
2023-03-09 10:57:49 -08:00
Scott Mabin
c01317e8f3 Use T::clone_unchecked instead of self to avoid infinite recursion 2023-03-08 09:17:51 -08: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 Arcos
15d986f260
Merge pull request #422 from SergioGasquez/main
Update Xtensa install instructions
2023-03-07 11:07:39 +01: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
dimi
3d49ed7294 fix MCPWM typos 2023-03-06 06:46:49 -08:00
Scott Mabin
edfa9c83fd radio impls
- also add blanket impls for &mut Sealed and &mut Peripheral
2023-03-01 08:51:34 -08:00
Gustavo Henrique Nihei
453a7ac3f0
[ESP32-C3] Restore MCUboot build after moving to esp-riscv-rt (#417)
* esp32c3-hal: Fix operations on EXTMEM peripheral

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

* esp32c3-hal: Restore MCUboot build after moving to esp-riscv-rt

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

* esp32c3-hal: Fix location of .data linker output section

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

* ci: Enable MCUboot build for ESP32-C3

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

---------

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-01 14:10:35 +00: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
Björn Quentin
84288d6867
Merge pull request #411 from bjoernQ/fix/esp32c6-add-exports
Add more exports for ESP32-C6
2023-02-28 12:52:09 +01:00
bjoernQ
7cf7d8eeac Add more exports for ESP32-C6 2023-02-28 11:34:01 +01:00
bjoernQ
3ae95674e9 Fix spi.dma_write 2023-02-27 09:26:00 -08:00
Jesse Braham
d293d9f162
Add support for the ESP32-C6 (#392)
* Create the `esp32c6-hal` package

* Teach `esp-hal-common` about the ESP32-C6

* Get a number of peripheral drivers building for the ESP32-C6

bckup

initial clocks_ii

* Create the `esp32c6-hal` package

C6: update

* Simplify and fix the linker script

update

* C6: add I2S

* Create the `esp32c6-hal` package

* Teach `esp-hal-common` about the ESP32-C6

* Get a number of peripheral drivers building for the ESP32-C6

bckup

initial clocks_ii

* Create the `esp32c6-hal` package

* C6: update

* Simplify and fix the linker script

* update

* C6: add I2S

* update

* C6 Interrupts

* C6: Update build.rs, linker scripts and initial examples

* C6: RMT

* Fix interrupt handling

* Fix `ClockControl::configure`

* C6: revert to I2S0 instead of just I2S

* C6: rebase and update

* RTC not buildable

* Implement RWDT and SWD disable

* C6: working LEDC

* C6: working RMT

* C6: add aes

* C6: add mcpwm

* C6: add rtc_cntln - not finished

* C6: update and formatting

* C6: add pcnt

* C6: add examples and format

* Remove inline assembly, fix interrupts and linker scripts

* Remove unused features, update cargo config for atomic emu, misc cleanup

* Get ADC building and example "working" (as much as it ever does)

* Remove a bunch of unused constants which were copied from ESP-IDF

* The `mcpwm` example now works correctly

* Get `TWAI` peripheral driver building for C6

* Clean up the `rtc_cntl` module and get all the other HALs building again

* Add the C6 to our CI workflow

* Fix various things that have been missed when rebasing

Still missing a few examples (`clock_monitor`, `embassy_spi`, `ram`)

* C6: Small updates in wdt (#1)

* C6: Update WDT

* C6: Update examples with WDT update

* Update `esp-println` dependency to fix build errors

* Fix formatting issues causing pre-commit hook to fail

* Get some more examples working

* Working `ram` example

* Sync with changes in `main` after rebasing

* Working `embassy_spi` example

* Use a git dependency for the PAC until we publish a release

* Fix I2S for ESP32-C6

* Fix esp32c6 direct boot (#4)

* Add direct boot support for C6

* Fix direct boot for c6

- Actually copy into rtc ram
- remove dummy section that is no longer needed (was just a waste of
  flash space)
- Move RTC stuff before the no load sections

* Update RWDT and refactor RTC (#3)

* C6: Update RWDT and add example, refactor RTC and add not-really-good example

* Update based on review comments, resolve bunch of warnings and run cargo fmt

* Update C6 esp-pacs rev commit

* Fix clocks_ll/esp32c6.rs

* Fix riscv interrupts

* Remove clock_monitor example for now

* RAM example works in direct-boot mode

* Add a TODO for &mut TIMG0 and cargo fmt

* Fix linker script after a bad rebase

* Update CI and Cargo.toml embassy required features

* use riscv32imac-unknown-none-elf target for C6 in CI

* change default target to riscv32imac-unknown-none-elf

* add riscv32imac-unknown-none-elf target to MSRV job

* another cleanup

---------

Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Jesse Braham <jesse@beta7.io>

* Make required changes to include new `RADIO` peripheral

* Use published versions of PAC and `esp-println`

* Use the correct target extensions (`imac`)

* Fix the super watchdog timer, plus a few more examples

* Fix UART clock configuration

* Make sure to sync UART registers when configuring AT cmd detection

* Disable APM in direct-boot mode

* Address a number of review comments

* Fix `SPI` clocks and `rtc_watchdog` example  (#6)

* fix SPI clocks

* run cargo fmt

* Add comment about used default clk src

* Fix rtc_watchdog example in BL mode

* run cargo fmt

* Update rtc_watchdog example that it works in DB mode

* README and example fixes/cleanup

* Add I2C peripheral enable and reset

* Fix `ApbSarAdc` configuration in `system.rs`

---------

Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
Co-authored-by: Scott Mabin <scott@mabez.dev>
2023-02-27 09:15:44 -08:00
Jesse Braham
bfa1bd901e New releases for esp-hal-common and esp32c2-hal packages 2023-02-22 11:19:42 -08:00
Björn Quentin
f4c7bf809f
Merge pull request #401 from bjoernQ/bugfix/fix-esp32c2-ets_update_cpu_frequency_rom
ESP32-C2: ets_update_cpu_frequency_rom fix
2023-02-22 13:08:57 +01:00
bjoernQ
820fdab53c ESP32-C2: ets_update_cpu_frequency_rom fix 2023-02-22 12:58:19 +01:00
C2D
862b8580b7 Fix the SPI alignment fix 2023-02-21 11:44:36 -08:00
Jesse Braham
d3969c3130 New releases for all HAL packages 2023-02-21 07:43:44 -08:00
Scott Mabin
80996e3b6e
Add RADIO peripheral (#397)
* Allow the creation of peripherals _not_ from the pac in the peripherals macro

* Add RADIO peripheral

- Remove DerefMut hack, replace with proper Sealed impls
- Add RADIO peripheral for all chips

* Add RADIO peripheral with split method into each radio feature
2023-02-21 07:08:08 -08:00
Björn Quentin
609fa2c507
Merge pull request #395 from bjoernQ/fix/hidden-buffer-alignment-requirement-spi
Fix hidden alignment requirement (SPI)
2023-02-20 14:47:04 +01:00
Björn Quentin
0b9ebbcc79
Fix direct boot linker script for ESP32-C2/C3 (#396) 2023-02-20 13:40:12 +00:00
bjoernQ
a01ecedb0f Fix hidden alignment requirement (SPI) 2023-02-20 12:53:52 +01:00
Björn Quentin
9fa59fe127
Merge pull request #394 from RepeatedRoot/features/esp32-26mhz-support
Add support for 26Mhz xtal in ESP32-HAL
2023-02-16 08:50:54 +01:00
RepeatedRoot
912ab3008e
add support for 26mhz esp32 2023-02-16 16:54:26 +10:30
Björn Quentin
5284fc0cf3
Merge pull request #393 from bjoernQ/re-export-xtensa-lx-rt
Make sure to re-export xtensa-lx-rt
2023-02-13 12:51:00 +01: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
df891b4b02
Merge pull request #384 from bjoernQ/erased-pin
Erased Pin
2023-02-08 15:00:39 +01:00
Björn Quentin
ab9aeb2443 AnyPin 2023-02-08 14:31:54 +01:00
Björn Quentin
94471721b6
Merge pull request #389 from bjoernQ/bugfix/fix-circular-dma
Fix (I2S) circular DMA
2023-02-08 13:21:02 +01:00
bjoernQ
e581f7c212 Fix (I2S) circular DMA 2023-02-08 13:14:36 +01:00
Björn Quentin
7c2da6a4a3
Merge pull request #390 from bjoernQ/bugfix/allow-into_analog-for-InputOnlyAnalog-pins
Allow `into_analog` for all analog capable pins
2023-02-08 13:01:10 +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
bjoernQ
08c01355ae Allow into_analog for all analog capable pins 2023-02-08 10:27:46 +01:00
Sergio Gasquez Arcos
e65cacee58
Fix CI warnings (#379)
* ci: ️ Replace `actions-rs/toolchain` by `dtolnay/rust-toolchain`

* ci: ⬆️ Bump `actions/checkout`

* ci: ⬆️ Bump `Swatinem/rust-cache`
2023-02-02 06:59:28 -08:00
Jesse Braham
75f7394986 Fix the references to the ets_update_cpu_frequency_rom ROM function 2023-01-31 09:13:22 -08:00
Scott Mabin
2b2df2dbbd
Preemptively add cfg's needed in upcoming releases for s2 (#371) 2023-01-31 11:21:07 +00:00
Scott Mabin
925e874bb5 Remove references to imac target to avoid confusion. 2023-01-30 12:03:08 -08:00
Jesse Braham
c0eaa91a6f Fix examples after a bad rebase 2023-01-27 11:06:29 -08:00
Jesse Braham
cf270700e7
Use the new esp-riscv-rt package for RISC-V HALs (#365)
* Update PACs and modify `esp-hal-common` to use new `esp-riscv-rt` package

* Update `esp32c2-hal` and `esp32c3-hal` to use `esp-riscv-rt` as well

* Update all RISC-V examples to use `esp-riscv-rt`

* Update RISC-V trap frame handling according to review feedback
2023-01-27 10:49:38 -08: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
d6c4e3e43f Update the name of the INTERRUPT peripheral to INTERRUPT_CORE0 2023-01-27 07:06:07 -08:00