* Provide ADC values in mV instead of requiring the user to scale them
* Changelog
* Try converting poly calibration also
* Update changelog and comments
* Fix example
* Force frame pointers for RISC-V chips
* Various dependency updates
* Update to latest published PACs and resolve build errors
* Top-level `README` updates
* Further clarify when `RUSCT_BOOTSTRAP=1` is required
* Fix Async UART
The uart handler was `writing` to the enable register instead of
`modify`, which meant any wake would see the cleared enabled bit and
think the event had occurred. This wasn't seen before the split of uart
because it was only possible to listen to one thing at a time.
This PR also removes the ReadBufferFull error in favour of returning the
max bytes in the buffer.
The serial examples has been updated to actually have some cross task
communication.
* changelog
* fix dev deps
* Move SPI-related traits into their own preludes in the `spi` module
* Remove the `embedded-hal-async` trait re-exports and the `eh1` module from the prelude
* Update `CHANGELOG.md`
* Remove duplicated `analog` modules, which are not necessary
* Merge the `SarAdcExt` and `SensExt` traits into a single `AnalogExt` trait
* Clean up/simplify the analog module a bit
* Update `CHANGELOG.md`
* Refactor the `spi` and `spi_slave` modules into a single `spi` module
* Update import paths in examples as needed
* Extract some common types from `spi::master` into the root `spi` module
* Fix imports in examples (again)
* Documentation fixes/improvements
* Remove unnecessary re-exports
* Update `CHANGELOG.md`
* Duplicate spi to spi_slave
* Restore spi
* Add barebones SPI slave mode, DMA only.
This setup allows registering buffers for future transactions the master
does (lowering cs, toggling sclk, and raising cs again). The transfer
struct returned from the registration API will complete its wait() or
return true from is_done() after cs has been raised.
Copied from spi.rs, so most of the changes are deleting code that
handles e.g. segmented transfers or synchronous operations.
Fix non-c3 devices' builds
* Limit spi_slave to non-pdma devices
* SPI slave DMA example
Ensure the API "feels" right.
Since there's no way to route GPIOs to other peripherals, we choose four
other wires and bit-bang SPI for the master side, relying on the person
running the example to connect the bus. This way we ensure the slave
code works, since we created the master ourselves.
Also, it's not really possible to use a second ESP device as the master
anyway: all the digital lines have glitches on startup, and those
glitches cause the slave's DMA engine to skip descriptors (it thinks
they're intended CS indicators); this causes it to lose data.
Then, fix the bitbang master (recording the progression here)
- When bitbanging, iterate the bits by "for _ in 0..8", instead of the
broken "for _ in [0..8]". The latter only runs the iteration once,
since there's only one list given ... and because the code uses _
instead of a real loop variable, type checking didn't save us.
- When bitbanging, send the bits out (and read them in) MSB first, since
that's actually how we have the slave configured.
* Add changelog entry
* Split DMA prepare_transfer into two fns.
The first does everything but write to the start bit and check for an
error. The second does those. We need 2 fns because the SPI slave needs
to start the transfer only after resetting the various afifo hardware
components (if it starts the transfer before, the first 8 bytes will be
lost when that reset happens).
Use the split fns everywhere.
Also split flush(). It needs to be pollable, so split it into one fn that
polls and one that waits until the poll returns clear. Also call the poll
fn from the is_done() fn, so we don't trample in-progress transfers.
* Make example code fill rx buffer before transfer
This way we can tell if it's ever touching certain bytes - 0xff is never
added to the master transmit buffer.
While I'm changing this, make the slave tx buffer never contain 0xff
either (go from 254 to 0).
---------
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
* Make sure examples can build with defmt
* Remove duplicate example checks
* Fix examples
* Add changelog entry
* Actually build some examples with defmt feature enabled
* Add the defmt linker script in each package's build script
* Unify the xtal frequency features for ESP32 and ESP32-C2
* Group and re-organize features for `esp-hal-common`
* Update `esp-hal-smartled` and fix its CI check
* Update `CHANGELOG.md`
* Update feature names in documentation
* No longer publicly expose the `PeripheralClockControl` struct
* Update examples as needed to get things building again
* Update CHANGELOG.md
* Address review feedback, fix a warning
* Use a critical section for all devices other than the ESP32-C6/H2, as they modify multiple registers
* Rebase and update `etm` driver to fix build errors
* Ensure that uart is configured to account for clock changes, not just boot defaults
* fix examples
* changelog
---------
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
* Add support for splitting esp32 uart into TX and RX
* Keeps existing API for uart, but wraps it in Tx and Rx sub-types
* Adds split() method similar to embassy-rs nRF/stm32/rp for getting indepdendent TX and RX
parts
* Implements e-h traits for TX and RX types
* Add esp32s3 example
* finish implementing
* rebase examples
* declare new examples
* fix fmt
* rebase on 0.12.0
* fix fmt
* fix fmt
* merge embassy_serial_split example with embassy_serial
* fix changelog
* fix changelog
* Add ECC driver for ESP32C2 and ESP32C6
* Add ECC example for ESP32C2 and ESP32C6
* Add and modify dependencies
* ESP32H2: Add ECC driver support
* ESP32H2: Add ECC example
* ESP32C2 and ESP32C6: clean examples
* changelog
* refactor: remove enable_interrupt() and clear_interrupt()
* refactor: remove ugly if/else logic for padding
* Bump MSRV to 1.67, check with `defmt` feature enabled in MSRV checks where applicable
* Add `esp32c6-lp-hal-procmacros` package to VS Code workspace
* Update `CHANGELOG.md`
* Executor related touchups
* Make log optional
* Add defmt feature and derive on Debug structs
* Test both log drivers
* Update esp-println
* Document defmt msrv
* Rework watchdog timer drivers to allow enabling/disabling and feeding without traits
* Disable all watchdogs prior to `main` using the `__post_init` hook
* Update all watchdog-related examples
* Update CHANGELOG
* Address review comment
* Hide internal-only RMT macros from documentation
* Document the features of each chip-specific HAL package
* Document the supported image formats for relevant packages
* Update a bunch of dependencies
* Implement `embedded-io` and `embedded-io-async` traits for USB Serial JTAG
* Implement `embedded-io` and `embedded-io-async` traits for UART
* Fix `embassy_serial` examples
* Update CHANGELOG
* Address review comments
* Use all remaining memory for stack(s)
* Remove HEAP related code from RISCV linker scripts
* Fix direct-boot / mcu-boot linker scripts
* Use a statically allocated stack for core-1
* direct vectoring support added
* provide minimal handlers for hooking the vector table directly
* changed direct vectoring interrupt enable interface to map to CPU interrupt
* direct vectoring interrupt nesting
* removed unused dependency
* added tentative c2 and c6 support for direct vector table hooking
* added direct vectoring examples
* added direct vectoring examples
* updated changelog
* added direct vectoring to CI
* Added H2 support and example, moved helpers to esp-hal-common
* Added H2 direct vectoring example to CI
* Removed remnants of removed feature
* C6 and H2 examples fixed
* C6 and H2 examples fixed
* C6 and H2 examples fixed
* Comment fixed
* Added preemption flag to RT
---------
Co-authored-by: Scott Mabin <scott@mabez.dev>
* Move segment aliasing to linkall.x, this allows other projects to define there own alias whilst still being able to use esp-hal linker scripts
* Move rwtext in front of rwdata
* Re-arrange include
* Fix s3 direct boot script
* adc_cal: c2: Add efuse functions for reading calibration
* adc_cal: c3: Add efuse functions for reading calibration
* adc_cal: c6: Add efuse functions for reading calibration
* adc_cal: Add extra traits to support calibration
- `AdcCalScheme<ADCI>` implemented for each calibration scheme (basic, linear, curved)
- `AdcCalEfuse` implemented for each ADC unit to get calibration data from efuse bits
* adc_cal: Add basic ADC calibration scheme
Basic calibration is related to setting some initial bias value to ADC unit.
Such values usually is stored in efuse bit fields but also can be measured
in runtime by connecting ADC input to ground internally.
* adc_cal: Add line fitting ADC calibration scheme
This scheme also includes basic calibration and implements gain correction based
on reference point.
Reference point is a pair of reference voltage and corresponding mean raw ADC
value. Such raw values usually is stored in efuse bit fields for each supported
attenuation.
Possibly it also can be measured in runtime by connecting ADC to reference
voltage internally.
* adc_cal: Add curve fitting ADC calibration scheme
This scheme also includes basic and linear and implements final polynomial error
correction.
* adc_cal: riscv: Add ADC calibration implementation for riscv chips
* adc_cal: c2: Add calibrated ADC reading example
This example uses line fitting calibration scheme by default.
It periodically prints both raw measured value and computed millivolts.
* adc_cal: c3: Add calibrated ADC reading example
This example uses curve fitting calibration scheme by default.
It periodically prints both raw measured value and computed millivolts.
* adc_cal: c6: Add calibrated ADC reading example
This example uses curve fitting calibration scheme by default.
It periodically prints both raw measured value and computed millivolts.
* adc_cal: riscv: Add changelog entry for ADC calibration
* Introduce a trait for DMA channels
This trait is then used to hold types related to the particular DMA channel. This change allows us to simplify user-facing types.
* Remove private type from I2s
* Remove redundant spi3 example, update examples
* Merge markdown sections
* Add changelog entry
* Add ROM MD5 definitions in linker and devices
* Add initial MD5 support
* Implement traits and add comments to MD5 module
* Add MD5 example to ESP32-C3
* Test MD5 context on the quick brown fox
* Implemenr From<Context> for Digest
* Add MD5 to the rest of the examples
* Add docs for MD5
* Remove #[repr(transparent)] from md5::Digest
* Update CHANGELOG.md