Half-duplex read transactions should not use a write buffer. Previously,
only 3-wire half-duplex transactions followed this, but the esp-idf
error-checking logic applies to all half-duplex transactions.
This replaces the Operation enum which was previously re-exported from
embedded_hal.
As of this commit, the enum is identical to the embedded_hal Operation,
except that there is no Word type parameter, as esp-idf-hal only uses u8
for SPI. Additionally, the `#[non_exhaustive]` attribute has been added
to allow for future expansion.
The esp_reset_reason_t ESP_RST_PG and ESP_RST_CPU constant names don't
seem to exist. Instead, the actual names (added in esp-idf 5.2.2) are
ESP_RST_PWR_GLITCH and ESP_RST_CPU_LOCKUP.
The incorrect names caused the second-to-last match arm to be
interpreted as a binding name (that is, a catch-all), causing incorrect
behavior and build warnings when using esp-idf 5.2.2 and up.
* Add first version of temp sensor driver
Code is very rudimentary and still suspect to change.
Notably, error handling is not implemented yet.
* Change cfg attribute to not any
* Rename TemperatureSensor to TemperatureSensorDriver
* Switch to `core::ptr`
* Add error handling
* Build the internal temperature sensor only on supported targets
* Fix the derives in TemperatureSensorConfig, TemperatureSensorClockSource
* Implement From<TemperatureSensorConfig> for temperature_sensor_config_t
* Use right clocks for temperature sensor depending on target
* Rename config and move it into own module
* Provide const new constructor for temperature sensor config
* Change config argument to be a reference
* Rename TemperatureSensor to TempSensor
* Avoid cloning config in temp driver constructor
* Add back derived Copy trait for TempSensorClockSource
* Add non_exhaustive option to TempSensorConfig
* Add temp sensor peripheral
* Cause panic if uninstalling the temp driver fails
* Implement Send for TempSensorDriver
* Make use of esp_idf_soc_temp_sensor_supported
* Add an example for temperature_sensor
---------
Co-authored-by: Luca Barbato <lu_zero@gentoo.org>
* commit test 1
test commit 2
next device
asd
* try example, haven't built yet
* Add feature flags for legacy RMT examples
Remove references to the ds18b20 specific device.
Add a feature flag `rmt-legacy` that, when enabled, will build the
original rmt modules from v4 of the esp-idf. When disabled, the v5
rmt interface can be used for one wire applications.
Implement the Iterator trait for a device search and use the Iterator
in the example.
* Add more feature guards to examples compile
* Add alternative main functions for examples
* Use std threading
* Add std to thread sleep
* use std duration
* correct use for legacy rmt component
* Remove local bindings and use the esp-idf-sys master
* fix a typo
* Remove esp-idf component inclusion
* Update gitignore
* Fix examples
* mut-ex out the example compilation
* add implementation for temperature readings
* Conditional compile
* esp4.4 compile
* Changes to cargo and config
* Remove OWDevice and simplify API
* Remove phantomdata that is not required
* adjust lifetimes for single search at a time
* Keep RMT peripheral and add channel to onewire
Moves the RMT driver into a private `driver` module, which will only be compiled in rmt-legacy mode.
Also reduce the number of cfg feature flags in examples by wrapping the implementation in a module.
* modularise examples
* Fix for CI
* update example name to make it pop
---------
Co-authored-by: Dane Slattery <dane@polarmonitoring.com>
Co-authored-by: DaneSlattery <dane_s@umantec.net>