aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/uarte.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-04-14 22:39:53 +0200
committerDario Nieuwenhuis <[email protected]>2023-04-15 00:58:58 +0200
commitf681b9d4e5fc142ee0bb847e0e00260c932a1401 (patch)
treedb8ac2d862b497acdb96bc9b79804e75b707d67c /embassy-nrf/src/uarte.rs
parenta3ecf5caf614e17b2e1cb3d1f79d8313f2e71a63 (diff)
Remove the _todo_embedded_hal_serial impls. EH will probably not have these serial traits.
Diffstat (limited to 'embassy-nrf/src/uarte.rs')
-rw-r--r--embassy-nrf/src/uarte.rs77
1 files changed, 0 insertions, 77 deletions
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index e59b2332a..586c88b2d 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -992,80 +992,3 @@ mod eh1 {
992 type Error = Error; 992 type Error = Error;
993 } 993 }
994} 994}
995
996#[cfg(all(
997 feature = "unstable-traits",
998 feature = "nightly",
999 feature = "_todo_embedded_hal_serial"
1000))]
1001mod eha {
1002 use core::future::Future;
1003
1004 use super::*;
1005
1006 impl<'d, T: Instance> embedded_hal_async::serial::Read for Uarte<'d, T> {
1007 type ReadFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1008
1009 fn read<'a>(&'a mut self, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
1010 self.read(buffer)
1011 }
1012 }
1013
1014 impl<'d, T: Instance> embedded_hal_async::serial::Write for Uarte<'d, T> {
1015 type WriteFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1016
1017 fn write<'a>(&'a mut self, buffer: &'a [u8]) -> Self::WriteFuture<'a> {
1018 self.write(buffer)
1019 }
1020
1021 type FlushFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1022
1023 fn flush(&mut self) -> Result<(), Self::Error> {
1024 async move { Ok(()) }
1025 }
1026 }
1027
1028 impl<'d, T: Instance> embedded_hal_async::serial::Write for UarteTx<'d, T> {
1029 type WriteFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1030
1031 fn write<'a>(&'a mut self, buffer: &'a [u8]) -> Self::WriteFuture<'a> {
1032 self.write(buffer)
1033 }
1034
1035 type FlushFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1036
1037 fn flush(&mut self) -> Result<(), Self::Error> {
1038 async move { Ok(()) }
1039 }
1040 }
1041
1042 impl<'d, T: Instance> embedded_hal_async::serial::Read for UarteRx<'d, T> {
1043 type ReadFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1044
1045 fn read<'a>(&'a mut self, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
1046 self.read(buffer)
1047 }
1048 }
1049
1050 impl<'d, U: Instance, T: TimerInstance> embedded_hal_async::serial::Read for UarteWithIdle<'d, U, T> {
1051 type ReadFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1052
1053 fn read<'a>(&'a mut self, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
1054 self.read(buffer)
1055 }
1056 }
1057
1058 impl<'d, U: Instance, T: TimerInstance> embedded_hal_async::serial::Write for UarteWithIdle<'d, U, T> {
1059 type WriteFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1060
1061 fn write<'a>(&'a mut self, buffer: &'a [u8]) -> Self::WriteFuture<'a> {
1062 self.write(buffer)
1063 }
1064
1065 type FlushFuture<'a> = impl Future<Output = Result<(), Self::Error>> + 'a where Self: 'a;
1066
1067 fn flush(&mut self) -> Result<(), Self::Error> {
1068 async move { Ok(()) }
1069 }
1070 }
1071}