1
Files
lecture-operating-system-de…/c_os/user/devices/SerialOut.h
2022-07-24 00:08:22 +02:00

32 lines
557 B
C++

#ifndef __SerialOut_Include_H_
#define __SerialOut_Include_H_
#include "kernel/IOport.h"
#include "user/lib/String.h"
// NOTE: I took this code from https://wiki.osdev.org/Serial_Ports
class SerialOut {
private:
const IOport com1;
SerialOut(const SerialOut& copy) = delete;
int serial_received();
int is_transmit_empty();
public:
SerialOut() : com1(0x3f8) {
this->init();
}
int init() const;
char read();
void write(char a);
void write(const char* a);
void write(const bse::string& a);
};
#endif