openMSX
SCSIDevice.hh
Go to the documentation of this file.
1#ifndef SCSIDEVICE_HH
2#define SCSIDEVICE_HH
3
4#include "SCSI.hh"
5#include <span>
6
7namespace openmsx {
8
10{
11public:
12 static constexpr unsigned BIT_SCSI2 = 0x0001;
13 static constexpr unsigned BIT_SCSI2_ONLY = 0x0002;
14 static constexpr unsigned BIT_SCSI3 = 0x0004;
15
16 static constexpr unsigned MODE_SCSI1 = 0x0000;
17 static constexpr unsigned MODE_SCSI2 = 0x0003;
18 static constexpr unsigned MODE_SCSI3 = 0x0005;
19 static constexpr unsigned MODE_UNITATTENTION = 0x0008; // report unit attention
20 static constexpr unsigned MODE_MEGASCSI = 0x0010; // report disk change when call of
21 // 'test unit ready'
22 static constexpr unsigned MODE_NOVAXIS = 0x0100;
23
24 static constexpr unsigned BUFFER_SIZE = 0x10000; // 64KB
25
26 virtual ~SCSIDevice() = default;
27
28 virtual void reset() = 0;
29 virtual bool isSelected() = 0;
30 [[nodiscard]] virtual unsigned executeCmd(std::span<const uint8_t, 12> cdb, SCSI::Phase& phase,
31 unsigned& blocks) = 0;
32 [[nodiscard]] virtual unsigned executingCmd(SCSI::Phase& phase, unsigned& blocks) = 0;
33 [[nodiscard]] virtual uint8_t getStatusCode() = 0;
34 virtual int msgOut(uint8_t value) = 0;
35 virtual uint8_t msgIn() = 0;
36 virtual void disconnect() = 0;
37 virtual void busReset() = 0; // only used in MB89352 controller
38
39 [[nodiscard]] virtual unsigned dataIn(unsigned& blocks) = 0;
40 [[nodiscard]] virtual unsigned dataOut(unsigned& blocks) = 0;
41};
42
43} // namespace openmsx
44
45#endif
virtual void reset()=0
static constexpr unsigned BIT_SCSI3
Definition SCSIDevice.hh:14
static constexpr unsigned BUFFER_SIZE
Definition SCSIDevice.hh:24
virtual unsigned dataIn(unsigned &blocks)=0
static constexpr unsigned MODE_MEGASCSI
Definition SCSIDevice.hh:20
virtual uint8_t msgIn()=0
static constexpr unsigned MODE_NOVAXIS
Definition SCSIDevice.hh:22
static constexpr unsigned MODE_SCSI3
Definition SCSIDevice.hh:18
virtual bool isSelected()=0
virtual unsigned executingCmd(SCSI::Phase &phase, unsigned &blocks)=0
static constexpr unsigned BIT_SCSI2
Definition SCSIDevice.hh:12
static constexpr unsigned BIT_SCSI2_ONLY
Definition SCSIDevice.hh:13
static constexpr unsigned MODE_SCSI1
Definition SCSIDevice.hh:16
static constexpr unsigned MODE_UNITATTENTION
Definition SCSIDevice.hh:19
virtual int msgOut(uint8_t value)=0
virtual ~SCSIDevice()=default
virtual unsigned dataOut(unsigned &blocks)=0
virtual unsigned executeCmd(std::span< const uint8_t, 12 > cdb, SCSI::Phase &phase, unsigned &blocks)=0
virtual void busReset()=0
virtual uint8_t getStatusCode()=0
static constexpr unsigned MODE_SCSI2
Definition SCSIDevice.hh:17
virtual void disconnect()=0
This file implemented 3 utility functions:
Definition Autofire.cc:11