aboutsummaryrefslogtreecommitdiff
path: root/embassy-traits/src/uart.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-traits/src/uart.rs')
-rw-r--r--embassy-traits/src/uart.rs36
1 files changed, 0 insertions, 36 deletions
diff --git a/embassy-traits/src/uart.rs b/embassy-traits/src/uart.rs
deleted file mode 100644
index 4984bc89c..000000000
--- a/embassy-traits/src/uart.rs
+++ /dev/null
@@ -1,36 +0,0 @@
1use core::future::Future;
2
3#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[non_exhaustive]
6pub enum Error {
7 Other,
8}
9
10pub trait Read {
11 type ReadFuture<'a>: Future<Output = Result<(), Error>>
12 where
13 Self: 'a;
14
15 /// Receive into the buffer until the buffer is full.
16 fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>;
17}
18
19pub trait ReadUntilIdle {
20 type ReadUntilIdleFuture<'a>: Future<Output = Result<usize, Error>>
21 where
22 Self: 'a;
23
24 /// Receive into the buffer until the buffer is full or the line is idle after some bytes are received
25 /// Return the number of bytes received
26 fn read_until_idle<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadUntilIdleFuture<'a>;
27}
28
29pub trait Write {
30 type WriteFuture<'a>: Future<Output = Result<(), Error>>
31 where
32 Self: 'a;
33
34 /// Write all bytes in `buf`.
35 fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a>;
36}