MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_serial_init

Function rt_serial_init

bsp/x86/drivers/serial.c:25–34  ·  view source on GitHub ↗

* This function initializes serial */

Source from the content-addressed store, hash-verified

23 * This function initializes serial
24 */
25void rt_serial_init(void)
26{
27 outb(COM1+3,0x80); /* set DLAB of line control reg */
28 outb(COM1,0x0c); /* LS of divisor (48 -> 2400 bps */
29 outb(COM1+1,0x00); /* MS of divisor */
30 outb(COM1+3,0x03); /* reset DLAB */
31 outb(COM1+4,0x0b); /* set DTR,RTS, OUT_2 */
32 outb(COM1+1,0x0d); /* enable all intrs but writes */
33 inb(COM1); /* read data port to reset things (?) */
34}
35
36/**
37 * This function read a character from serial without interrupt enable mode

Callers 2

rt_hw_console_initFunction · 0.70
rtthread_startupFunction · 0.50

Calls 2

outbFunction · 0.85
inbFunction · 0.85

Tested by

no test coverage detected