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)
- Expose SPI sio() setting HOT 2
- Expose interrupt state of Pin when wrapped in Input<> HOT 2
- There is currently no way to configure WDT to do anything but a system reset
- I2S write broken HOT 4
- Explore Rustls and create an example
- Caught in I2C busy loop HOT 1
- Async PARL_IO is using the wrong DMA future
- Ensure espflash is installed on all runners HOT 1
- Improving the logging performance of `esp-println` with async TX HOT 1
- Halting both cores makes `espflash` fail to reset the board with the USB-Serial-JTAG HOT 2
- Async SPI broken for ESP32 HOT 4
- Provide some way to *not* bind an interrupt handler in `Io::new` HOT 2
- Async-SPI on ESP32: Unexpected behavior HOT 1
- Async SPI - already borrowed: BorrowMutError on esp32s3 HOT 3
- The `embedded_hal_async::delay::DelayNs` trait is not implemented for `delay::Delay` or `timer::timg::Timer` HOT 1
- Should we remove the `embedded-hal-nb` trait implementations? HOT 3
- Cannot build esp-wifi. toml_cfg errors HOT 6
- Can't produce more than 16MHz from the LEDC driver on the ESP32-C6
- psram-80mhz feature is broken for octal psram. HOT 1
- /esp-hal/src/timer/timg.rs examples do not work for TimerGroup 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.