mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-28 10:52:22 +00:00
52c2aa474f
* Rebrand project to PiSCSI - rascsi ->piscsi - rasctl -> scsictl - rasdump -> scsidump - ras* -> piscsi* (rasutil -> piscsi_util, etc.) * Refined the formatting and wording of the app startup banner * Kept some references to rascsi and rasctl where backwards compatibility is concerned * Point to the new github repo URL Co-authored-by: nucleogenic <nr@nucleogenic.com> Co-authored-by: Uwe Seimet <Uwe.Seimet@seimet.de>
41 lines
848 B
C++
41 lines
848 B
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator PiSCSI
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 akuker
|
|
//
|
|
// [ SCSI Bus Monitor ]
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#include "hal/bus.h"
|
|
#include "hal/data_sample.h"
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
|
|
string DataSample::GetPhaseStr() const
|
|
{
|
|
return BUS::GetPhaseStrRaw(GetPhase());
|
|
}
|
|
|
|
phase_t DataSample::GetPhase() const
|
|
{
|
|
// Selection Phase
|
|
if (GetSEL()) {
|
|
return phase_t::selection;
|
|
}
|
|
|
|
// Bus busy phase
|
|
if (!GetBSY()) {
|
|
return phase_t::busfree;
|
|
}
|
|
|
|
// Get target phase from bus signal line
|
|
uint32_t mci = GetMSG() ? 0x04 : 0x00;
|
|
mci |= GetCD() ? 0x02 : 0x00;
|
|
mci |= GetIO() ? 0x01 : 0x00;
|
|
return BUS::GetPhase(mci);
|
|
}
|