BarinkOS/kernel/drivers/serial/serial.h
Nigel 9c5667c454 Created a proper driver for the serial bus
* The driver can write to any of the pre-defined serial COM ports
* The driver can read from any of the pre-defined serial COM ports (Untested)
2023-10-28 21:51:04 +02:00

29 lines
476 B
C++

#pragma once
// For now these are the standard
// serial ports we can talk to
enum SERIALPORT {
COM1 = 0x3F8,
COM2 = 0x2F8,
COM3 = 0x3E8,
COM4 = 0x2E8
};
struct SerialConfig {
SERIALPORT port;
char baud_rate_lo ;
char baud_rate_hi;
};
class Serial {
public:
Serial (SerialConfig config );
char read();
void write(void* data, int length);
private:
SERIALPORT port;
int is_transmit_empty();
};