Skip to content

Commit 8c31b7a

Browse files
committed
zephyr: device: uart: Add is_dtr_set convenience
Signed-off-by: David Brown <[email protected]>
1 parent 4985edf commit 8c31b7a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

zephyr/src/device/uart.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ impl Uart {
110110
})
111111
}
112112

113+
/// Convenience, return if DTR is asserted.
114+
pub unsafe fn is_dtr_set(&self) -> Result<bool> {
115+
let ret = unsafe {
116+
self.line_ctrl_get(LineControl::DTR)?
117+
};
118+
Ok(ret == 1)
119+
}
120+
113121
/// Convert this UART into an async one.
114122
pub unsafe fn into_async(self) -> Result<UartAsync> {
115123
UartAsync::new(self)

0 commit comments

Comments
 (0)