Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Implement enabling/disabling BLE clock on ESP32-C6 (#784)
- Async support for RMT (#787)
- Implement `defmt::Format` for more types (#786)
- Add new_no_miso to Spi FullDuplexMode (#794)

### Changed

Expand Down
24 changes: 24 additions & 0 deletions esp-hal-common/src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,30 @@ where
Self::new_internal(spi, frequency, mode, peripheral_clock_control, clocks)
}

/// Constructs an SPI instance in 8bit dataframe mode without MISO pin.
pub fn new_no_miso<SCK: OutputPin, MOSI: OutputPin, CS: OutputPin>(
spi: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = SCK> + 'd,
mosi: impl Peripheral<P = MOSI> + 'd,
cs: impl Peripheral<P = CS> + 'd,
frequency: HertzU32,
mode: SpiMode,
peripheral_clock_control: &mut PeripheralClockControl,
clocks: &Clocks,
) -> Spi<'d, T, FullDuplexMode> {
crate::into_ref!(spi, sck, mosi, cs);
sck.set_to_push_pull_output()
.connect_peripheral_to_output(spi.sclk_signal());

mosi.set_to_push_pull_output()
.connect_peripheral_to_output(spi.mosi_signal());

cs.set_to_push_pull_output()
.connect_peripheral_to_output(spi.cs_signal());

Self::new_internal(spi, frequency, mode, peripheral_clock_control, clocks)
}

/// Constructs an SPI instance in 8bit dataframe mode without CS and MISO
/// pin.
pub fn new_no_cs_no_miso<SCK: OutputPin, MOSI: OutputPin>(
Expand Down