Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare LPSPI driver for embedded-hal 1.0 rework #149

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix docs
  • Loading branch information
Finomnis committed Dec 23, 2023
commit 9e25bf4d26b8cda9c56e5524c354343dd10194e3
8 changes: 4 additions & 4 deletions src/common/lpspi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ impl<P, const N: u8> Lpspi<P, N> {
///
/// Note that disabling does not take effect immediately; instead the
/// peripheral finishes the current transfer and then disables itself.
/// It is required to check [`is_enabled`] repeatedly until the
/// It is required to check [`is_enabled()`](Self::is_enabled) repeatedly until the
/// peripheral is actually disabled.
pub fn set_enable(&mut self, enable: bool) {
ral::modify_reg!(ral::lpspi, self.lpspi, CR, MEN: enable as u32)
Expand Down Expand Up @@ -588,7 +588,7 @@ impl<P, const N: u8> Lpspi<P, N> {
/// to get the current state, then modify that state.
///
/// Be aware that a critical section might be required to avoid a read-modify-write race condition
/// between [`interrupts`] and [`set_interrupts`].
/// between [`interrupts`](Self::interrupts) and [`set_interrupts`](Self::set_interrupts).
pub fn set_interrupts(&self, interrupts: Interrupts) {
ral::write_reg!(ral::lpspi, self.lpspi, IER, interrupts.bits());
}
Expand Down Expand Up @@ -635,7 +635,7 @@ impl<P, const N: u8> Lpspi<P, N> {
/// Clear any existing data in the SPI receive or transfer FIFOs.
///
/// Note that this will **not** cancel a running transfer.
/// Use [`soft_reset`] for that usecase instead.
/// Use [`soft_reset()`](Self::soft_reset) for that usecase instead.
#[inline]
pub fn clear_fifo(&mut self, direction: Direction) {
match direction {
Expand All @@ -647,7 +647,7 @@ impl<P, const N: u8> Lpspi<P, N> {
/// Clear both FIFOs.
///
/// Note that this will **not** cancel a running transfer.
/// Use [`soft_reset`] for that usecase instead.
/// Use [`soft_reset()`](Self::soft_reset) for that usecase instead.
pub fn clear_fifos(&mut self) {
ral::modify_reg!(ral::lpspi, self.lpspi, CR, RTF: RTF_1, RRF: RRF_1);
}
Expand Down
Loading