1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00
CLK/Components/5380/DirectAccessDevice.hpp
Thomas Harte 0e0c789b02 Starts attempting to introduce a direct access device.
Without having access to the SCSI-1 standard, a lot of this is guesswork.
2019-08-17 23:43:42 -04:00

45 lines
886 B
C++

//
// DirectAccessDevice.hpp
// Clock Signal
//
// Created by Thomas Harte on 17/08/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef DirectAccessDevice_hpp
#define DirectAccessDevice_hpp
#include "SCSI.hpp"
namespace SCSI {
/*!
Models a SCSI direct access device, ordinarily some sort of
hard drive.
*/
class DirectAccessDevice: public Bus::Observer {
public:
/*!
Instantiates a direct access device attached to @c bus,
with SCSI ID @c scsi_id — a number in the range 0 to 7.
*/
DirectAccessDevice(Bus &bus, int scsi_id);
private:
void scsi_bus_did_change(Bus *, BusState new_state) final;
Bus &bus_;
const BusState scsi_id_mask_;
const size_t scsi_bus_device_id_;
enum class State {
Inactive,
Selected
} state_ = State::Inactive;
BusState bus_state_ = DefaultBusState;
};
}
#endif /* DirectAccessDevice_hpp */