mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-28 21:00:59 +00:00

* 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>
esp-hal-common
no_std
HAL implementations for the peripherals which are common among Espressif devices. Implements a number of the traits defined by embedded-hal.
This crate should not be used directly; you should use one of the device-specific HAL crates instead:
Documentation
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.