From 130210eaa904c983e6426a8ba8124579a4444f86 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sun, 10 Nov 2024 12:27:42 -0500 Subject: [PATCH] Revert "Remove unused LPSPI I/O helpers" This reverts commit 0cb3b8d320e3d2a0e43304f4beca06efba261af1. --- src/common/lpspi.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/common/lpspi.rs b/src/common/lpspi.rs index 3b050468..509065fc 100644 --- a/src/common/lpspi.rs +++ b/src/common/lpspi.rs @@ -1518,6 +1518,15 @@ where } } +/// Transmits dummy values. +struct TransmitDummies; + +impl TransmitData for TransmitDummies { + fn next_word(&mut self, _: BitOrder) -> u32 { + u32::MAX + } +} + /// Receive data into a buffer. struct ReceiveBuffer<'a, W> { /// The write position. @@ -1582,6 +1591,13 @@ where } } +/// Receive dummy data. +struct ReceiveDummies; + +impl ReceiveData for ReceiveDummies { + fn next_word(&mut self, _: u32) {} +} + /// Computes how may Ws fit inside a LPSPI word. const fn per_word() -> usize { core::mem::size_of::() / core::mem::size_of::()