Skip to content

Commit

Permalink
Update handling of DP
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Mar 8, 2024
1 parent 79393e1 commit 07d5cc7
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions cpp/buses/rpi_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ void RpiBus::Reset()
SetMode(PIN_DT5, dir);
SetMode(PIN_DT6, dir);
SetMode(PIN_DT7, dir);
SetMode(PIN_DP, dir);

// Initialize all signals
signals = 0;
Expand Down Expand Up @@ -321,28 +322,17 @@ void RpiBus::SetIO(bool state)
SetSignal(PIN_IO, state);

// Change the data input/output direction by IO signal
if (state) {
SetControl(PIN_DTD, DTD_OUT);
SetDAT(0);
SetMode(PIN_DT0, OUT);
SetMode(PIN_DT1, OUT);
SetMode(PIN_DT2, OUT);
SetMode(PIN_DT3, OUT);
SetMode(PIN_DT4, OUT);
SetMode(PIN_DT5, OUT);
SetMode(PIN_DT6, OUT);
SetMode(PIN_DT7, OUT);
} else {
SetControl(PIN_DTD, DTD_IN);
SetMode(PIN_DT0, IN);
SetMode(PIN_DT1, IN);
SetMode(PIN_DT2, IN);
SetMode(PIN_DT3, IN);
SetMode(PIN_DT4, IN);
SetMode(PIN_DT5, IN);
SetMode(PIN_DT6, IN);
SetMode(PIN_DT7, IN);
}
SetControl(PIN_DTD, state ? DTD_OUT : DTD_IN);
const int dir = state ? OUT : IN;
SetMode(PIN_DT0, dir);
SetMode(PIN_DT1, dir);
SetMode(PIN_DT2, dir);
SetMode(PIN_DT3, dir);
SetMode(PIN_DT4, dir);
SetMode(PIN_DT5, dir);
SetMode(PIN_DT6, dir);
SetMode(PIN_DT7, dir);
SetMode(PIN_DP, dir);
}

inline uint8_t RpiBus::GetDAT()
Expand Down

0 comments on commit 07d5cc7

Please sign in to comment.