mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-27 12:20:56 +00:00
implement embedded_io::ReadReady
for Uart
& UartRx
(#1702)
* implement `embedded_io::ReadReady` for `Uart` & `UartRx` * update CHANGELOG.md
This commit is contained in:
parent
eee20de116
commit
9691141fed
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Add Flex / AnyFlex GPIO pin driver (#1659)
|
||||
- Add new `DmaError::UnsupportedMemoryRegion` - used memory regions are checked when preparing a transfer now (#1670)
|
||||
- Add DmaTransactionTxOwned, DmaTransactionRxOwned, DmaTransactionTxRxOwned, functions to do owning transfers added to SPI half-duplex (#1672)
|
||||
- uart: Implement `embedded_io::ReadReady` for `Uart` and `UartRx` (#1702)
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -1662,6 +1662,28 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-io")]
|
||||
impl<T, M> embedded_io::ReadReady for Uart<'_, T, M>
|
||||
where
|
||||
T: Instance,
|
||||
M: Mode,
|
||||
{
|
||||
fn read_ready(&mut self) -> Result<bool, Self::Error> {
|
||||
self.rx.read_ready()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-io")]
|
||||
impl<T, M> embedded_io::ReadReady for UartRx<'_, T, M>
|
||||
where
|
||||
T: Instance,
|
||||
M: Mode,
|
||||
{
|
||||
fn read_ready(&mut self) -> Result<bool, Self::Error> {
|
||||
Ok(T::get_rx_fifo_count() > 0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-io")]
|
||||
impl<T, M> embedded_io::Write for Uart<'_, T, M>
|
||||
where
|
||||
|
Loading…
x
Reference in New Issue
Block a user