File tree 1 file changed +8
-5
lines changed 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -739,7 +739,10 @@ pub enum Direction {
739
739
}
740
740
741
741
/// Serial interface
742
- pub trait Serial {
742
+ ///
743
+ /// Some serial interfaces support different data sizes (8 bits, 9 bits, etc.);
744
+ /// This can be encoded in this trait via the `Word` type parameter.
745
+ pub trait Serial < Word > {
743
746
/// Serial interface error
744
747
///
745
748
/// Possible errors
@@ -748,11 +751,11 @@ pub trait Serial {
748
751
/// not read in a timely manner
749
752
type Error ;
750
753
751
- /// Reads a single byte from the serial interface
752
- fn read ( & self ) -> nb:: Result < u8 , Self :: Error > ;
754
+ /// Reads a single word from the serial interface
755
+ fn read ( & self ) -> nb:: Result < Word , Self :: Error > ;
753
756
754
- /// Writes a single byte to the serial interface
755
- fn write ( & self , byte : u8 ) -> nb:: Result < ( ) , Self :: Error > ;
757
+ /// Writes a single word to the serial interface
758
+ fn write ( & self , word : Word ) -> nb:: Result < ( ) , Self :: Error > ;
756
759
}
757
760
758
761
/// Serial Peripheral Interface (full duplex master mode)
You can’t perform that action at this time.
0 commit comments