Skip to content

Commit

Permalink
Release 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Mar 10, 2024
1 parent 54e4378 commit cca2da4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion cpp/buses/rpi_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ void RpiBus::Reset()
SetMode(PIN_DT5, IN);
SetMode(PIN_DT6, IN);
SetMode(PIN_DT7, IN);
SetMode(PIN_DP, IN);
} else {
// Set the initiator signal to output
SetControl(PIN_IND, IND_OUT);
Expand All @@ -271,6 +272,7 @@ void RpiBus::Reset()
SetMode(PIN_DT5, OUT);
SetMode(PIN_DT6, OUT);
SetMode(PIN_DT7, OUT);
SetMode(PIN_DP, OUT);
}

// Initialize all signals
Expand Down Expand Up @@ -416,6 +418,7 @@ bool RpiBus::GetIO()
SetMode(PIN_DT5, IN);
SetMode(PIN_DT6, IN);
SetMode(PIN_DT7, IN);
SetMode(PIN_DP, IN);
} else {
SetControl(PIN_DTD, DTD_OUT);
SetMode(PIN_DT0, OUT);
Expand All @@ -426,6 +429,7 @@ bool RpiBus::GetIO()
SetMode(PIN_DT5, OUT);
SetMode(PIN_DT6, OUT);
SetMode(PIN_DT7, OUT);
SetMode(PIN_DP, OUT);
}
}

Expand All @@ -450,6 +454,7 @@ void RpiBus::SetIO(bool state)
SetMode(PIN_DT5, OUT);
SetMode(PIN_DT6, OUT);
SetMode(PIN_DT7, OUT);
SetMode(PIN_DP, OUT);
} else {
SetControl(PIN_DTD, DTD_IN);
SetMode(PIN_DT0, IN);
Expand All @@ -460,6 +465,7 @@ void RpiBus::SetIO(bool state)
SetMode(PIN_DT5, IN);
SetMode(PIN_DT6, IN);
SetMode(PIN_DT7, IN);
SetMode(PIN_DP, IN);
}
}

Expand All @@ -475,30 +481,45 @@ void RpiBus::SetREQ(bool state)

inline uint8_t RpiBus::GetDAT()
{
#if !defined BOARD_STANDARD && !defined BOARD_FULLSPEC
uint32_t data = Acquire();
data = ((data >> (PIN_DT0 - 0)) & (1 << 0)) | ((data >> (PIN_DT1 - 1)) & (1 << 1)) |
((data >> (PIN_DT2 - 2)) & (1 << 2)) | ((data >> (PIN_DT3 - 3)) & (1 << 3)) |
((data >> (PIN_DT4 - 4)) & (1 << 4)) | ((data >> (PIN_DT5 - 5)) & (1 << 5)) |
((data >> (PIN_DT6 - 6)) & (1 << 6)) | ((data >> (PIN_DT7 - 7)) & (1 << 7));

return (uint8_t)data;
#else
return static_cast<uint8_t>(Acquire() >> PIN_DT0);
#endif
}

void RpiBus::SetDAT(uint8_t dat)
{
// Write to port
#if SIGNAL_CONTROL_MODE == 0
uint32_t fsel = gpfsel[0];
uint32_t fsel;
#if !defined BOARD_STANDARD && !defined BOARD_FULLSPEC
fsel = gpfsel[0];
fsel &= tblDatMsk[0][dat];
fsel |= tblDatSet[0][dat];
gpfsel[0] = fsel;
gpio[GPIO_FSEL_0] = fsel;
#endif

fsel = gpfsel[1];
fsel &= tblDatMsk[1][dat];
fsel |= tblDatSet[1][dat];
gpfsel[1] = fsel;
gpio[GPIO_FSEL_1] = fsel;

#if !defined BOARD_STANDARD && !defined BOARD_FULLSPEC
fsel = gpfsel[2];
fsel &= tblDatMsk[2][dat];
fsel |= tblDatSet[2][dat];
gpfsel[2] = fsel;
gpio[GPIO_FSEL_2] = fsel;
#endif
#else
gpio[GPIO_CLR_0] = tblDatMsk[dat];
gpio[GPIO_SET_0] = tblDatSet[dat];
Expand Down
2 changes: 1 addition & 1 deletion cpp/shared/s2p_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

const int s2p_major_version = 3;
const int s2p_minor_version = 0;
const int s2p_revision = 1;
const int s2p_revision = 2;
const std::string s2p_suffix = "";

0 comments on commit cca2da4

Please sign in to comment.