Add: working serial port output driver
This commit is contained in:
19
serial.h
19
serial.h
@@ -1,20 +1,11 @@
|
||||
#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 PORT 0x3f8 //COM1
|
||||
|
||||
#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);
|
||||
int init_serial();
|
||||
int is_transmit_empty();
|
||||
void write_serial(const char a);
|
||||
void serial_puts(const char* str);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user