diff --git a/CHANGELOG.md b/CHANGELOG.md index c7b1913c..1990aaaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - - Add `lapce` editor settrings [#601] + - Add `lapce` editor settings [#601] - Use `enum`s for alternate peripheral pins [#594] - Added missing U(S)ART DMA traits for HAL serial types [#593] - Improve SPI::new* docs [#587] @@ -16,6 +16,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fix comlementary for independent channels [#599] [#603] - I2c dma can now use single DMA channel for TX or RX only [#598] +[#585]: https://github.com/stm32-rs/stm32f4xx-hal/pull/585 +[#593]: https://github.com/stm32-rs/stm32f4xx-hal/pull/593 +[#594]: https://github.com/stm32-rs/stm32f4xx-hal/pull/594 +[#595]: https://github.com/stm32-rs/stm32f4xx-hal/pull/595 +[#598]: https://github.com/stm32-rs/stm32f4xx-hal/pull/598 +[#599]: https://github.com/stm32-rs/stm32f4xx-hal/pull/599 +[#601]: https://github.com/stm32-rs/stm32f4xx-hal/pull/601 +[#603]: https://github.com/stm32-rs/stm32f4xx-hal/pull/603 + ## [v0.15.0] - 2023-03-13 ### Changed @@ -49,11 +58,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). [#577]: https://github.com/stm32-rs/stm32f4xx-hal/pull/577 [#578]: https://github.com/stm32-rs/stm32f4xx-hal/pull/578 [#581]: https://github.com/stm32-rs/stm32f4xx-hal/pull/581 -[#594]: https://github.com/stm32-rs/stm32f4xx-hal/pull/594 -[#595]: https://github.com/stm32-rs/stm32f4xx-hal/pull/595 -[#599]: https://github.com/stm32-rs/stm32f4xx-hal/pull/599 -[#601]: https://github.com/stm32-rs/stm32f4xx-hal/pull/601 -[#603]: https://github.com/stm32-rs/stm32f4xx-hal/pull/603 ## [v0.14.0] - 2022-12-12 diff --git a/src/can.rs b/src/can.rs index eb8ffebc..442cd83e 100644 --- a/src/can.rs +++ b/src/can.rs @@ -95,12 +95,8 @@ impl Can { Can { can, pins } } - pub fn release(self) -> Result<(CAN, (TX, RX)), E> - where - TX: TryFrom, - RX: TryFrom, - { - Ok((self.can, (self.pins.0.try_into()?, self.pins.1.try_into()?))) + pub fn release(self) -> (CAN, (CAN::Tx, CAN::Rx)) { + (self.can, self.pins) } } diff --git a/src/fmpi2c.rs b/src/fmpi2c.rs index 67bc9d23..c7cabd40 100644 --- a/src/fmpi2c.rs +++ b/src/fmpi2c.rs @@ -108,12 +108,8 @@ impl FMPI2c { i2c } - pub fn release(self) -> Result<(I2C, (SCL, SDA)), E> - where - SCL: TryFrom, - SDA: TryFrom, - { - Ok((self.i2c, (self.pins.0.try_into()?, self.pins.1.try_into()?))) + pub fn release(self) -> (I2C, (I2C::Scl, I2C::Sda)) { + (self.i2c, self.pins) } } diff --git a/src/i2c.rs b/src/i2c.rs index 01e452d3..c1b92246 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -182,12 +182,8 @@ where i2c } - pub fn release(self) -> Result<(I2C, (SCL, SDA)), E> - where - SCL: TryFrom, - SDA: TryFrom, - { - Ok((self.i2c, (self.pins.0.try_into()?, self.pins.1.try_into()?))) + pub fn release(self) -> (I2C, (I2C::Scl, I2C::Sda)) { + (self.i2c, self.pins) } } diff --git a/src/i2s.rs b/src/i2s.rs index 872c96dd..be2d4b60 100644 --- a/src/i2s.rs +++ b/src/i2s.rs @@ -112,22 +112,9 @@ impl I2s { } } - pub fn release(self) -> Result<(SPI, (WS, CK, MCLK, SD)), E> - where - WS: TryFrom, - CK: TryFrom, - MCLK: TryFrom, - SD: TryFrom, - { - Ok(( - self.spi, - ( - self.pins.0.try_into()?, - self.pins.1.try_into()?, - self.pins.2.try_into()?, - self.pins.3.try_into()?, - ), - )) + #[allow(clippy::type_complexity)] + pub fn release(self) -> (SPI, (SPI::Ws, SPI::Ck, SPI::Mck, SPI::Sd)) { + (self.spi, self.pins) } } diff --git a/src/qei.rs b/src/qei.rs index 9790ee68..4748f566 100644 --- a/src/qei.rs +++ b/src/qei.rs @@ -55,12 +55,8 @@ impl Qei { } /// Releases the TIM peripheral and QEI pins - pub fn release(self) -> Result<(TIM, (PC1, PC2)), E> - where - PC1: TryFrom<>::Pin, Error = E>, - PC2: TryFrom<>::Pin, Error = E>, - { - Ok((self.tim, (self.pins.0.try_into()?, self.pins.1.try_into()?))) + pub fn release(self) -> (TIM, (>::Pin, >::Pin)) { + (self.tim, self.pins) } } diff --git a/src/serial.rs b/src/serial.rs index 8cd3ce3b..59fd579d 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -554,15 +554,8 @@ impl Serial { .config_stop(config)) } - pub fn release(self) -> Result<(USART, (TX, RX)), E> - where - TX: TryFrom, - RX: TryFrom, - { - Ok(( - self.tx.usart, - (self.tx.pin.try_into()?, self.rx.pin.try_into()?), - )) + pub fn release(self) -> (USART, (USART::TxPin, USART::RxPin)) { + (self.tx.usart, (self.tx.pin, self.rx.pin)) } } diff --git a/src/spi.rs b/src/spi.rs index 3d813135..e96c3bd3 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -489,20 +489,9 @@ impl Spi { } impl Spi { - pub fn release(self) -> Result<(SPI, (SCK, MISO, MOSI)), E> - where - SCK: TryFrom, - MISO: TryFrom, - MOSI: TryFrom, - { - Ok(( - self.spi, - ( - self.pins.0.try_into()?, - self.pins.1.try_into()?, - self.pins.2.try_into()?, - ), - )) + #[allow(clippy::type_complexity)] + pub fn release(self) -> (SPI, (SPI::Sck, SPI::Miso, SPI::Mosi)) { + (self.spi, self.pins) } }