mirror of
https://github.com/akuker/RASCSI.git
synced 2025-04-16 12:37:06 +00:00
Switch over data types to bus_type.h
This commit is contained in:
parent
1119ed90a6
commit
bc13287ea3
@ -104,7 +104,7 @@ public:
|
||||
|
||||
virtual bool GetSignal(board_type::pi_physical_pin_e pin) const = 0;
|
||||
// Get SCSI input signal value
|
||||
virtual void SetSignal(board_type::pi_physical_pin_e pin, bool ast) = 0;
|
||||
virtual void SetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) = 0;
|
||||
// Set SCSI output signal value
|
||||
static const int SEND_NO_DELAY = -1;
|
||||
// Passed into SendHandShake when we don't want to delay
|
||||
|
96
cpp/hal/board_type.cpp
Normal file
96
cpp/hal/board_type.cpp
Normal file
@ -0,0 +1,96 @@
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// SCSI Target Emulator RaSCSI Reloaded
|
||||
// for Raspberry Pi
|
||||
//
|
||||
// Powered by XM6 TypeG Technology.
|
||||
// Copyright (C) 2016-2020 GIMONS
|
||||
// Copyright (C) 2022 akuker
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include "hal/board_type.h"
|
||||
|
||||
using namespace board_type;
|
||||
|
||||
gpio_high_low_e Rascsi_Board_Struct::bool_to_gpio_state(bool value)
|
||||
{
|
||||
if (value) {
|
||||
return gpio_high_low_e::GPIO_STATE_HIGH;
|
||||
} else {
|
||||
return gpio_high_low_e::GPIO_STATE_LOW;
|
||||
}
|
||||
}
|
||||
bool Rascsi_Board_Struct::gpio_state_to_bool(gpio_high_low_e value)
|
||||
{
|
||||
return (value == gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
}
|
||||
|
||||
// Activity signal true (on)
|
||||
gpio_high_low_e Rascsi_Board_Struct::ActOn()
|
||||
{
|
||||
return act_on;
|
||||
}
|
||||
|
||||
// Activity signal false (off)
|
||||
gpio_high_low_e Rascsi_Board_Struct::ActOff()
|
||||
{
|
||||
return GpioInvert(act_on);
|
||||
}
|
||||
|
||||
// Enable signal true (on)
|
||||
gpio_high_low_e Rascsi_Board_Struct::EnbOn()
|
||||
{
|
||||
return enb_on;
|
||||
}
|
||||
|
||||
// Enable signal false (off)
|
||||
gpio_high_low_e Rascsi_Board_Struct::EnbOff()
|
||||
{
|
||||
return GpioInvert(enb_on);
|
||||
}
|
||||
|
||||
// Initiator signal = Input
|
||||
gpio_high_low_e Rascsi_Board_Struct::IndIn()
|
||||
{
|
||||
return ind_in;
|
||||
}
|
||||
|
||||
// Initiator signal = Output
|
||||
gpio_high_low_e Rascsi_Board_Struct::IndOut()
|
||||
{
|
||||
return GpioInvert(ind_in);
|
||||
}
|
||||
|
||||
// Target signal = Input
|
||||
gpio_high_low_e Rascsi_Board_Struct::TadIn()
|
||||
{
|
||||
return tad_in;
|
||||
}
|
||||
|
||||
// Target signal = Output
|
||||
gpio_high_low_e Rascsi_Board_Struct::TadOut()
|
||||
{
|
||||
return GpioInvert(tad_in);
|
||||
}
|
||||
|
||||
// Data signal = Input
|
||||
gpio_high_low_e Rascsi_Board_Struct::DtdIn()
|
||||
{
|
||||
return dtd_in;
|
||||
}
|
||||
|
||||
// Data signal = Output
|
||||
gpio_high_low_e Rascsi_Board_Struct::DtdOut()
|
||||
{
|
||||
return GpioInvert(dtd_in);
|
||||
}
|
||||
|
||||
gpio_high_low_e Rascsi_Board_Struct::GpioInvert(gpio_high_low_e in)
|
||||
{
|
||||
if (in == gpio_high_low_e::GPIO_STATE_HIGH) {
|
||||
return gpio_high_low_e::GPIO_STATE_LOW;
|
||||
} else {
|
||||
return gpio_high_low_e::GPIO_STATE_HIGH;
|
||||
}
|
||||
}
|
@ -53,20 +53,20 @@ enum class pi_physical_pin_e : int {
|
||||
};
|
||||
|
||||
// Operation modes definition
|
||||
enum class gpio_direction_e : int {
|
||||
enum class gpio_direction_e : uint8_t {
|
||||
GPIO_INPUT = 0,
|
||||
GPIO_OUTPUT = 1,
|
||||
};
|
||||
|
||||
enum class gpio_pull_up_down_e : int {
|
||||
enum class gpio_pull_up_down_e : uint8_t {
|
||||
GPIO_PULLNONE = 0,
|
||||
GPIO_PULLDOWN = 1,
|
||||
GPIO_PULLUP = 2,
|
||||
};
|
||||
|
||||
enum class active_high_low_e : int {
|
||||
ACTIVE_HIGH = 1, // Equivalent of "ON" in old code
|
||||
ACTIVE_LOW = 0, // Equivalent of "OFF" in old code
|
||||
enum class gpio_high_low_e : uint8_t {
|
||||
GPIO_STATE_HIGH = 1, // Equivalent of "ON" in old code
|
||||
GPIO_STATE_LOW = 0, // Equivalent of "OFF" in old code
|
||||
};
|
||||
|
||||
struct Rascsi_Board_Struct {
|
||||
@ -76,11 +76,11 @@ struct Rascsi_Board_Struct {
|
||||
const int signal_control_mode;
|
||||
|
||||
// Control signal output logic
|
||||
const active_high_low_e act_on; // ACTIVE SIGNAL ON
|
||||
const active_high_low_e enb_on; // ENABLE SIGNAL ON
|
||||
const active_high_low_e ind_in; // INITIATOR SIGNAL INPUT
|
||||
const active_high_low_e tad_in; // TARGET SIGNAL INPUT
|
||||
const active_high_low_e dtd_in; // DATA SIGNAL INPUT
|
||||
const gpio_high_low_e act_on; // ACTIVE SIGNAL ON
|
||||
const gpio_high_low_e enb_on; // ENABLE SIGNAL ON
|
||||
const gpio_high_low_e ind_in; // INITIATOR SIGNAL INPUT
|
||||
const gpio_high_low_e tad_in; // TARGET SIGNAL INPUT
|
||||
const gpio_high_low_e dtd_in; // DATA SIGNAL INPUT
|
||||
|
||||
// Control signal pin assignment (-1 means no control)
|
||||
const pi_physical_pin_e pin_act; // ACTIVE
|
||||
@ -108,6 +108,32 @@ struct Rascsi_Board_Struct {
|
||||
const pi_physical_pin_e pin_io; // IO
|
||||
const pi_physical_pin_e pin_bsy; // BSY
|
||||
const pi_physical_pin_e pin_sel; // SEL
|
||||
|
||||
gpio_high_low_e bool_to_gpio_state(bool);
|
||||
bool gpio_state_to_bool(gpio_high_low_e);
|
||||
|
||||
// Activity signal true (on)
|
||||
gpio_high_low_e ActOn();
|
||||
// Activity signal false (off)
|
||||
gpio_high_low_e ActOff();
|
||||
// Enable signal true (on)
|
||||
gpio_high_low_e EnbOn();
|
||||
// Enable signal false (off)
|
||||
gpio_high_low_e EnbOff();
|
||||
// Initiator signal = Input
|
||||
gpio_high_low_e IndIn();
|
||||
// Initiator signal = Output
|
||||
gpio_high_low_e IndOut();
|
||||
// Target signal = Input
|
||||
gpio_high_low_e TadIn();
|
||||
// Target signal = Output
|
||||
gpio_high_low_e TadOut();
|
||||
// Data signal = Input
|
||||
gpio_high_low_e DtdIn();
|
||||
// Data signal = Output
|
||||
gpio_high_low_e DtdOut();
|
||||
|
||||
gpio_high_low_e GpioInvert(gpio_high_low_e);
|
||||
};
|
||||
|
||||
typedef struct Rascsi_Board_Struct Rascsi_Board_Type;
|
||||
|
@ -23,11 +23,11 @@ const Rascsi_Board_Type board_definition_aibom = {
|
||||
.signal_control_mode = 2, // SCSI positive logic specification
|
||||
|
||||
// Control signal output logic
|
||||
.act_on = active_high_low_e::ACTIVE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = active_high_low_e::ACTIVE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = active_high_low_e::ACTIVE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = active_high_low_e::ACTIVE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = active_high_low_e::ACTIVE_LOW, // DATA SIGNAL INPUT
|
||||
.act_on = gpio_high_low_e::GPIO_STATE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = gpio_high_low_e::GPIO_STATE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = gpio_high_low_e::GPIO_STATE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = gpio_high_low_e::GPIO_STATE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = gpio_high_low_e::GPIO_STATE_LOW, // DATA SIGNAL INPUT
|
||||
|
||||
// Control signal pin assignment (-1 means no control)
|
||||
.pin_act = pi_physical_pin_e::PI_PHYS_PIN_07, // ACTIVE
|
||||
|
@ -21,11 +21,11 @@ const Rascsi_Board_Type board_definition_fullspec = {
|
||||
.signal_control_mode = 0, // SCSI positive logic specification
|
||||
|
||||
// Control signal output logic
|
||||
.act_on = active_high_low_e::ACTIVE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = active_high_low_e::ACTIVE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = active_high_low_e::ACTIVE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = active_high_low_e::ACTIVE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = active_high_low_e::ACTIVE_HIGH, // DATA SIGNAL INPUT
|
||||
.act_on = gpio_high_low_e::GPIO_STATE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = gpio_high_low_e::GPIO_STATE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = gpio_high_low_e::GPIO_STATE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = gpio_high_low_e::GPIO_STATE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = gpio_high_low_e::GPIO_STATE_HIGH, // DATA SIGNAL INPUT
|
||||
|
||||
// Control signal pin assignment (-1 means no control)
|
||||
.pin_act = pi_physical_pin_e::PI_PHYS_PIN_07, // ACTIVE
|
||||
|
@ -23,11 +23,11 @@ const Rascsi_Board_Type board_definition_gamernium = {
|
||||
.signal_control_mode = 0, // SCSI positive logic specification
|
||||
|
||||
// Control signal output logic
|
||||
.act_on = active_high_low_e::ACTIVE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = active_high_low_e::ACTIVE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = active_high_low_e::ACTIVE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = active_high_low_e::ACTIVE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = active_high_low_e::ACTIVE_HIGH, // DATA SIGNAL INPUT
|
||||
.act_on = gpio_high_low_e::GPIO_STATE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = gpio_high_low_e::GPIO_STATE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = gpio_high_low_e::GPIO_STATE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = gpio_high_low_e::GPIO_STATE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = gpio_high_low_e::GPIO_STATE_HIGH, // DATA SIGNAL INPUT
|
||||
|
||||
// Control signal pin assignment (-1 means no control)
|
||||
.pin_act = pi_physical_pin_e::PI_PHYS_PIN_08, // ACTIVE
|
||||
|
@ -22,11 +22,11 @@ const Rascsi_Board_Type board_definition_standard = {
|
||||
.signal_control_mode = 0, // SCSI positive logic specification
|
||||
|
||||
// Control signal output logic
|
||||
.act_on = active_high_low_e::ACTIVE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = active_high_low_e::ACTIVE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = active_high_low_e::ACTIVE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = active_high_low_e::ACTIVE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = active_high_low_e::ACTIVE_HIGH, // DATA SIGNAL INPUT
|
||||
.act_on = gpio_high_low_e::GPIO_STATE_HIGH, // ACTIVE SIGNAL ON
|
||||
.enb_on = gpio_high_low_e::GPIO_STATE_HIGH, // ENABLE SIGNAL ON
|
||||
.ind_in = gpio_high_low_e::GPIO_STATE_LOW, // INITIATOR SIGNAL INPUT
|
||||
.tad_in = gpio_high_low_e::GPIO_STATE_LOW, // TARGET SIGNAL INPUT
|
||||
.dtd_in = gpio_high_low_e::GPIO_STATE_HIGH, // DATA SIGNAL INPUT
|
||||
|
||||
// Control signal pin assignment (-1 means no control)
|
||||
.pin_act = pi_physical_pin_e::PI_PHYS_PIN_07, // RPi GPIO 4
|
||||
|
@ -132,22 +132,22 @@ void GPIOBUS::Cleanup()
|
||||
#endif // USE_SEL_EVENT_ENABLE
|
||||
|
||||
// Set control signals
|
||||
PinSetSignal(board->pin_enb, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_act, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_tad, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_ind, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_dtd, RASCSI_PIN_OFF);
|
||||
PinConfig(board->pin_act, GPIO_INPUT);
|
||||
PinConfig(board->pin_tad, GPIO_INPUT);
|
||||
PinConfig(board->pin_ind, GPIO_INPUT);
|
||||
PinConfig(board->pin_dtd, GPIO_INPUT);
|
||||
PinSetSignal(board->pin_enb, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_act, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_tad, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_ind, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_dtd, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinConfig(board->pin_act, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PinConfig(board->pin_tad, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PinConfig(board->pin_ind, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PinConfig(board->pin_dtd, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
|
||||
// Initialize all signals
|
||||
for (int i = 0; SignalTable[i] != board_type::pi_physical_pin_e::PI_PHYS_PIN_NONE; i++) {
|
||||
board_type::pi_physical_pin_e pin = SignalTable[i];
|
||||
PinSetSignal(pin, RASCSI_PIN_OFF);
|
||||
PinConfig(pin, GPIO_INPUT);
|
||||
PullConfig(pin, GPIO_PULLNONE);
|
||||
PinSetSignal(pin, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinConfig(pin, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PullConfig(pin, board_type::gpio_pull_up_down_e::GPIO_PULLNONE);
|
||||
}
|
||||
|
||||
// Set drive strength back to 8mA
|
||||
@ -165,7 +165,7 @@ void GPIOBUS::Reset()
|
||||
board_type::pi_physical_pin_e j;
|
||||
|
||||
// Turn off active signal
|
||||
SetControl(board->pin_act, ACT_OFF);
|
||||
SetControl(board->pin_act, board->ActOff());
|
||||
|
||||
// Set all signals to off
|
||||
for (i = 0;; i++) {
|
||||
@ -174,67 +174,67 @@ void GPIOBUS::Reset()
|
||||
break;
|
||||
}
|
||||
|
||||
SetSignal(j, RASCSI_PIN_OFF);
|
||||
SetSignal(j, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
}
|
||||
|
||||
if (actmode == mode_e::TARGET) {
|
||||
// Target mode
|
||||
|
||||
// Set target signal to input
|
||||
SetControl(board->pin_tad, TAD_IN);
|
||||
SetMode(board->pin_bsy, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_msg, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_cd, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_req, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_io, RASCSI_PIN_IN);
|
||||
SetControl(board->pin_tad, board->TadIn());
|
||||
SetMode(board->pin_bsy, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_msg, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_cd, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_req, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_io, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
|
||||
// Set the initiator signal to input
|
||||
SetControl(board->pin_ind, IND_IN);
|
||||
SetMode(board->pin_sel, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_atn, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_ack, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_rst, RASCSI_PIN_IN);
|
||||
SetControl(board->pin_ind, board->IndIn());
|
||||
SetMode(board->pin_sel, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_atn, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_ack, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_rst, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
|
||||
// Set data bus signals to input
|
||||
SetControl(board->pin_dtd, DTD_IN);
|
||||
SetMode(board->pin_dt0, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt1, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt2, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt3, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt4, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt5, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt6, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt7, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dp, RASCSI_PIN_IN);
|
||||
SetControl(board->pin_dtd, board->DtdIn());
|
||||
SetMode(board->pin_dt0, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt1, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt2, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt3, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt4, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt5, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt6, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt7, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dp, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
} else {
|
||||
// Initiator mode
|
||||
|
||||
// Set target signal to input
|
||||
SetControl(board->pin_tad, TAD_IN);
|
||||
SetMode(board->pin_bsy, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_msg, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_cd, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_req, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_io, RASCSI_PIN_IN);
|
||||
SetControl(board->pin_tad, board->TadIn());
|
||||
SetMode(board->pin_bsy, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_msg, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_cd, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_req, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_io, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
|
||||
// Set the initiator signal to output
|
||||
SetControl(board->pin_ind, IND_OUT);
|
||||
SetMode(board->pin_sel, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_atn, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_ack, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_rst, RASCSI_PIN_OUT);
|
||||
SetControl(board->pin_ind, board->IndOut());
|
||||
SetMode(board->pin_sel, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_atn, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_ack, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_rst, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
|
||||
// Set the data bus signals to output
|
||||
SetControl(board->pin_dtd, DTD_OUT);
|
||||
SetMode(board->pin_dt0, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt1, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt2, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt3, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt4, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt5, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt6, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt7, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dp, RASCSI_PIN_OUT);
|
||||
SetControl(board->pin_dtd, board->DtdOut());
|
||||
SetMode(board->pin_dt0, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt1, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt2, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt3, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt4, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt5, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt6, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt7, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dp, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
}
|
||||
|
||||
// Initialize all signals
|
||||
@ -245,7 +245,7 @@ void GPIOBUS::Reset()
|
||||
void GPIOBUS::SetENB(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
PinSetSignal(board->pin_enb, ast ? ENB_ON : ENB_OFF);
|
||||
PinSetSignal(board->pin_enb, ast ? board->EnbOn() : board->EnbOff());
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetBSY() const
|
||||
@ -258,33 +258,33 @@ void GPIOBUS::SetBSY(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
// Set BSY signal
|
||||
SetSignal(board->pin_bsy, ast);
|
||||
SetSignal(board->pin_bsy, board->bool_to_gpio_state(ast));
|
||||
|
||||
if (actmode == mode_e::TARGET) {
|
||||
if (ast) {
|
||||
// Turn on ACTIVE signal
|
||||
SetControl(board->pin_act, ACT_ON);
|
||||
SetControl(board->pin_act, board->act_on);
|
||||
|
||||
// Set Target signal to output
|
||||
SetControl(board->pin_tad, TAD_OUT);
|
||||
SetControl(board->pin_tad, board->TadOut());
|
||||
|
||||
SetMode(board->pin_bsy, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_msg, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_cd, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_req, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_io, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_bsy, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_msg, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_cd, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_req, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_io, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
} else {
|
||||
// Turn off the ACTIVE signal
|
||||
SetControl(board->pin_act, ACT_OFF);
|
||||
SetControl(board->pin_act, board->ActOff());
|
||||
|
||||
// Set the target signal to input
|
||||
SetControl(board->pin_tad, TAD_IN);
|
||||
SetControl(board->pin_tad, board->TadIn());
|
||||
|
||||
SetMode(board->pin_bsy, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_msg, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_cd, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_req, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_io, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_bsy, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_msg, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_cd, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_req, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_io, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -300,11 +300,11 @@ void GPIOBUS::SetSEL(bool ast)
|
||||
GPIO_FUNCTION_TRACE
|
||||
if (actmode == mode_e::INITIATOR && ast) {
|
||||
// Turn on ACTIVE signal
|
||||
SetControl(board->pin_act, ACT_ON);
|
||||
SetControl(board->pin_act, board->act_on);
|
||||
}
|
||||
|
||||
// Set SEL signal
|
||||
SetSignal(board->pin_sel, ast);
|
||||
SetSignal(board->pin_sel, board->bool_to_gpio_state(ast));
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetATN() const
|
||||
@ -316,7 +316,7 @@ bool GPIOBUS::GetATN() const
|
||||
void GPIOBUS::SetATN(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_atn, ast);
|
||||
SetSignal(board->pin_atn, board->bool_to_gpio_state(ast));
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetACK() const
|
||||
@ -328,7 +328,7 @@ bool GPIOBUS::GetACK() const
|
||||
void GPIOBUS::SetACK(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_ack, ast);
|
||||
SetSignal(board->pin_ack, board->bool_to_gpio_state(ast));
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetACT() const
|
||||
@ -340,7 +340,7 @@ bool GPIOBUS::GetACT() const
|
||||
void GPIOBUS::SetACT(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_act, ast);
|
||||
SetSignal(board->pin_act, (ast) ? board->ActOn() : board->ActOff());
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetRST() const
|
||||
@ -352,7 +352,7 @@ bool GPIOBUS::GetRST() const
|
||||
void GPIOBUS::SetRST(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_rst, ast);
|
||||
SetSignal(board->pin_rst, (ast) ? board->act_on : board->ActOff());
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetMSG() const
|
||||
@ -364,7 +364,7 @@ bool GPIOBUS::GetMSG() const
|
||||
void GPIOBUS::SetMSG(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_msg, ast);
|
||||
SetSignal(board->pin_msg, board->bool_to_gpio_state(ast));
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetCD() const
|
||||
@ -376,7 +376,7 @@ bool GPIOBUS::GetCD() const
|
||||
void GPIOBUS::SetCD(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_cd, ast);
|
||||
SetSignal(board->pin_cd, board->bool_to_gpio_state(ast));
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetIO()
|
||||
@ -387,27 +387,27 @@ bool GPIOBUS::GetIO()
|
||||
if (actmode == mode_e::INITIATOR) {
|
||||
// Change the data input/output direction by IO signal
|
||||
if (ast) {
|
||||
SetControl(board->pin_dtd, DTD_IN);
|
||||
SetMode(board->pin_dt0, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt1, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt2, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt3, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt4, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt5, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt6, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt7, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dp, RASCSI_PIN_IN);
|
||||
SetControl(board->pin_dtd, board->DtdIn());
|
||||
SetMode(board->pin_dt0, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt1, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt2, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt3, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt4, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt5, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt6, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt7, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dp, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
} else {
|
||||
SetControl(board->pin_dtd, DTD_OUT);
|
||||
SetMode(board->pin_dt0, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt1, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt2, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt3, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt4, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt5, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt6, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt7, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dp, RASCSI_PIN_OUT);
|
||||
SetControl(board->pin_dtd, board->DtdOut());
|
||||
SetMode(board->pin_dt0, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt1, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt2, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt3, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt4, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt5, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt6, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt7, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dp, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -417,33 +417,33 @@ bool GPIOBUS::GetIO()
|
||||
void GPIOBUS::SetIO(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_io, ast);
|
||||
SetSignal(board->pin_io, board->bool_to_gpio_state(ast));
|
||||
|
||||
if (actmode == mode_e::TARGET) {
|
||||
// Change the data input/output direction by IO signal
|
||||
if (ast) {
|
||||
SetControl(board->pin_dtd, DTD_OUT);
|
||||
SetControl(board->pin_dtd, board->DtdOut());
|
||||
SetDAT(0);
|
||||
SetMode(board->pin_dt0, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt1, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt2, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt3, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt4, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt5, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt6, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt7, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dp, RASCSI_PIN_OUT);
|
||||
SetMode(board->pin_dt0, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt1, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt2, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt3, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt4, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt5, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt6, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dt7, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
SetMode(board->pin_dp, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
} else {
|
||||
SetControl(board->pin_dtd, DTD_IN);
|
||||
SetMode(board->pin_dt0, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt1, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt2, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt3, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt4, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt5, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt6, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dt7, RASCSI_PIN_IN);
|
||||
SetMode(board->pin_dp, RASCSI_PIN_IN);
|
||||
SetControl(board->pin_dtd, board->DtdIn());
|
||||
SetMode(board->pin_dt0, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt1, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt2, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt3, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt4, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt5, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt6, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dt7, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
SetMode(board->pin_dp, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -457,7 +457,7 @@ bool GPIOBUS::GetREQ() const
|
||||
void GPIOBUS::SetREQ(bool ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
SetSignal(board->pin_req, ast);
|
||||
SetSignal(board->pin_req, board->bool_to_gpio_state(ast));
|
||||
}
|
||||
|
||||
bool GPIOBUS::GetDP() const
|
||||
@ -482,10 +482,10 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
DisableIRQ();
|
||||
|
||||
// Assert REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait for ACK signal
|
||||
bool ret = WaitSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
bool ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait until the signal line stabilizes
|
||||
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
||||
@ -494,7 +494,7 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
*buf = GetDAT();
|
||||
|
||||
// Disable REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Timeout waiting for ACK assertion
|
||||
if (!ret) {
|
||||
@ -503,7 +503,7 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
}
|
||||
|
||||
// Wait for ACK to clear
|
||||
ret = WaitSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Timeout waiting for ACK to clear
|
||||
if (!ret) {
|
||||
@ -521,23 +521,23 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
|
||||
// RaSCSI becomes ICD compatible by ignoring the prepended $1F byte before processing the CDB.
|
||||
if (*buf == 0x1F) {
|
||||
SetSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
ret = WaitSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
||||
|
||||
// Get the actual SCSI command
|
||||
*buf = GetDAT();
|
||||
|
||||
SetSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
if (!ret) {
|
||||
EnableIRQ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
WaitSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
if (!ret) {
|
||||
EnableIRQ();
|
||||
@ -553,10 +553,10 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
int bytes_received;
|
||||
for (bytes_received = 1; bytes_received < command_byte_count; bytes_received++) {
|
||||
// Assert REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait for ACK signal
|
||||
ret = WaitSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait until the signal line stabilizes
|
||||
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
||||
@ -565,7 +565,7 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
*buf = GetDAT();
|
||||
|
||||
// Clear the REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for ACK assertion
|
||||
if (!ret) {
|
||||
@ -573,7 +573,7 @@ int GPIOBUS::CommandHandShake(BYTE *buf)
|
||||
}
|
||||
|
||||
// Wait for ACK to clear
|
||||
ret = WaitSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for ACK to clear
|
||||
if (!ret) {
|
||||
@ -606,10 +606,10 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count)
|
||||
if (actmode == mode_e::TARGET) {
|
||||
for (i = 0; i < count; i++) {
|
||||
// Assert the REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait for ACK
|
||||
bool ret = WaitSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
bool ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait until the signal line stabilizes
|
||||
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
||||
@ -618,7 +618,7 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count)
|
||||
*buf = GetDAT();
|
||||
|
||||
// Clear the REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for ACK signal
|
||||
if (!ret) {
|
||||
@ -626,7 +626,7 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count)
|
||||
}
|
||||
|
||||
// Wait for ACK to clear
|
||||
ret = WaitSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for ACK to clear
|
||||
if (!ret) {
|
||||
@ -642,7 +642,7 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count)
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
// Wait for the REQ signal to be asserted
|
||||
bool ret = WaitSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
bool ret = WaitSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Check for timeout waiting for REQ signal
|
||||
if (!ret) {
|
||||
@ -661,13 +661,13 @@ int GPIOBUS::ReceiveHandShake(BYTE *buf, int count)
|
||||
*buf = GetDAT();
|
||||
|
||||
// Assert the ACK signal
|
||||
SetSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait for REQ to clear
|
||||
ret = WaitSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
ret = WaitSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Clear the ACK signal
|
||||
SetSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for REQ to clear
|
||||
if (!ret) {
|
||||
@ -717,7 +717,7 @@ int GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
|
||||
SetDAT(*buf);
|
||||
|
||||
// Wait for ACK to clear
|
||||
bool ret = WaitSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
bool ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for ACK to clear
|
||||
if (!ret) {
|
||||
@ -727,13 +727,13 @@ int GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
|
||||
// Already waiting for ACK to clear
|
||||
|
||||
// Assert the REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait for ACK
|
||||
ret = WaitSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
ret = WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Clear REQ signal
|
||||
SetSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for ACK to clear
|
||||
if (!ret) {
|
||||
@ -745,7 +745,7 @@ int GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
|
||||
}
|
||||
|
||||
// Wait for ACK to clear
|
||||
WaitSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
WaitSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
} else {
|
||||
// Get Phase
|
||||
uint32_t phase = Acquire() & GPIO_MCI;
|
||||
@ -761,7 +761,7 @@ int GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
|
||||
SetDAT(*buf);
|
||||
|
||||
// Wait for REQ to be asserted
|
||||
bool ret = WaitSignal(board->pin_req, RASCSI_PIN_ON);
|
||||
bool ret = WaitSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Check for timeout waiting for REQ to be asserted
|
||||
if (!ret) {
|
||||
@ -776,13 +776,13 @@ int GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
|
||||
// Already waiting for REQ assertion
|
||||
|
||||
// Assert the ACK signal
|
||||
SetSignal(board->pin_ack, RASCSI_PIN_ON);
|
||||
SetSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_HIGH);
|
||||
|
||||
// Wait for REQ to clear
|
||||
ret = WaitSignal(board->pin_req, RASCSI_PIN_OFF);
|
||||
ret = WaitSignal(board->pin_req, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Clear the ACK signal
|
||||
SetSignal(board->pin_ack, RASCSI_PIN_OFF);
|
||||
SetSignal(board->pin_ack, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
|
||||
// Check for timeout waiting for REQ to clear
|
||||
if (!ret) {
|
||||
@ -949,7 +949,7 @@ void GPIOBUS::MakeTable(void)
|
||||
// Wait for signal change
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
bool GPIOBUS::WaitSignal(board_type::pi_physical_pin_e pin, int ast)
|
||||
bool GPIOBUS::WaitSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
GPIO_FUNCTION_TRACE
|
||||
|
||||
@ -970,7 +970,7 @@ bool GPIOBUS::WaitSignal(board_type::pi_physical_pin_e pin, int ast)
|
||||
// Check for the signal edge
|
||||
LOGWARN("THIS WONT WORK. NEEDS TO BE UPDATED");
|
||||
|
||||
if ((GetSignal(pin) ^ ~ast) & 1) {
|
||||
if ((GetSignal(pin) ^ ~((int)(board->gpio_state_to_bool(ast)))) & 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -142,8 +142,6 @@ const static uint32_t PADS_OFFSET = 0x00100000;
|
||||
const static uint32_t GPIO_OFFSET = 0x00200000;
|
||||
const static uint32_t QA7_OFFSET = 0x01000000;
|
||||
|
||||
const static int GPIO_INPUT = 0;
|
||||
const static int GPIO_OUTPUT = 1;
|
||||
const static int GPIO_PULLNONE = 0;
|
||||
const static int GPIO_PULLDOWN = 1;
|
||||
const static int GPIO_PULLUP = 2;
|
||||
@ -235,27 +233,6 @@ const static int GICC_EOIR = 0x004;
|
||||
const static int GIC_IRQLOCAL0 = (16 + 14);
|
||||
const static int GIC_GPIO_IRQ = (32 + 116); // GPIO3
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Constant declarations (Control signals)
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
#define ACT_OFF !ACT_ON
|
||||
#define ENB_OFF !ENB_ON
|
||||
#define TAD_OUT !TAD_IN
|
||||
#define IND_OUT !IND_IN
|
||||
#define DTD_OUT !DTD_IN
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Constant declarations (SCSI)
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
#define RASCSI_PIN_IN GPIO_INPUT
|
||||
#define RASCSI_PIN_OUT GPIO_OUTPUT
|
||||
const static int RASCSI_PIN_ON = 1;
|
||||
const static int RASCSI_PIN_OFF = 0;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Class definition
|
||||
@ -358,15 +335,15 @@ class GPIOBUS : public BUS
|
||||
// SCSI I/O signal control
|
||||
virtual void MakeTable() = 0;
|
||||
// Create work data
|
||||
virtual void SetControl(board_type::pi_physical_pin_e pin, bool ast) = 0;
|
||||
virtual void SetControl(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) = 0;
|
||||
// Set Control Signal
|
||||
virtual void SetMode(board_type::pi_physical_pin_e pin, int mode) = 0;
|
||||
virtual void SetMode(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) = 0;
|
||||
// Set SCSI I/O mode
|
||||
bool GetSignal(board_type::pi_physical_pin_e pin) const override = 0;
|
||||
// Set Control Signal
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, bool ast) override = 0;
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override = 0;
|
||||
// Set SCSI I/O mode
|
||||
virtual bool WaitSignal(board_type::pi_physical_pin_e pin, int ast) = 0;
|
||||
virtual bool WaitSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) = 0;
|
||||
// Wait for a signal to change
|
||||
// Interrupt control
|
||||
virtual void DisableIRQ() = 0;
|
||||
@ -375,11 +352,11 @@ class GPIOBUS : public BUS
|
||||
// IRQ Enabled
|
||||
|
||||
// GPIO pin functionality settings
|
||||
virtual void PinConfig(board_type::pi_physical_pin_e pin, int mode) = 0;
|
||||
virtual void PinConfig(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) = 0;
|
||||
// GPIO pin direction setting
|
||||
virtual void PullConfig(board_type::pi_physical_pin_e pin, int mode) = 0;
|
||||
virtual void PullConfig(board_type::pi_physical_pin_e pin, board_type::gpio_pull_up_down_e mode) = 0;
|
||||
// GPIO pin pull up/down resistor setting
|
||||
virtual void PinSetSignal(board_type::pi_physical_pin_e pin, bool ast) = 0;
|
||||
virtual void PinSetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) = 0;
|
||||
// Set GPIO output signal
|
||||
virtual void DrvConfig(uint32_t drive) = 0;
|
||||
// Set GPIO drive strength
|
||||
|
@ -22,8 +22,8 @@ const std::string CONNECT_DESC = "AIBOM PRODUCTS version"; // Startup message
|
||||
const static int SIGNAL_CONTROL_MODE = 2; // SCSI positive logic specification
|
||||
|
||||
// Control signal output logic
|
||||
#define ACT_ON RASCSI_PIN_ON // ACTIVE SIGNAL ON
|
||||
#define ENB_ON RASCSI_PIN_ON // ENABLE SIGNAL ON
|
||||
#define ACT_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ACTIVE SIGNAL ON
|
||||
#define ENB_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ENABLE SIGNAL ON
|
||||
#define IND_IN RASCSI_PIN_OFF // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN RASCSI_PIN_OFF // TARGET SIGNAL INPUT
|
||||
#define DTD_IN RASCSI_PIN_OFF // DATA SIGNAL INPUT
|
||||
|
@ -48,7 +48,7 @@ bool GPIOBUS_Allwinner::Init(mode_e mode, board_type::rascsi_board_type_e rascsi
|
||||
// for (int i = 0; SignalTable[i] >= 0; i++) {
|
||||
// int j = SignalTable[i];
|
||||
// PinSetSignal(j, OFF);
|
||||
// PinConfig(j, GPIO_INPUT);
|
||||
// PinConfig(j, board_type::gpio_high_low_e::GPIO_INPUT);
|
||||
// PullConfig(j, pullmode);
|
||||
// }
|
||||
|
||||
@ -58,15 +58,15 @@ bool GPIOBUS_Allwinner::Init(mode_e mode, board_type::rascsi_board_type_e rascsi
|
||||
// PinSetSignal(PIN_TAD, OFF);
|
||||
// PinSetSignal(PIN_IND, OFF);
|
||||
// PinSetSignal(PIN_DTD, OFF);
|
||||
// PinConfig(PIN_ACT, GPIO_OUTPUT);
|
||||
// PinConfig(PIN_TAD, GPIO_OUTPUT);
|
||||
// PinConfig(PIN_IND, GPIO_OUTPUT);
|
||||
// PinConfig(PIN_DTD, GPIO_OUTPUT);
|
||||
// PinConfig(PIN_ACT, board_type::gpio_high_low_e::GPIO_OUTPUT);
|
||||
// PinConfig(PIN_TAD, board_type::gpio_high_low_e::GPIO_OUTPUT);
|
||||
// PinConfig(PIN_IND, board_type::gpio_high_low_e::GPIO_OUTPUT);
|
||||
// PinConfig(PIN_DTD, board_type::gpio_high_low_e::GPIO_OUTPUT);
|
||||
|
||||
// // Set the ENABLE signal
|
||||
// // This is used to show that the application is running
|
||||
// PinSetSignal(PIN_ENB, ENB_OFF);
|
||||
// PinConfig(PIN_ENB, GPIO_OUTPUT);
|
||||
// PinConfig(PIN_ENB, board_type::gpio_high_low_e::GPIO_OUTPUT);
|
||||
|
||||
|
||||
|
||||
@ -145,17 +145,17 @@ void GPIOBUS_Allwinner::Cleanup()
|
||||
// PinSetSignal(PIN_TAD, FALSE);
|
||||
// PinSetSignal(PIN_IND, FALSE);
|
||||
// PinSetSignal(PIN_DTD, FALSE);
|
||||
// PinConfig(PIN_ACT, GPIO_INPUT);
|
||||
// PinConfig(PIN_TAD, GPIO_INPUT);
|
||||
// PinConfig(PIN_IND, GPIO_INPUT);
|
||||
// PinConfig(PIN_DTD, GPIO_INPUT);
|
||||
// PinConfig(PIN_ACT, board_type::gpio_high_low_e::GPIO_INPUT);
|
||||
// PinConfig(PIN_TAD, board_type::gpio_high_low_e::GPIO_INPUT);
|
||||
// PinConfig(PIN_IND, board_type::gpio_high_low_e::GPIO_INPUT);
|
||||
// PinConfig(PIN_DTD, board_type::gpio_high_low_e::GPIO_INPUT);
|
||||
|
||||
// // Initialize all signals
|
||||
// for (i = 0; SignalTable[i] >= 0; i++)
|
||||
// {
|
||||
// pin = SignalTable[i];
|
||||
// PinSetSignal(pin, FALSE);
|
||||
// PinConfig(pin, GPIO_INPUT);
|
||||
// PinConfig(pin, board_type::gpio_high_low_e::GPIO_INPUT);
|
||||
// PullConfig(pin, GPIO_PULLNONE);
|
||||
// }
|
||||
|
||||
@ -183,7 +183,7 @@ void GPIOBUS_Allwinner::Reset()
|
||||
// break;
|
||||
// }
|
||||
|
||||
// SetSignal(j, RASCSI_PIN_OFF);
|
||||
// SetSignal(j, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
// }
|
||||
|
||||
// if (actmode == mode_e::TARGET) {
|
||||
@ -290,17 +290,17 @@ void GPIOBUS_Allwinner::MakeTable(void)
|
||||
LOGWARN("%s NOT IMPLEMENTED", __PRETTY_FUNCTION__)
|
||||
}
|
||||
|
||||
void GPIOBUS_Allwinner::SetControl(board_type::pi_physical_pin_e pin, bool ast)
|
||||
void GPIOBUS_Allwinner::SetControl(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
// GPIOBUS_Allwinner::SetSignal(pin, ast);
|
||||
LOGWARN("%s NOT IMPLEMENTED", __PRETTY_FUNCTION__)
|
||||
|
||||
}
|
||||
|
||||
void GPIOBUS_Allwinner::SetMode(board_type::pi_physical_pin_e pin, int mode)
|
||||
void GPIOBUS_Allwinner::SetMode(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode)
|
||||
{
|
||||
// LOGWARN("%s NOT IMPLEMENTED", __PRETTY_FUNCTION__)
|
||||
// if(mode == GPIO_INPUT){
|
||||
// if(mode == board_type::gpio_high_low_e::GPIO_INPUT){
|
||||
// pinMode(pin, INPUT);
|
||||
|
||||
// }else{
|
||||
@ -316,7 +316,7 @@ bool GPIOBUS_Allwinner::GetSignal(board_type::pi_physical_pin_e pin) const
|
||||
// return (digitalRead(pin) != 0);
|
||||
}
|
||||
|
||||
void GPIOBUS_Allwinner::SetSignal(board_type::pi_physical_pin_e pin, bool ast)
|
||||
void GPIOBUS_Allwinner::SetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
LOGWARN("%s NOT IMPLEMENTED", __PRETTY_FUNCTION__)
|
||||
// digitalWrite(pin, ast);
|
||||
@ -329,7 +329,7 @@ void GPIOBUS_Allwinner::SetSignal(board_type::pi_physical_pin_e pin, bool ast)
|
||||
//
|
||||
// TODO: maybe this should be moved to SCSI_Bus?
|
||||
//---------------------------------------------------------------------------
|
||||
bool GPIOBUS_Allwinner::WaitSignal(board_type::pi_physical_pin_e pin, int ast)
|
||||
bool GPIOBUS_Allwinner::WaitSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
LOGERROR("%s not implemented!!", __PRETTY_FUNCTION__)
|
||||
|
||||
@ -370,11 +370,11 @@ void GPIOBUS_Allwinner::EnableIRQ()
|
||||
LOGERROR("%s not implemented!!", __PRETTY_FUNCTION__)
|
||||
}
|
||||
|
||||
void GPIOBUS_Allwinner::PinConfig(board_type::pi_physical_pin_e pin, int mode)
|
||||
void GPIOBUS_Allwinner::PinConfig(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode)
|
||||
{
|
||||
LOGERROR("%s not implemented!!", __PRETTY_FUNCTION__)
|
||||
|
||||
// if(mode == GPIO_INPUT){
|
||||
// if(mode == board_type::gpio_high_low_e::GPIO_INPUT){
|
||||
// pinMode(pin, INPUT);
|
||||
|
||||
// }else{
|
||||
@ -383,7 +383,7 @@ void GPIOBUS_Allwinner::PinConfig(board_type::pi_physical_pin_e pin, int mode)
|
||||
}
|
||||
|
||||
|
||||
void GPIOBUS_Allwinner::PullConfig(board_type::pi_physical_pin_e pin, int mode)
|
||||
void GPIOBUS_Allwinner::PullConfig(board_type::pi_physical_pin_e pin, board_type::gpio_pull_up_down_e mode)
|
||||
{
|
||||
|
||||
// switch (mode)
|
||||
@ -405,7 +405,7 @@ void GPIOBUS_Allwinner::PullConfig(board_type::pi_physical_pin_e pin, int mode)
|
||||
}
|
||||
|
||||
|
||||
void GPIOBUS_Allwinner::PinSetSignal(board_type::pi_physical_pin_e pin, bool ast)
|
||||
void GPIOBUS_Allwinner::PinSetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
// digitalWrite(pin, ast);
|
||||
LOGERROR("%s not implemented!!", __PRETTY_FUNCTION__)
|
||||
|
@ -54,15 +54,15 @@ class GPIOBUS_Allwinner : public GPIOBUS
|
||||
// SCSI I/O signal control
|
||||
void MakeTable() override;
|
||||
// Create work data
|
||||
void SetControl(board_type::pi_physical_pin_e pin, bool ast) override;
|
||||
void SetControl(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set Control Signal
|
||||
void SetMode(board_type::pi_physical_pin_e pin, int mode) override;
|
||||
void SetMode(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) override;
|
||||
// Set SCSI I/O mode
|
||||
bool GetSignal(board_type::pi_physical_pin_e pin) const override;
|
||||
// Get SCSI input signal value
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, bool ast) override;
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set SCSI output signal value
|
||||
bool WaitSignal(board_type::pi_physical_pin_e pin, int ast) override;
|
||||
bool WaitSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Wait for a signal to change
|
||||
// Interrupt control
|
||||
void DisableIRQ() override;
|
||||
@ -71,11 +71,11 @@ class GPIOBUS_Allwinner : public GPIOBUS
|
||||
// IRQ Enabled
|
||||
|
||||
// GPIO pin functionality settings
|
||||
void PinConfig(board_type::pi_physical_pin_e pin, int mode) override;
|
||||
void PinConfig(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) override;
|
||||
// GPIO pin direction setting
|
||||
void PullConfig(board_type::pi_physical_pin_e pin, int mode) override;
|
||||
void PullConfig(board_type::pi_physical_pin_e pin, board_type::gpio_pull_up_down_e mode) override;
|
||||
// GPIO pin pull up/down resistor setting
|
||||
void PinSetSignal(board_type::pi_physical_pin_e pin, bool ast) override;
|
||||
void PinSetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set GPIO output signal
|
||||
void DrvConfig(DWORD drive) override;
|
||||
// Set GPIO drive strength
|
||||
|
@ -29,11 +29,11 @@ const static int PIN_TAD = 7; // TARGET CTRL DIRECTION
|
||||
const static int PIN_DTD = 8; // DATA DIRECTION
|
||||
|
||||
// Control signal output logic
|
||||
#define ACT_ON RASCSI_PIN_ON // ACTIVE SIGNAL ON
|
||||
#define ENB_ON RASCSI_PIN_ON // ENABLE SIGNAL ON
|
||||
#define IND_IN RASCSI_PIN_OFF // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN RASCSI_PIN_OFF // TARGET SIGNAL INPUT
|
||||
#define DTD_IN RASCSI_PIN_ON // DATA SIGNAL INPUT
|
||||
#define ACT_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ACTIVE SIGNAL ON
|
||||
#define ENB_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ENABLE SIGNAL ON
|
||||
#define IND_IN board_type::gpio_high_low_e::GPIO_STATE_LOW // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN board_type::gpio_high_low_e::GPIO_STATE_LOW // TARGET SIGNAL INPUT
|
||||
#define DTD_IN board_type::gpio_high_low_e::GPIO_STATE_HIGH // DATA SIGNAL INPUT
|
||||
|
||||
// SCSI signal pin assignment
|
||||
const static int PIN_DT0 = 10; // Data 0
|
||||
|
@ -22,11 +22,11 @@ const std::string CONNECT_DESC = "GAMERnium.com version"; // Startup message
|
||||
const static int SIGNAL_CONTROL_MODE = 0; // SCSI logical specification
|
||||
|
||||
// Control signal output logic
|
||||
#define ACT_ON RASCSI_PIN_ON // ACTIVE SIGNAL ON
|
||||
#define ENB_ON RASCSI_PIN_ON // ENABLE SIGNAL ON
|
||||
#define IND_IN RASCSI_PIN_OFF // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN RASCSI_PIN_OFF // TARGET SIGNAL INPUT
|
||||
#define DTD_IN RASCSI_PIN_ON // DATA SIGNAL INPUT
|
||||
#define ACT_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ACTIVE SIGNAL ON
|
||||
#define ENB_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ENABLE SIGNAL ON
|
||||
#define IND_IN board_type::gpio_high_low_e::GPIO_STATE_LOW // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN board_type::gpio_high_low_e::GPIO_STATE_LOW // TARGET SIGNAL INPUT
|
||||
#define DTD_IN board_type::gpio_high_low_e::GPIO_STATE_HIGH // DATA SIGNAL INPUT
|
||||
|
||||
// Control signal pin assignment (-1 means no control)
|
||||
const static int PIN_ACT = 14; // ACTIVE
|
||||
|
@ -187,43 +187,52 @@ bool GPIOBUS_Raspberry::Init(mode_e mode, board_type::rascsi_board_type_e rascsi
|
||||
|
||||
// Set pull up/pull down
|
||||
LOGTRACE("%s Set pull up/down....", __PRETTY_FUNCTION__);
|
||||
|
||||
#if SIGNAL_CONTROL_MODE == 0
|
||||
LOGTRACE("%s GPIO_PULLNONE", __PRETTY_FUNCTION__);
|
||||
int pullmode = GPIO_PULLNONE;
|
||||
#elif SIGNAL_CONTROL_MODE == 1
|
||||
LOGTRACE("%s GPIO_PULLUP", __PRETTY_FUNCTION__);
|
||||
int pullmode = GPIO_PULLUP;
|
||||
#else
|
||||
LOGTRACE("%s GPIO_PULLDOWN", __PRETTY_FUNCTION__);
|
||||
int pullmode = GPIO_PULLDOWN;
|
||||
#endif
|
||||
board_type::gpio_pull_up_down_e pullmode ;
|
||||
if (board->signal_control_mode == 0)
|
||||
{
|
||||
// #if SIGNAL_CONTROL_MODE == 0
|
||||
LOGTRACE("%s GPIO_PULLNONE", __PRETTY_FUNCTION__);
|
||||
pullmode = board_type::gpio_pull_up_down_e::GPIO_PULLNONE;
|
||||
}
|
||||
else if (board->signal_control_mode == 1)
|
||||
{
|
||||
// #elif SIGNAL_CONTROL_MODE == 1
|
||||
LOGTRACE("%s GPIO_PULLUP", __PRETTY_FUNCTION__);
|
||||
pullmode = board_type::gpio_pull_up_down_e ::GPIO_PULLUP;
|
||||
}
|
||||
else
|
||||
{
|
||||
// #else
|
||||
LOGTRACE("%s GPIO_PULLDOWN", __PRETTY_FUNCTION__);
|
||||
pullmode = board_type::gpio_pull_up_down_e ::GPIO_PULLDOWN;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// Initialize all signals
|
||||
LOGTRACE("%s Initialize all signals....", __PRETTY_FUNCTION__);
|
||||
|
||||
for (int i = 0; SignalTable[i] != board_type::pi_physical_pin_e::PI_PHYS_PIN_NONE; i++) {
|
||||
board_type::pi_physical_pin_e j = SignalTable[i];
|
||||
PinSetSignal(j, RASCSI_PIN_OFF);
|
||||
PinConfig(j, GPIO_INPUT);
|
||||
PinSetSignal(j, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinConfig(j, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PullConfig(j, pullmode);
|
||||
}
|
||||
|
||||
// Set control signals
|
||||
LOGTRACE("%s Set control signals....", __PRETTY_FUNCTION__);
|
||||
PinSetSignal(board->pin_act, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_tad, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_ind, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_dtd, RASCSI_PIN_OFF);
|
||||
PinConfig(board->pin_act, GPIO_OUTPUT);
|
||||
PinConfig(board->pin_tad, GPIO_OUTPUT);
|
||||
PinConfig(board->pin_ind, GPIO_OUTPUT);
|
||||
PinConfig(board->pin_dtd, GPIO_OUTPUT);
|
||||
PinSetSignal(board->pin_act, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_tad, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_ind, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_dtd, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinConfig(board->pin_act, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
PinConfig(board->pin_tad, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
PinConfig(board->pin_ind, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
PinConfig(board->pin_dtd, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
|
||||
// Set the ENABLE signal
|
||||
// This is used to show that the application is running
|
||||
PinSetSignal(board->pin_enb, ENB_OFF);
|
||||
PinConfig( board->pin_enb, GPIO_OUTPUT);
|
||||
PinSetSignal(board->pin_enb, board->EnbOff());
|
||||
PinConfig(board->pin_enb, board_type::gpio_direction_e::GPIO_OUTPUT);
|
||||
|
||||
// GPFSEL backup
|
||||
LOGTRACE("%s GPFSEL backup....", __PRETTY_FUNCTION__);
|
||||
@ -282,12 +291,14 @@ bool GPIOBUS_Raspberry::Init(mode_e mode, board_type::rascsi_board_type_e rascsi
|
||||
epoll_ctl(epfd, EPOLL_CTL_ADD, selevreq.fd, &ev);
|
||||
#else
|
||||
// Edge detection setting
|
||||
#if SIGNAL_CONTROL_MODE == 2
|
||||
gpio[GPIO_AREN_0] = 1 << PIN_SEL;
|
||||
#else
|
||||
gpio[GPIO_AFEN_0] = 1 << PIN_SEL;
|
||||
#endif // SIGNAL_CONTROL_MODE
|
||||
|
||||
if (board->signal_control_mode == 2) {
|
||||
// #if SIGNAL_CONTROL_MODE == 2
|
||||
gpio[GPIO_AREN_0] = 1 << PIN_SEL;
|
||||
} else {
|
||||
// #else
|
||||
gpio[GPIO_AFEN_0] = 1 << PIN_SEL;
|
||||
// #endif // SIGNAL_CONTROL_MODE
|
||||
}
|
||||
// Clear event
|
||||
gpio[GPIO_EDS_0] = 1 << PIN_SEL;
|
||||
|
||||
@ -355,22 +366,22 @@ void GPIOBUS_Raspberry::Cleanup()
|
||||
#endif // USE_SEL_EVENT_ENABLE
|
||||
|
||||
// Set control signals
|
||||
PinSetSignal(board->pin_enb, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_act, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_tad, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_ind, RASCSI_PIN_OFF);
|
||||
PinSetSignal(board->pin_dtd, RASCSI_PIN_OFF);
|
||||
PinConfig(board->pin_act, GPIO_INPUT);
|
||||
PinConfig(board->pin_tad, GPIO_INPUT);
|
||||
PinConfig(board->pin_ind, GPIO_INPUT);
|
||||
PinConfig(board->pin_dtd, GPIO_INPUT);
|
||||
PinSetSignal(board->pin_enb, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_act, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_tad, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_ind, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinSetSignal(board->pin_dtd, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinConfig(board->pin_act, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PinConfig(board->pin_tad, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PinConfig(board->pin_ind, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PinConfig(board->pin_dtd, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
|
||||
// Initialize all signals
|
||||
for (int i = 0; SignalTable[i] != board_type::pi_physical_pin_e::PI_PHYS_PIN_NONE; i++) {
|
||||
board_type::pi_physical_pin_e pin = SignalTable[i];
|
||||
PinSetSignal(pin, RASCSI_PIN_OFF);
|
||||
PinConfig(pin, GPIO_INPUT);
|
||||
PullConfig(pin, GPIO_PULLNONE);
|
||||
PinSetSignal(pin, board_type::gpio_high_low_e::GPIO_STATE_LOW);
|
||||
PinConfig(pin, board_type::gpio_direction_e::GPIO_INPUT);
|
||||
PullConfig(pin, board_type::gpio_pull_up_down_e::GPIO_PULLNONE);
|
||||
}
|
||||
|
||||
// Set drive strength back to 8mA
|
||||
@ -540,7 +551,7 @@ void GPIOBUS_Raspberry::MakeTable(void)
|
||||
// Control signal setting
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void GPIOBUS_Raspberry::SetControl(board_type::pi_physical_pin_e pin, bool ast)
|
||||
void GPIOBUS_Raspberry::SetControl(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
PinSetSignal(pin, ast);
|
||||
}
|
||||
@ -550,12 +561,12 @@ void GPIOBUS_Raspberry::SetControl(board_type::pi_physical_pin_e pin, bool ast)
|
||||
// Input/output mode setting
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void GPIOBUS_Raspberry::SetMode(board_type::pi_physical_pin_e hw_pin, int mode)
|
||||
void GPIOBUS_Raspberry::SetMode(board_type::pi_physical_pin_e hw_pin, board_type::gpio_direction_e mode)
|
||||
{
|
||||
int pin = phys_to_gpio_map.at(hw_pin);
|
||||
|
||||
#if SIGNAL_CONTROL_MODE == 0
|
||||
if (mode == RASCSI_PIN_OUT) {
|
||||
if (mode == board_type::gpio_direction_e::GPIO_OUTPUT) {
|
||||
return;
|
||||
}
|
||||
#endif // SIGNAL_CONTROL_MODE
|
||||
@ -564,7 +575,7 @@ void GPIOBUS_Raspberry::SetMode(board_type::pi_physical_pin_e hw_pin, int mode)
|
||||
int shift = (pin % 10) * 3;
|
||||
uint32_t data = gpfsel[index];
|
||||
data &= ~(0x7 << shift);
|
||||
if (mode == RASCSI_PIN_OUT) {
|
||||
if (mode == board_type::gpio_direction_e::GPIO_OUTPUT) {
|
||||
data |= (1 << shift);
|
||||
}
|
||||
gpio[index] = data;
|
||||
@ -587,34 +598,38 @@ bool GPIOBUS_Raspberry::GetSignal(board_type::pi_physical_pin_e hw_pin) const
|
||||
// Set output signal value
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void GPIOBUS_Raspberry::SetSignal(board_type::pi_physical_pin_e hw_pin, bool ast)
|
||||
void GPIOBUS_Raspberry::SetSignal(board_type::pi_physical_pin_e hw_pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
int pin = phys_to_gpio_map.at(hw_pin);
|
||||
|
||||
#if SIGNAL_CONTROL_MODE == 0
|
||||
int index = pin / 10;
|
||||
int shift = (pin % 10) * 3;
|
||||
uint32_t data = gpfsel[index];
|
||||
if (ast) {
|
||||
data |= (1 << shift);
|
||||
} else {
|
||||
data &= ~(0x7 << shift);
|
||||
if (board->signal_control_mode == 0) {
|
||||
// #if SIGNAL_CONTROL_MODE == 0
|
||||
int index = pin / 10;
|
||||
int shift = (pin % 10) * 3;
|
||||
uint32_t data = gpfsel[index];
|
||||
if (ast == board_type::gpio_high_low_e::GPIO_STATE_HIGH) {
|
||||
data |= (1 << shift);
|
||||
} else {
|
||||
data &= ~(0x7 << shift);
|
||||
}
|
||||
gpio[index] = data;
|
||||
gpfsel[index] = data;
|
||||
} else if (board->signal_control_mode == 1) {
|
||||
//#elif SIGNAL_CONTROL_MODE == 1
|
||||
if (ast == board_type::gpio_high_low_e::GPIO_STATE_HIGH) {
|
||||
gpio[GPIO_CLR_0] = 0x1 << pin;
|
||||
} else {
|
||||
gpio[GPIO_SET_0] = 0x1 << pin;
|
||||
}
|
||||
} else if (board->signal_control_mode == 2) {
|
||||
// #elif SIGNAL_CONTROL_MODE == 2
|
||||
if (ast == board_type::gpio_high_low_e::GPIO_STATE_HIGH) {
|
||||
gpio[GPIO_SET_0] = 0x1 << pin;
|
||||
} else {
|
||||
gpio[GPIO_CLR_0] = 0x1 << pin;
|
||||
}
|
||||
}
|
||||
gpio[index] = data;
|
||||
gpfsel[index] = data;
|
||||
#elif SIGNAL_CONTROL_MODE == 1
|
||||
if (ast) {
|
||||
gpio[GPIO_CLR_0] = 0x1 << pin;
|
||||
} else {
|
||||
gpio[GPIO_SET_0] = 0x1 << pin;
|
||||
}
|
||||
#elif SIGNAL_CONTROL_MODE == 2
|
||||
if (ast) {
|
||||
gpio[GPIO_SET_0] = 0x1 << pin;
|
||||
} else {
|
||||
gpio[GPIO_CLR_0] = 0x1 << pin;
|
||||
}
|
||||
#endif // SIGNAL_CONTROL_MODE
|
||||
// #endif // SIGNAL_CONTROL_MODE
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@ -623,7 +638,7 @@ void GPIOBUS_Raspberry::SetSignal(board_type::pi_physical_pin_e hw_pin, bool ast
|
||||
//
|
||||
// TODO: maybe this should be moved to SCSI_Bus?
|
||||
//---------------------------------------------------------------------------
|
||||
bool GPIOBUS_Raspberry::WaitSignal(board_type::pi_physical_pin_e hw_pin, int ast)
|
||||
bool GPIOBUS_Raspberry::WaitSignal(board_type::pi_physical_pin_e hw_pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
int pin = phys_to_gpio_map.at(hw_pin);
|
||||
// Get current time
|
||||
@ -641,7 +656,7 @@ bool GPIOBUS_Raspberry::WaitSignal(board_type::pi_physical_pin_e hw_pin, int ast
|
||||
}
|
||||
|
||||
// Check for the signal edge
|
||||
if (((signals >> pin) ^ ~ast) & 1) {
|
||||
if (((signals >> pin) ^ ~((int)board->gpio_state_to_bool(ast))) & 1) {
|
||||
return true;
|
||||
}
|
||||
} while ((SysTimer::GetTimerLow() - now) < timeout);
|
||||
@ -694,7 +709,7 @@ void GPIOBUS_Raspberry::EnableIRQ()
|
||||
// Pin direction setting (input/output)
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void GPIOBUS_Raspberry::PinConfig(board_type::pi_physical_pin_e hw_pin, int mode)
|
||||
void GPIOBUS_Raspberry::PinConfig(board_type::pi_physical_pin_e hw_pin, board_type::gpio_direction_e mode)
|
||||
{
|
||||
int pin = phys_to_gpio_map.at(hw_pin);
|
||||
|
||||
@ -705,7 +720,7 @@ void GPIOBUS_Raspberry::PinConfig(board_type::pi_physical_pin_e hw_pin, int mode
|
||||
|
||||
int index = pin / 10;
|
||||
uint32_t mask = ~(0x7 << ((pin % 10) * 3));
|
||||
gpio[index] = (gpio[index] & mask) | ((mode & 0x7) << ((pin % 10) * 3));
|
||||
gpio[index] = (gpio[index] & mask) | (((uint8_t)mode & 0x7) << ((pin % 10) * 3));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@ -713,7 +728,7 @@ void GPIOBUS_Raspberry::PinConfig(board_type::pi_physical_pin_e hw_pin, int mode
|
||||
// Pin pull-up/pull-down setting
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void GPIOBUS_Raspberry::PullConfig(board_type::pi_physical_pin_e hw_pin, int mode)
|
||||
void GPIOBUS_Raspberry::PullConfig(board_type::pi_physical_pin_e hw_pin, board_type::gpio_pull_up_down_e mode)
|
||||
{
|
||||
uint32_t pull;
|
||||
|
||||
@ -727,13 +742,13 @@ void GPIOBUS_Raspberry::PullConfig(board_type::pi_physical_pin_e hw_pin, int mod
|
||||
if (rpitype == 4) {
|
||||
LOGTRACE("%s I'm a Pi 4", __PRETTY_FUNCTION__)
|
||||
switch (mode) {
|
||||
case GPIO_PULLNONE:
|
||||
case board_type::gpio_pull_up_down_e::GPIO_PULLNONE:
|
||||
pull = 0;
|
||||
break;
|
||||
case GPIO_PULLUP:
|
||||
case board_type::gpio_pull_up_down_e::GPIO_PULLUP:
|
||||
pull = 1;
|
||||
break;
|
||||
case GPIO_PULLDOWN:
|
||||
case board_type::gpio_pull_up_down_e::GPIO_PULLDOWN:
|
||||
pull = 2;
|
||||
break;
|
||||
default:
|
||||
@ -748,7 +763,7 @@ void GPIOBUS_Raspberry::PullConfig(board_type::pi_physical_pin_e hw_pin, int mod
|
||||
gpio[GPIO_PUPPDN0 + (pin >> 4)] = bits;
|
||||
} else {
|
||||
pin &= 0x1f;
|
||||
gpio[GPIO_PUD] = mode & 0x3;
|
||||
gpio[GPIO_PUD] = (uint32_t)mode & 0x3;
|
||||
SysTimer::SleepUsec(2);
|
||||
gpio[GPIO_CLK_0] = 0x1 << pin;
|
||||
SysTimer::SleepUsec(2);
|
||||
@ -762,7 +777,7 @@ void GPIOBUS_Raspberry::PullConfig(board_type::pi_physical_pin_e hw_pin, int mod
|
||||
// Set output pin
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
void GPIOBUS_Raspberry::PinSetSignal(board_type::pi_physical_pin_e hw_pin, bool ast)
|
||||
void GPIOBUS_Raspberry::PinSetSignal(board_type::pi_physical_pin_e hw_pin, board_type::gpio_high_low_e ast)
|
||||
{
|
||||
int pin = phys_to_gpio_map.at(hw_pin);
|
||||
|
||||
@ -771,7 +786,7 @@ void GPIOBUS_Raspberry::PinSetSignal(board_type::pi_physical_pin_e hw_pin, bool
|
||||
return;
|
||||
}
|
||||
|
||||
if (ast) {
|
||||
if (ast == board_type::gpio_high_low_e::GPIO_STATE_HIGH) {
|
||||
gpio[GPIO_SET_0] = 0x1 << pin;
|
||||
} else {
|
||||
gpio[GPIO_CLR_0] = 0x1 << pin;
|
||||
@ -799,10 +814,12 @@ uint32_t GPIOBUS_Raspberry::Acquire()
|
||||
#else
|
||||
signals = *level;
|
||||
|
||||
#if SIGNAL_CONTROL_MODE < 2
|
||||
// Invert if negative logic (internal processing is unified to positive logic)
|
||||
signals = ~signals;
|
||||
#endif // SIGNAL_CONTROL_MODE
|
||||
if (board->signal_control_mode < 2) {
|
||||
// #if SIGNAL_CONTROL_MODE < 2
|
||||
// Invert if negative logic (internal processing is unified to positive logic)
|
||||
signals = ~signals;
|
||||
// #endif // SIGNAL_CONTROL_MODE
|
||||
}
|
||||
return signals;
|
||||
#endif // ifdef __x86_64__ || __X86__
|
||||
}
|
||||
|
@ -54,15 +54,15 @@ class GPIOBUS_Raspberry final : public GPIOBUS
|
||||
// SCSI I/O signal control
|
||||
void MakeTable() override;
|
||||
// Create work data
|
||||
void SetControl(board_type::pi_physical_pin_e pin, bool ast) override;
|
||||
void SetControl(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set Control Signal
|
||||
void SetMode(board_type::pi_physical_pin_e pin, int mode) override;
|
||||
void SetMode(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) override;
|
||||
// Set SCSI I/O mode
|
||||
bool GetSignal(board_type::pi_physical_pin_e pin) const override;
|
||||
// Get SCSI input signal value
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, bool ast) override;
|
||||
void SetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set SCSI output signal value
|
||||
bool WaitSignal(board_type::pi_physical_pin_e pin, int ast) override;
|
||||
bool WaitSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Wait for a signal to change
|
||||
// Interrupt control
|
||||
void DisableIRQ() override;
|
||||
@ -71,11 +71,11 @@ class GPIOBUS_Raspberry final : public GPIOBUS
|
||||
// IRQ Enabled
|
||||
|
||||
// GPIO pin functionality settings
|
||||
void PinConfig(board_type::pi_physical_pin_e pin, int mode) override;
|
||||
void PinConfig(board_type::pi_physical_pin_e pin, board_type::gpio_direction_e mode) override;
|
||||
// GPIO pin direction setting
|
||||
void PullConfig(board_type::pi_physical_pin_e pin, int mode) override;
|
||||
void PullConfig(board_type::pi_physical_pin_e pin, board_type::gpio_pull_up_down_e mode) override;
|
||||
// GPIO pin pull up/down resistor setting
|
||||
void PinSetSignal(board_type::pi_physical_pin_e pin, bool ast) override;
|
||||
void PinSetSignal(board_type::pi_physical_pin_e pin, board_type::gpio_high_low_e ast) override;
|
||||
// Set GPIO output signal
|
||||
void DrvConfig(uint32_t drive) override;
|
||||
// Set GPIO drive strength
|
||||
|
@ -29,11 +29,11 @@ const static int PIN_TAD = -1; // TARGET CTRL DIRECTION
|
||||
const static int PIN_DTD = -1; // DATA DIRECTION
|
||||
|
||||
// Control signal output logic
|
||||
#define ACT_ON RASCSI_PIN_ON // ACTIVE SIGNAL ON
|
||||
#define ENB_ON RASCSI_PIN_ON // ENABLE SIGNAL ON
|
||||
#define IND_IN RASCSI_PIN_OFF // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN RASCSI_PIN_OFF // TARGET SIGNAL INPUT
|
||||
#define DTD_IN RASCSI_PIN_ON // DATA SIGNAL INPUT
|
||||
#define ACT_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ACTIVE SIGNAL ON
|
||||
#define ENB_ON board_type::gpio_high_low_e::GPIO_STATE_HIGH // ENABLE SIGNAL ON
|
||||
#define IND_IN board_type::gpio_high_low_e::GPIO_STATE_LOW // INITIATOR SIGNAL INPUT
|
||||
#define TAD_IN board_type::gpio_high_low_e::GPIO_STATE_LOW // TARGET SIGNAL INPUT
|
||||
#define DTD_IN board_type::gpio_high_low_e::GPIO_STATE_HIGH // DATA SIGNAL INPUT
|
||||
|
||||
// SCSI signal pin assignment
|
||||
const static int PIN_DT0 = 10; // Data 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user