summaryrefslogtreecommitdiff
path: root/stacks/max25-bcpr/include/bcpr/bcpr_uart.h
blob: fde720e788488ceaf9fcbb64536b90b50b370bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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