MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / send

Method send

src/dev/drivers/mm_uart.rs:73–99  ·  view source on GitHub ↗

Send a byte via the serial port:

(&mut self, data: u8)

Source from the content-addressed store, hash-verified

71
72 // Send a byte via the serial port:
73 pub fn send(&mut self, data: u8)
74 {
75 let self_data = seld.data.load(Ordering::Relaxed);
76 unsafe
77 {
78 match data
79 {
80 8 | 0x7F =>
81 {
82 waitfor!(self.lnstat().contains(LineStatFlag::OUTPEMPTY));
83 self_data.write(8);
84
85 waitfor!(self.lnstat().contains(LineStatFlag::OUTPEMPTY));
86 self_data.write(b' ');
87
88 waitfor!(self.lnstat().contains(LineStatFlag::OUTPEMPTY));
89 self_data.write(8)
90 }
91
92 _ =>
93 {
94 waitfor!(self.lnstat().contains(LineStatFlags::OUTPEMPTY));
95 self_data.write(data);
96 }
97 }
98 }
99 }
100
101 // Receive a byte via the serial port:
102 pub fn receive(&mut self) -> u8

Callers 2

wrbyteMethod · 0.80
write_strMethod · 0.80

Calls 2

loadMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected