diff options
| -rw-r--r-- | embassy-stm32/src/can/bxcan.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/eth/v2/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/gpio.rs | 16 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/v1.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/spi/v1.rs | 6 | ||||
| -rw-r--r-- | embassy-stm32/src/usart/v1.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/usart/v2.rs | 2 |
7 files changed, 17 insertions, 15 deletions
diff --git a/embassy-stm32/src/can/bxcan.rs b/embassy-stm32/src/can/bxcan.rs index c9ed196e1..9e10a8b02 100644 --- a/embassy-stm32/src/can/bxcan.rs +++ b/embassy-stm32/src/can/bxcan.rs | |||
| @@ -5,7 +5,7 @@ use embassy::util::Unborrow; | |||
| 5 | use embassy_hal_common::unborrow; | 5 | use embassy_hal_common::unborrow; |
| 6 | 6 | ||
| 7 | use crate::gpio::{ | 7 | use crate::gpio::{ |
| 8 | OutputType::{OpenDrain, PushPull}, | 8 | sealed::OutputType::{OpenDrain, PushPull}, |
| 9 | Pin, | 9 | Pin, |
| 10 | }; | 10 | }; |
| 11 | use crate::{peripherals, rcc::RccPeripheral}; | 11 | use crate::{peripherals, rcc::RccPeripheral}; |
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index 5d4151ecd..8eb7c3393 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs | |||
| @@ -10,7 +10,7 @@ use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; | |||
| 10 | 10 | ||
| 11 | use crate::gpio::sealed::Pin as __GpioPin; | 11 | use crate::gpio::sealed::Pin as __GpioPin; |
| 12 | use crate::gpio::Pin as GpioPin; | 12 | use crate::gpio::Pin as GpioPin; |
| 13 | use crate::gpio::{AnyPin, OutputType::PushPull}; | 13 | use crate::gpio::{sealed::OutputType::PushPull, AnyPin}; |
| 14 | use crate::pac::gpio::vals::Ospeedr; | 14 | use crate::pac::gpio::vals::Ospeedr; |
| 15 | use crate::pac::{ETH, RCC, SYSCFG}; | 15 | use crate::pac::{ETH, RCC, SYSCFG}; |
| 16 | use crate::peripherals; | 16 | use crate::peripherals; |
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index d5792d6f7..14f2559e1 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs | |||
| @@ -55,14 +55,6 @@ impl From<Speed> for vals::Ospeedr { | |||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | /// Type settings | ||
| 59 | #[derive(Debug)] | ||
| 60 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 61 | pub enum OutputType { | ||
| 62 | PushPull, | ||
| 63 | OpenDrain, | ||
| 64 | } | ||
| 65 | |||
| 66 | /// GPIO input driver. | 58 | /// GPIO input driver. |
| 67 | pub struct Input<'d, T: Pin> { | 59 | pub struct Input<'d, T: Pin> { |
| 68 | pub(crate) pin: T, | 60 | pub(crate) pin: T, |
| @@ -272,6 +264,14 @@ impl<'d, T: Pin> InputPin for OutputOpenDrain<'d, T> { | |||
| 272 | pub(crate) mod sealed { | 264 | pub(crate) mod sealed { |
| 273 | use super::*; | 265 | use super::*; |
| 274 | 266 | ||
| 267 | /// Output type settings | ||
| 268 | #[derive(Debug)] | ||
| 269 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 270 | pub enum OutputType { | ||
| 271 | PushPull, | ||
| 272 | OpenDrain, | ||
| 273 | } | ||
| 274 | |||
| 275 | pub trait Pin { | 275 | pub trait Pin { |
| 276 | fn pin_port(&self) -> u8; | 276 | fn pin_port(&self) -> u8; |
| 277 | 277 | ||
diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index c7b7c81fd..c5d5dee0c 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs | |||
| @@ -9,7 +9,7 @@ use embedded_hal::blocking::i2c::WriteRead; | |||
| 9 | 9 | ||
| 10 | use crate::pac::i2c; | 10 | use crate::pac::i2c; |
| 11 | 11 | ||
| 12 | use crate::gpio::OutputType::OpenDrain; | 12 | use crate::gpio::sealed::OutputType::OpenDrain; |
| 13 | 13 | ||
| 14 | pub struct I2c<'d, T: Instance> { | 14 | pub struct I2c<'d, T: Instance> { |
| 15 | phantom: PhantomData<&'d mut T>, | 15 | phantom: PhantomData<&'d mut T>, |
diff --git a/embassy-stm32/src/spi/v1.rs b/embassy-stm32/src/spi/v1.rs index 297d232bc..53d8252e6 100644 --- a/embassy-stm32/src/spi/v1.rs +++ b/embassy-stm32/src/spi/v1.rs | |||
| @@ -2,9 +2,11 @@ | |||
| 2 | 2 | ||
| 3 | use crate::dma::NoDma; | 3 | use crate::dma::NoDma; |
| 4 | use crate::gpio::{ | 4 | use crate::gpio::{ |
| 5 | sealed::Pin, | 5 | sealed::{ |
| 6 | OutputType::{OpenDrain, PushPull}, | ||
| 7 | Pin, | ||
| 8 | }, | ||
| 6 | AnyPin, | 9 | AnyPin, |
| 7 | OutputType::{OpenDrain, PushPull}, | ||
| 8 | }; | 10 | }; |
| 9 | use crate::pac::spi; | 11 | use crate::pac::spi; |
| 10 | use crate::spi::{ | 12 | use crate::spi::{ |
diff --git a/embassy-stm32/src/usart/v1.rs b/embassy-stm32/src/usart/v1.rs index 16c1af387..d1dd68305 100644 --- a/embassy-stm32/src/usart/v1.rs +++ b/embassy-stm32/src/usart/v1.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | use crate::gpio::OutputType::{OpenDrain, PushPull}; | 1 | use crate::gpio::sealed::OutputType::{OpenDrain, PushPull}; |
| 2 | use core::future::Future; | 2 | use core::future::Future; |
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use embassy::util::Unborrow; | 4 | use embassy::util::Unborrow; |
diff --git a/embassy-stm32/src/usart/v2.rs b/embassy-stm32/src/usart/v2.rs index e3f88c0aa..5e6696351 100644 --- a/embassy-stm32/src/usart/v2.rs +++ b/embassy-stm32/src/usart/v2.rs | |||
| @@ -13,7 +13,7 @@ use futures::TryFutureExt; | |||
| 13 | 13 | ||
| 14 | use super::*; | 14 | use super::*; |
| 15 | use crate::dma::NoDma; | 15 | use crate::dma::NoDma; |
| 16 | use crate::gpio::OutputType::{OpenDrain, PushPull}; | 16 | use crate::gpio::sealed::OutputType::{OpenDrain, PushPull}; |
| 17 | use crate::pac::usart::{regs, vals}; | 17 | use crate::pac::usart::{regs, vals}; |
| 18 | 18 | ||
| 19 | pub struct Uart<'d, T: Instance, TxDma = NoDma, RxDma = NoDma> { | 19 | pub struct Uart<'d, T: Instance, TxDma = NoDma, RxDma = NoDma> { |
