Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert release instance changes #606

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions src/can.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,8 @@ impl<CAN: Instance> Can<CAN> {
Can { can, pins }
}

pub fn release<TX, RX, E>(self) -> Result<(CAN, (TX, RX)), E>
where
TX: TryFrom<CAN::Tx, Error = E>,
RX: TryFrom<CAN::Rx, Error = E>,
{
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)
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/fmpi2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ impl<I2C: Instance> FMPI2c<I2C> {
i2c
}

pub fn release<SCL, SDA, E>(self) -> Result<(I2C, (SCL, SDA)), E>
where
SCL: TryFrom<I2C::Scl, Error = E>,
SDA: TryFrom<I2C::Sda, Error = E>,
{
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)
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,8 @@ where
i2c
}

pub fn release<SCL, SDA, E>(self) -> Result<(I2C, (SCL, SDA)), E>
where
SCL: TryFrom<I2C::Scl, Error = E>,
SDA: TryFrom<I2C::Sda, Error = E>,
{
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)
}
}

Expand Down
19 changes: 3 additions & 16 deletions src/i2s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,9 @@ impl<SPI: Instance> I2s<SPI> {
}
}

pub fn release<WS, CK, MCLK, SD, E>(self) -> Result<(SPI, (WS, CK, MCLK, SD)), E>
where
WS: TryFrom<SPI::Ws, Error = E>,
CK: TryFrom<SPI::Ck, Error = E>,
MCLK: TryFrom<SPI::Mck, Error = E>,
SD: TryFrom<SPI::Sd, Error = E>,
{
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)
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/qei.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ impl<TIM: Instance> Qei<TIM> {
}

/// Releases the TIM peripheral and QEI pins
pub fn release<PC1, PC2, E>(self) -> Result<(TIM, (PC1, PC2)), E>
where
PC1: TryFrom<<TIM as Ch<0>>::Pin, Error = E>,
PC2: TryFrom<<TIM as Ch<1>>::Pin, Error = E>,
{
Ok((self.tim, (self.pins.0.try_into()?, self.pins.1.try_into()?)))
pub fn release(self) -> (TIM, (<TIM as Ch<0>>::Pin, <TIM as Ch<1>>::Pin)) {
(self.tim, self.pins)
}
}

Expand Down
11 changes: 2 additions & 9 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,8 @@ impl<USART: Instance, WORD> Serial<USART, WORD> {
.config_stop(config))
}

pub fn release<TX, RX, E>(self) -> Result<(USART, (TX, RX)), E>
where
TX: TryFrom<USART::TxPin, Error = E>,
RX: TryFrom<USART::RxPin, Error = E>,
{
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))
}
}

Expand Down
17 changes: 3 additions & 14 deletions src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,20 +489,9 @@ impl<SPI: Instance> Spi<SPI, true, u8, Slave> {
}

impl<SPI: Instance, const BIDI: bool, W, OPERATION> Spi<SPI, BIDI, W, OPERATION> {
pub fn release<SCK, MISO, MOSI, E>(self) -> Result<(SPI, (SCK, MISO, MOSI)), E>
where
SCK: TryFrom<SPI::Sck, Error = E>,
MISO: TryFrom<SPI::Miso, Error = E>,
MOSI: TryFrom<SPI::Mosi, Error = E>,
{
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)
}
}

Expand Down