Cargo fmt
This commit is contained in:
parent
e36d4f460a
commit
a26ffeb84b
@ -1,9 +1,8 @@
|
|||||||
use crate::pac::CRC as PAC_CRC;
|
use crate::pac::CRC as PAC_CRC;
|
||||||
use crate::peripherals::CRC;
|
use crate::peripherals::CRC;
|
||||||
use crate::rcc::sealed::RccPeripheral;
|
use crate::rcc::sealed::RccPeripheral;
|
||||||
use embassy_hal_common::unborrow;
|
|
||||||
use embassy::util::Unborrow;
|
use embassy::util::Unborrow;
|
||||||
|
use embassy_hal_common::unborrow;
|
||||||
|
|
||||||
pub struct Crc {
|
pub struct Crc {
|
||||||
_peripheral: CRC,
|
_peripheral: CRC,
|
||||||
@ -11,7 +10,7 @@ pub struct Crc {
|
|||||||
|
|
||||||
impl Crc {
|
impl Crc {
|
||||||
/// Instantiates the CRC32 peripheral and initializes it to default values.
|
/// Instantiates the CRC32 peripheral and initializes it to default values.
|
||||||
pub fn new(peripheral: impl Unborrow<Target= CRC>) -> Self {
|
pub fn new(peripheral: impl Unborrow<Target = CRC>) -> Self {
|
||||||
// Note: enable and reset come from RccPeripheral.
|
// Note: enable and reset come from RccPeripheral.
|
||||||
// enable CRC clock in RCC.
|
// enable CRC clock in RCC.
|
||||||
CRC::enable();
|
CRC::enable();
|
||||||
@ -50,5 +49,4 @@ impl Crc {
|
|||||||
pub fn read(&self) -> u32 {
|
pub fn read(&self) -> u32 {
|
||||||
unsafe { PAC_CRC.dr().read() }
|
unsafe { PAC_CRC.dr().read() }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ use crate::pac::crc::vals;
|
|||||||
use crate::pac::CRC as PAC_CRC;
|
use crate::pac::CRC as PAC_CRC;
|
||||||
use crate::peripherals::CRC;
|
use crate::peripherals::CRC;
|
||||||
use crate::rcc::sealed::RccPeripheral;
|
use crate::rcc::sealed::RccPeripheral;
|
||||||
use embassy_hal_common::unborrow;
|
|
||||||
use embassy::util::Unborrow;
|
use embassy::util::Unborrow;
|
||||||
|
use embassy_hal_common::unborrow;
|
||||||
|
|
||||||
pub struct Crc {
|
pub struct Crc {
|
||||||
_peripheral: CRC,
|
_peripheral: CRC,
|
||||||
@ -66,7 +66,7 @@ pub enum PolySize {
|
|||||||
|
|
||||||
impl Crc {
|
impl Crc {
|
||||||
/// Instantiates the CRC32 peripheral and initializes it to default values.
|
/// Instantiates the CRC32 peripheral and initializes it to default values.
|
||||||
pub fn new(peripheral: impl Unborrow<Target= CRC>, config: Config) -> Self {
|
pub fn new(peripheral: impl Unborrow<Target = CRC>, config: Config) -> Self {
|
||||||
// Note: enable and reset come from RccPeripheral.
|
// Note: enable and reset come from RccPeripheral.
|
||||||
// enable CRC clock in RCC.
|
// enable CRC clock in RCC.
|
||||||
CRC::enable();
|
CRC::enable();
|
||||||
|
Loading…
Reference in New Issue
Block a user