From 16bb6fd6ac34646f498424459b8eb6863635b119 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 21 Mar 2021 20:52:20 +0100 Subject: [PATCH] nrf: Specify `connected` bit in psel_bits --- embassy-nrf/src/spim.rs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs index 33005188..f0c6ebe1 100644 --- a/embassy-nrf/src/spim.rs +++ b/embassy-nrf/src/spim.rs @@ -55,9 +55,9 @@ impl<'d, T: Instance> Spim<'d, T> { let r = spim.regs(); // Configure pins - sck.conf().write(|w| w.dir().output()); - mosi.conf().write(|w| w.dir().output()); - miso.conf().write(|w| w.input().connect()); + sck.conf().write(|w| w.dir().output().drive().h0h1()); + mosi.conf().write(|w| w.dir().output().drive().h0h1()); + miso.conf().write(|w| w.input().connect().drive().h0h1()); match config.mode.polarity { Polarity::IdleHigh => { @@ -71,18 +71,9 @@ impl<'d, T: Instance> Spim<'d, T> { } // Select pins. - r.psel.sck.write(|w| { - unsafe { w.bits(sck.psel_bits()) }; - w.connect().connected() - }); - r.psel.mosi.write(|w| { - unsafe { w.bits(mosi.psel_bits()) }; - w.connect().connected() - }); - r.psel.miso.write(|w| { - unsafe { w.bits(miso.psel_bits()) }; - w.connect().connected() - }); + r.psel.sck.write(|w| unsafe { w.bits(sck.psel_bits()) }); + r.psel.mosi.write(|w| unsafe { w.bits(mosi.psel_bits()) }); + r.psel.miso.write(|w| unsafe { w.bits(miso.psel_bits()) }); // Enable SPIM instance. r.enable.write(|w| w.enable().enabled());