[Voyageurs] Add a basic ps/2 keyboard driver.

This commit is contained in:
Drew Galbraith 2023-11-25 13:08:30 -08:00
parent 7151a509ee
commit 8365d47cbe
18 changed files with 532 additions and 0 deletions

View file

@ -15,4 +15,8 @@ glcr::ErrorCode PortClient::WriteString(glcr::String str, z_cap_t cap) {
ZPortSend(port_cap_, str.length() + 1, str.cstr(), 1, &cap));
}
glcr::ErrorCode PortClient::WriteByte(uint8_t byte) {
return static_cast<glcr::ErrorCode>(
ZPortSend(port_cap_, 1, &byte, 0, nullptr));
}
} // namespace mmth

View file

@ -17,6 +17,8 @@ class PortClient {
glcr::ErrorCode WriteString(glcr::String str, z_cap_t cap);
glcr::ErrorCode WriteByte(uint8_t byte);
z_cap_t cap() { return port_cap_; }
bool empty() { return port_cap_ == 0; }

View file

@ -9,6 +9,7 @@ namespace mmth {
class PortServer {
public:
PortServer() {}
static glcr::ErrorOr<PortServer> Create();
static PortServer AdoptCap(z_cap_t cap);