Skip to content

Commit b3f7fe9

Browse files
committed
feat(mmio): add send_raw
Signed-off-by: Martin Kröning <[email protected]>
1 parent 378d468 commit b3f7fe9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mmio.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ impl MmioSerialPort {
9595
}
9696
}
9797

98+
/// Sends a raw byte on the serial port, intended for binary data.
99+
pub fn send_raw(&mut self, data: u8) {
100+
let self_data = self.data.load(Ordering::Relaxed);
101+
wait_for!(self.line_sts().contains(LineStsFlags::OUTPUT_EMPTY));
102+
unsafe {
103+
self_data.write(data);
104+
}
105+
}
106+
98107
/// Receives a byte on the serial port.
99108
pub fn receive(&mut self) -> u8 {
100109
let self_data = self.data.load(Ordering::Relaxed);

0 commit comments

Comments
 (0)