Skip to content

Commit

Permalink
Add a reset function that disabled peripheral and then re-enables it
Browse files Browse the repository at this point in the history
  • Loading branch information
sakian committed Apr 11, 2024
1 parent 63ec6f8 commit db7e69b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hal/src/sercom/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,13 @@ where
self.config.as_mut().regs.disable();
self.config
}

/// Disable and then re-enable the SPI peripheral
#[inline]
pub fn reset(&mut self) {
self.config.as_mut().regs.disable();
self.config.as_mut().regs.enable();
}
}

#[cfg(feature = "min-samd51g")]
Expand Down

0 comments on commit db7e69b

Please sign in to comment.