33 Commits

Author SHA1 Message Date
ivmarkov
5532468962 Prep for a new release 2024-01-10 07:31:45 +00:00
Kevin John
c8f5bd88f0
fix: compile with esp_idf_adc_continuous_isr_iram_safe (#355)
NOTIFIER is not defined with esp_idf_adc_continuous_isr_iram_safe
2024-01-05 21:35:56 +02:00
ivmarkov
05140a3056 The crate now does build with cargo --all-features 2024-01-05 16:26:26 +00:00
ivmarkov
5620aef652 Guard the new ADC implementations 2023-10-17 20:04:53 +00:00
ivmarkov
5d86e230df #321 2023-10-17 04:46:01 +00:00
ivmarkov
ebeef0fcc8
All executors (#315)
* Support for all async executors

* Make all Notifiucation primitives a public API

* Address a small typo

* Address a small typo

* Fix CI

* Tighten the notify APIs by not taking 0s

* Fix CI

* Fix changelog

* Fix changelog

* Fix the examples

* edge-executor support moved to edge-executor

* wake-from-isr feature for edge-executor

* Fix CI

* Bugfixing

* Clippy
2023-10-06 22:01:20 +03:00
David Cuthbert
e6603eb766
Fix building for ESP32C2. (#311)
Fixes https://github.com/esp-rs/esp-idf-hal/issues/282.
2023-09-26 06:41:41 +03:00
Johannes Löthberg
8508fd2b50
Only set the chan member of adc_cali_curve_fitting_config_t on ESP-IDF > 5.0 (#308)
Signed-off-by: Johannes Löthberg <johannes.loethberg@elokon.com>
2023-09-25 09:46:17 +03:00
ivmarkov
496d42edfa new constructor; take config by ref 2023-09-18 04:37:02 +00:00
liebman
95dfc2f9f7
Adc oneshot driver (#302)
* esp-idf v5 Adc oneshot driver

* cargo fmt

* added example & cargo fmt

* fix clippy issues

* more clippy's

* even more clippy's

* handle most review comments

* AdcChannelDriver: remove ADC annotation - use T::Adc
AdcChannelDriver: remove Sync implementation
examples: update adc_oneshot

* cargo fmt
remove AdcChannelDriver::channel

* implement e-hal 0.2 Adc OneShot trait
2023-09-18 06:59:54 +03:00
ivmarkov
34be5758d7 ADC oneshot: simplify the e-hal trait impl 2023-09-16 10:19:12 +00:00
ivmarkov
4a75054198 Only accept pins which are for the same ADC unit 2023-09-13 05:50:06 +00:00
ivmarkov
bed45e741e
Upgrade to e-hal 1.0-rc1 (#295)
* Upgrade to e-hal 1.0-rc1

* e-hal is no longer alpha

* Fix for ESP IDF < 5

* Unite all delay impls in a single module

* Model delays between transactions

* SPI: Make queueing it a bit more readable

* SPI: Plug delays

* Shorten the threshold for the Delay provider

* Clippy

* Fix the examples

* SPI: Detect last transaction in the presence of delays

* SPI: Introduce CsPin

* SPI: Introduce CsPin

* SPI: Mark delays with TODO

* Clippy

* SPI: Rename CsPin to CsCtl

* Transfer_transaction not necessary
2023-09-06 09:36:48 +03:00
ivmarkov
15a06306cd h2 and c6 have a single ADC unit 2023-08-28 11:38:27 +00:00
ivmarkov
8cc193aa35
TWAI driver async hack; examples cleanup (#292)
* Hacky async TWAI driver

* Async TWAI: Custom priority and pin to core

* Async TWAI: Proper configuration of alerts

* Do not refer to esp-idf-sys as it is not an explicit dependency anymore
2023-08-27 10:47:18 +03:00
ivmarkov
9fc2e8c61e
Async drivers (#279)
* Continuous mode ADC

* GPIO: Switch to the common notification; remove alloc req for async

* (WIP) async SPI

* Notification callbacks in async SPI

* SPI: Lower the code repetition

* Fix the build

* I2S pre-async simplification

* Async methods for I2S

* SPI: Wait for the transaction to complete on drop

* More flexibility in PinDriver::wait_for

* Remove the gargantuan mutex for now

* Arrays supported as ADC channels

* Fix timeouts

* ADC: measurement shape

* Fix the dependencies

* Fix CI

* ADC: cont config

* ADC: better atten API; fix delays

* ADC: Raw handle access

* I2S: Make config more symmetric with the other drivers

* I2S: Remove unnecessary generics

* Improve the semantics of read/write vrt partial r/w

* Review feedback

* Clippy

* Shorten static array initializers

* Do not glob-import all of esp-idf-sys

* SPI: make notifications non-static

* SPI: Remove the async fetch() hack; extend async support

* Fix the CI

* SPI: Restore WriteIter impl

* Bugfix: tx/rx handles mismatch

* I2S: Utility methods to write the whole buffer

* I2S Bugfix: wrong translation to native format

* More ergonomic API for TickType

* unsubscribe during reset will fail if ISR service is not enabled yet

* Typo

* Same defaults

* No need for unsafe here

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

* Assert that ESP_ERR_TIMEOUT should never happen

* Safe variant of completion

* ADC: wrong timeout conversion

* Proof of posession of i2s0/spi3 for esp32/esp32s2

* write_async only available on ESP IDF 5+

* Option to transmute the adc buffer to pcm

* ADC: only expose PCM conversion where it is possible (esp32/esp32s2)

* ADC: Fix channel chaining

* ADC: fix the CI

* ADC: Nullify everything

* ADC: as_pcm32 for riscv and esp32s3

* ADC: as_pcm32 for riscv and esp32s3

* ADC: read_raw

* I2S: Proper driver shutdown

* ADC: Fix clippy and compile errors on ESP-IDF 4

* Compat with ESP-IDF master

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2023-08-22 15:39:02 +03:00
ivmarkov
d5dce7f108 New chips 2023-05-08 20:19:52 +00:00
Ronen Ulanovsky
d64b1fe366
adjust for esp-idf-sys size_t u32->usize (#185) 2022-12-09 08:20:28 +02:00
ivmarkov
57dc82715f clippy 2022-11-23 07:56:16 +02:00
ivmarkov
9a17a18723 make clippy happy 2022-10-09 11:44:04 +03:00
ivmarkov
a8c26ed5c0 Fix broken rebase
make clippy happy

fix the ulp build

Remove embedded-svc dependency

no-alloc
2022-09-18 11:01:33 +03:00
Ivan Markov
2ace88dc58 PeripheralRef support; critical-section support 2022-09-18 11:01:33 +03:00
ivmarkov
dfba3a6a52 ESP IDF 5 compat 2022-09-17 19:10:05 +03:00
ivmarkov
ca2626a7af ESP-IDF 5.0 compat 2022-09-16 13:51:26 +03:00
Scott Mabin
fc3cc99c94
As per 'https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/release-5.x/peripherals.html#adc', the hall sensor is now unsupported (#118) 2022-08-19 16:20:18 +03:00
ivmarkov
ceb9dea245 ADC_ATTEN_MAX no longer defined in ESP-IDF master 2022-05-16 09:36:13 +03:00
ivmarkov
e441b44daf Compatibility with CMake build 2022-05-02 15:26:27 +03:00
Dominic Fischer
b134d3dbc6
Migrate to e-hal 1.0.0-alpha.8 (#61)
* Migrate e-hal 1.0.0-alpha.8

* Implement SpiDevice trait

* Fix bugs after real testing

* Fix transfer
2022-04-17 08:14:39 +03:00
Ivan Markov
73181d3730
Ulp fsm peripheral (#37)
* ULP peripheral; ULP HAL code renamed

* Use an enum for the chip cores

* riscv-ulp-hal feature bugfixes

* Fix the CI for ULP as well
2022-01-19 21:35:44 +02:00
Ivan Markov
2d0554d987
Compatibility with embedded-hal-V1; CANBus support (#34)
* upgrade to embedded-hal 1.0.0-alpha.6

This version has CAN traits. So this is prerequisite for adding CAN support.

* update upl/delay.rs traits

* use error type that preserves original EspError

* First cut of dual support: i2c, spi, gpio

* More dual-hal support: adc, serial

* Canbus support (thanks to @andresv)

* Stop the can driver first

* esp-idf driver expects bit length

* SPI: bus lock implementation; bugfixing

* make sure TRANS_LEN size is correct

* CAN fixes (#31)

* add CAN to peripherals.rs

* can: fix allow all filters

* can: fix can::Id types

* can: set correct bits in twai_message_t

* can: improve documentation

* ulp compatibility

* fix ULP Clippy warnings

* Bugfix: SPI transfer was broken

* New breaking release

* Move ESP-IDF CI build on a separate schedule

Co-authored-by: Andres Vahter <andres@vahter.me>
2022-01-10 13:06:36 +02:00
ivmarkov
3db84103d5 Fix ULP build 2022-01-01 17:51:20 +02:00
ivmarkov
f38ffc0ae4 Address clippy errors 2022-01-01 17:22:09 +02:00
ivmarkov
b8657d8d4a ADC 2022-01-01 17:06:19 +02:00