From d18bc2718a51ec0959173128fcb8599c2639807a Mon Sep 17 00:00:00 2001 From: Gray Olson Date: Sun, 29 Oct 2023 15:01:21 +0100 Subject: [PATCH] switch new_with_data_size impl block --- rp2040-hal/src/spi.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rp2040-hal/src/spi.rs b/rp2040-hal/src/spi.rs index e2ff3d287..ea3cf60ce 100644 --- a/rp2040-hal/src/spi.rs +++ b/rp2040-hal/src/spi.rs @@ -269,21 +269,22 @@ impl> Spi { state: PhantomData, } } +} - /// Create new (not initialized) Spi bus with a non-default data size. +impl, const DS: u8> Spi { + /// Create new (not initialized) Spi bus with a non-default data size, provided + /// as a const generic parameter. /// /// Initialize it with [`.init`][Self::init] /// or [`.init_slave`][Self::init_slave]. - pub fn new_with_data_size(device: D, pins: P) -> Spi { + pub fn new_with_data_size(device: D, pins: P) -> Spi { Spi { device, pins, state: PhantomData, } } -} -impl, const DS: u8> Spi { /// Set format and datasize fn set_format(&mut self, data_bits: u8, frame_format: FrameFormat) { self.device.sspcr0.modify(|_, w| unsafe {