summaryrefslogtreecommitdiff
path: root/stacks/max25-bcpr/include/bcpr/bcpr_uart.h
diff options
context:
space:
mode:
authorinfo@mode42.com <info@mode42.com>2026-08-07 18:25:13 +0000
committerinfo@mode42.com <info@mode42.com>2026-08-07 18:25:13 +0000
commit04d965d67a7264a1c7c211494aebda1953df7603 (patch)
tree0ebd700a6e219f84a26a656f4bee8778bc75da7b /stacks/max25-bcpr/include/bcpr/bcpr_uart.h
Initial push
Diffstat (limited to 'stacks/max25-bcpr/include/bcpr/bcpr_uart.h')
-rw-r--r--stacks/max25-bcpr/include/bcpr/bcpr_uart.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/stacks/max25-bcpr/include/bcpr/bcpr_uart.h b/stacks/max25-bcpr/include/bcpr/bcpr_uart.h
new file mode 100644
index 0000000..fde720e
--- /dev/null
+++ b/stacks/max25-bcpr/include/bcpr/bcpr_uart.h
@@ -0,0 +1,22 @@
+#ifndef BCPR_UART_H
+#define BCPR_UART_H
+
+#include <stdint.h>
+
+/* When set, all UART I/O is a no-op (CI / --dry-run). */
+void bcpr_uart_set_dry_run(int on);
+int bcpr_uart_ioperm(unsigned iobase, int on);
+void bcpr_uart_outb(unsigned char val, unsigned port);
+unsigned char bcpr_uart_inb(unsigned port);
+void bcpr_uart_set_divisor(unsigned iobase, unsigned divisor);
+void bcpr_uart_open_ser12(unsigned iobase);
+void bcpr_uart_close_ser12(unsigned iobase);
+unsigned char bcpr_uart_msr(unsigned iobase);
+void bcpr_uart_mcr(unsigned iobase, unsigned char v);
+void bcpr_uart_thr00(unsigned iobase);
+/* LCR bit6 Set Break — force TXD continuous SPACE (RS-232 +V). Clear = normal. */
+void bcpr_uart_set_break(unsigned iobase, int on);
+/* Poll LSR bit5 (THRE) until set or timeout_us. Returns 1 if empty, 0 on timeout. */
+int bcpr_uart_wait_thre(unsigned iobase, unsigned timeout_us);
+
+#endif
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com