Kernel: Make serial devices to their own class
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user