@@ -38,6 +38,18 @@ pub trait CharacterMatch {
38
38
fn check_character_match ( & mut self , clear : bool ) -> bool ;
39
39
}
40
40
41
+ pub trait ReceiverTimeout {
42
+ /// Check to see if the peripheral has detected a
43
+ /// receiver timeout and clears the flag
44
+ fn check_receiver_timeout ( & mut self , clear : bool ) -> bool ;
45
+ }
46
+
47
+ pub trait OperationError < O , E > {
48
+ /// Check to see if the peripheral has detected some
49
+ /// sort of error while performing an operation
50
+ fn check_operation_error ( & mut self ) -> Result < O , E > ;
51
+ }
52
+
41
53
/// Frame reader "worker", access and handling of frame reads is made through this structure.
42
54
pub struct FrameReader < BUFFER , PAYLOAD , const N : usize >
43
55
where
77
89
}
78
90
}
79
91
92
+ impl < BUFFER , PAYLOAD , CHANNEL , const N : usize > FrameReader < BUFFER , RxDma < PAYLOAD , CHANNEL > , N >
93
+ where
94
+ BUFFER : Sized + StableDeref < Target = DMAFrame < N > > + DerefMut + ' static ,
95
+ PAYLOAD : ReceiverTimeout ,
96
+ {
97
+ pub fn check_receiver_timeout ( & mut self , clear : bool ) -> bool {
98
+ self . payload . payload . check_receiver_timeout ( clear)
99
+ }
100
+ }
101
+
102
+ impl < BUFFER , PAYLOAD , CHANNEL , const N : usize > FrameReader < BUFFER , RxDma < PAYLOAD , CHANNEL > , N >
103
+ where
104
+ BUFFER : Sized + StableDeref < Target = DMAFrame < N > > + DerefMut + ' static ,
105
+ {
106
+ pub fn check_operation_error < O , E > ( & mut self ) -> Result < O , E >
107
+ where
108
+ PAYLOAD : OperationError < O , E > ,
109
+ {
110
+ self . payload . payload . check_operation_error ( )
111
+ }
112
+ }
113
+
80
114
/// Frame sender "worker", access and handling of frame transmissions is made through this
81
115
/// structure.
82
116
pub struct FrameSender < BUFFER , PAYLOAD , const N : usize >
0 commit comments