-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPI: Implement more SPI traits from embedded-hal 1.0.0-alpha.8 #101
Commits on Aug 17, 2022
-
common/spi: Turn fifo size into const
instead of hard-coding it into the code in various places.
Configuration menu - View commit details
-
Copy full SHA for 38fb8cd - Browse repository at this point
Copy the full SHA 38fb8cdView commit details -
common/spi: Alias
write_bytes
tosend_bytes
since they share the same interface and the same code anyway.
Configuration menu - View commit details
-
Copy full SHA for 0fdc54b - Browse repository at this point
Copy the full SHA 0fdc54bView commit details -
common/spi: Implement
read_bytes
as counterpart to `send_bytes` that is responsible only for reading bytes received via SPI.
Configuration menu - View commit details
-
Copy full SHA for 5d198f4 - Browse repository at this point
Copy the full SHA 5d198f4View commit details -
to use `send_bytes` and `read_bytes` under the hood and remove duplicate code.
Configuration menu - View commit details
-
Copy full SHA for c76ba07 - Browse repository at this point
Copy the full SHA c76ba07View commit details -
common/spi: Create submodule for embedded_hal_1
that is re-exported when the `eh1` feature flag is active. This removes lots of duplicate `#[cfg(...)]` macros previously part of the code.
Configuration menu - View commit details
-
Copy full SHA for cc9e522 - Browse repository at this point
Copy the full SHA cc9e522View commit details -
common/spi: Implement
SpiBus
andSpiBusWrite
traits from the `embedded-hal 1.0.0-alpha.8`.
Configuration menu - View commit details
-
Copy full SHA for 9a9299b - Browse repository at this point
Copy the full SHA 9a9299bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ba1c781 - Browse repository at this point
Copy the full SHA ba1c781View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38b831d - Browse repository at this point
Copy the full SHA 38b831dView commit details -
esp32-hal/examples/spi_eh1: Add huge transfer
and bump the SPI speed to 1 MHz.
Configuration menu - View commit details
-
Copy full SHA for 1097877 - Browse repository at this point
Copy the full SHA 1097877View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45fd580 - Browse repository at this point
Copy the full SHA 45fd580View commit details -
common/spi: Use
memcpy
to read from registersThis cuts down the time between consecutive transfers from about 2 ms to less than 1 ms.
Configuration menu - View commit details
-
Copy full SHA for 9a26920 - Browse repository at this point
Copy the full SHA 9a26920View commit details -
WIP: common/spi: Use
ptr::copy
to fill write FIFOcutting down the time between transfers from just below 1 ms to ~370 us. The implementation is currently broken in that it will always fill the entire FIFO from the input it is given, even if that isn't FIFO-sized...
Configuration menu - View commit details
-
Copy full SHA for 4ead721 - Browse repository at this point
Copy the full SHA 4ead721View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83bc3b4 - Browse repository at this point
Copy the full SHA 83bc3b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 558b29b - Browse repository at this point
Copy the full SHA 558b29bView commit details -
esp32/examples/spi_eh1: Add conditional compile
and compile a dummy instead when the "eh1" feature isn't present.
Configuration menu - View commit details
-
Copy full SHA for 68a52a6 - Browse repository at this point
Copy the full SHA 68a52a6View commit details -
esp32-hal: Ignore spi_eh1 example
in normal builds, where the feature flag "eh1" isn't given. Building the example directly via `cargo build --example spi_eh1_loopback` will now print an error that this requires a feature flag to be active.
Configuration menu - View commit details
-
Copy full SHA for 37a9d9f - Browse repository at this point
Copy the full SHA 37a9d9fView commit details -
and drop `send_bytes` instead. Previoulsy, both served the same purpose, but `send_bytes` was introduced more recently and is hence less likely to cause breaking changes in existing code.
Configuration menu - View commit details
-
Copy full SHA for 13c5cd7 - Browse repository at this point
Copy the full SHA 13c5cd7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d95e47 - Browse repository at this point
Copy the full SHA 7d95e47View commit details -
Configuration menu - View commit details
-
Copy full SHA for 64fd4ea - Browse repository at this point
Copy the full SHA 64fd4eaView commit details -
The previous `read` implementation would only read the contents of the SPI receive FIFO and return that as data. However, the `SpiBusRead` trait defines that while reading, bytes should be written out to the bus (Because SPI is transactional, without writing nothing can be read). Reimplements the `embedded-hal` traits to correctly implement this behavior.
Configuration menu - View commit details
-
Copy full SHA for fbab507 - Browse repository at this point
Copy the full SHA fbab507View commit details -
common/spi: Use full FIFO size on all variants
All esp variants except for the esp32s2 have a 64 byte FIFO, whereas the esp32s2 has a 72 byte FIFO.
Configuration menu - View commit details
-
Copy full SHA for dd2ad09 - Browse repository at this point
Copy the full SHA dd2ad09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 50a695f - Browse repository at this point
Copy the full SHA 50a695fView commit details -
common/spi: Fix reading bytes from FIFO
by reverting to the old method of reading 32 bytes at a time and assembling the return buffer from that. It turns out that the previous `core::slice::from_raw_parts()` doesn't work for the esp32s2 and esp32s3 variants, returning bogus data even though the correct data is present in the registers.
Configuration menu - View commit details
-
Copy full SHA for 4ceffd9 - Browse repository at this point
Copy the full SHA 4ceffd9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d04587 - Browse repository at this point
Copy the full SHA 2d04587View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1938c90 - Browse repository at this point
Copy the full SHA 1938c90View commit details