Kernel: Make serial devices to their own class

This commit is contained in:
Bananymous
2023-09-04 14:57:05 +03:00
parent e4041ce5ec
commit 52b9fddfd7
3 changed files with 74 additions and 30 deletions

View File

@@ -1,11 +1,28 @@
#pragma once
namespace Serial
#include <BAN/Errors.h>
namespace Kernel
{
void initialize();
bool is_initialized();
class Serial
{
public:
static void initialize();
static bool has_devices();
static void putchar_any(char);
void putchar(char);
void putchar(char);
private:
static bool port_has_device(uint16_t);
bool is_transmit_empty() const;
bool is_valid() const { return m_port != 0; }
private:
uint16_t m_port { 0 };
};
}