Skip to content

Commit

Permalink
Revert "Remove unused LPSPI I/O helpers"
Browse files Browse the repository at this point in the history
This reverts commit 0cb3b8d.
  • Loading branch information
mciantyre committed Dec 1, 2024
1 parent 402580a commit 130210e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/common/lpspi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<W: Word>() -> usize {
core::mem::size_of::<u32>() / core::mem::size_of::<W>()
Expand Down

0 comments on commit 130210e

Please sign in to comment.