1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-26 11:29:09 +00:00
CLK/Machines/Acorn/Archimedes/CMOSRAM.hpp
2024-03-26 12:24:24 -04:00

38 lines
597 B
C++

//
// CMOSRAM.hpp
// Clock Signal
//
// Created by Thomas Harte on 20/03/2024.
// Copyright © 2024 Thomas Harte. All rights reserved.
//
#pragma once
#include "../../../Components/I2C/I2C.hpp"
namespace Archimedes {
struct CMOSRAM: public I2C::Peripheral {
void start(bool is_read) override {
expecting_address_ = !is_read;
}
std::optional<uint8_t> read() override {
return 0;
}
void write(uint8_t value) override {
if(expecting_address_) {
address_ = value;
} else {
// TODO: write to RAM.
}
}
private:
bool expecting_address_ = false;
uint8_t address_;
};
}