1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00
CLK/Machines/Apple/ADB/ReactiveDevice.hpp
2021-02-12 18:56:43 -05:00

40 lines
680 B
C++

//
// ReactiveDevice.hpp
// Clock Signal
//
// Created by Thomas Harte on 12/02/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef ReactiveDevice_hpp
#define ReactiveDevice_hpp
#include "Bus.hpp"
#include <cstddef>
#include <vector>
namespace Apple {
namespace ADB {
class ReactiveDevice: public Bus::Device {
protected:
ReactiveDevice(Bus &bus);
void post_response(const std::vector<uint8_t> &&response);
void advance_state(double microseconds) override;
private:
Bus &bus_;
const size_t device_id_;
std::vector<uint8_t> response_;
int bit_offset_ = 0;
double microseconds_at_bit_ = 0;
};
}
}
#endif /* ReactiveDevice_hpp */