Add: nonworking serial port driver implementation

This commit is contained in:
xamidev
2024-05-20 21:48:48 +02:00
parent 841dee9e18
commit aca525d3ce
11 changed files with 145 additions and 45 deletions

20
serial.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef INCLUDE_SERIAL_H
#define INCLUDE_SERIAL_H
#define SERIAL_COM1_BASE 0x3F8
#define SERIAL_DATA_PORT(base) (base)
#define SERIAL_FIFO_CMD_PORT(base) (base + 2)
#define SERIAL_LINE_CMD_PORT(base) (base + 3)
#define SERIAL_MODEM_CMD_PORT(base) (base + 4)
#define SERIAL_LINE_STATUS_PORT(base) (base + 5)
#define SERIAL_LINE_ENABLE_DLAB 0x80
void serial_configure_baud_rate(unsigned short com, unsigned short divisor);
void serial_configure_line(unsigned short com);
void serial_configure_buffer(unsigned short com);
void serial_configure_modem(unsigned short com);
int serial_is_transmit_fifo_empty(unsigned short com);
void serial_write(const char* buf, unsigned short com);
#endif