Comments (6)
I think that's probably the least painful path forward for now. We can always change it later if need be, not the end of the world.
from esp-hal.
As a note it is possible to construct the spi block as is. A valid gpio type needs to be given. E.g.
let spi = hal::spi::Spi::new::<
_,
_,
hal::gpio::Gpio0<Input<PullDown>>,
hal::gpio::Gpio0<Input<PullDown>>,
>(
peripherals.SPI2,
sclk,
mosi,
None,
None,
2u32.MHz(),
hal::spi::SpiMode::Mode1,
&mut pcc,
&clocks,
);
Maybe providing a valid No Pin type would be an easier fix. But then the user would have to provide that No Pin type in the generics
from esp-hal.
That is what I originally introduced the no-pin type for .
We need a similar solution here
from esp-hal.
Something like we have for serial:
esp-hal/esp-hal-common/src/serial.rs
Lines 134 to 151 in 34b1e09
from esp-hal.
@jessebraham to solve this like we did for UART we need a bunch of constructors which take combinations of the optional pins
while I guess for UART it was sane to have one with all four pins and one with only TX and RX I don't know how to handle this here
IMHO all 4 pins should be optional which gives 16 combinations (well 15 since "no pin at all" doesn't make sense)
maybe not all combinations are really useful but still - should I just make a suggestion of constructors and if we find something is missing, we just add it as a non-breaking change?
from esp-hal.
Closed by #122
from esp-hal.
Related Issues (20)
- TWAI is not working for ESP32-S3 HOT 3
- Latest release (v0.2.2) of `xtensa-lx-rt-proc-macros` not used by published `xtensa-lx-rt`
- Unable to Configure Prescaler for MCPWM Timer in esp-hal
- Implement touch support for `esp32s2` and `esp32s3`. HOT 1
- Add listen only and self-test mode support for TWAI
- I2C slave driver HOT 2
- TWAI HIL test HOT 1
- xtensa-lx feature not found in esp-hal HOT 4
- esp32s3: i2c async broken in #1900 HOT 5
- Make AnyPin accessible from `::gpio::AnyPin`? HOT 3
- Implement embassy_embedded_hal::SetConfig HOT 1
- Feature Request: Sleep and wake support for ESP32C2 HOT 3
- SD/MMC driver HOT 1
- esp_wifi does not compile with esp_ieee802154 imported at the same time HOT 1
- Support using `trouble` as a BLE stack HOT 1
- Remove all remaining `#![allow(missing_docs)]` attributes and finish documenting all public types HOT 2
- Update `embassy-executor` dependency in esp-hal-embassy crate.
- GPIO regression on esp32 after touch peripheral was merged HOT 2
- Provide a more robust solution for getting the current time HOT 2
- How to `Exclusive SPI Bus` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-hal.