mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-11 05:29:43 +00:00
Sc53C94: implement reading the FIFO register.
This commit is contained in:
parent
f2be286515
commit
2865a611e7
@ -82,6 +82,8 @@ uint8_t Sc53C94::read(uint8_t reg_offset)
|
|||||||
return this->xfer_count & 0xFFU;
|
return this->xfer_count & 0xFFU;
|
||||||
case Read::Reg53C94::Xfer_Cnt_MSB:
|
case Read::Reg53C94::Xfer_Cnt_MSB:
|
||||||
return (this->xfer_count >> 8) & 0xFFU;
|
return (this->xfer_count >> 8) & 0xFFU;
|
||||||
|
case Read::Reg53C94::FIFO:
|
||||||
|
return this->fifo_pop();
|
||||||
case Read::Reg53C94::Command:
|
case Read::Reg53C94::Command:
|
||||||
return this->cmd_fifo[0];
|
return this->cmd_fifo[0];
|
||||||
case Read::Reg53C94::Status:
|
case Read::Reg53C94::Status:
|
||||||
@ -321,6 +323,22 @@ void Sc53C94::fifo_push(const uint8_t data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t Sc53C94::fifo_pop()
|
||||||
|
{
|
||||||
|
uint8_t data = 0;
|
||||||
|
|
||||||
|
if (this->data_fifo_pos < 1) {
|
||||||
|
LOG_F(ERROR, "SC53C94: data FIFO underflow!");
|
||||||
|
this->status |= STAT_GE; // signal IOE/Gross Error
|
||||||
|
} else {
|
||||||
|
data = this->data_fifo[0];
|
||||||
|
this->data_fifo_pos--;
|
||||||
|
std:memmove(this->data_fifo, &this->data_fifo[1], this->data_fifo_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
void Sc53C94::seq_defer_state(uint64_t delay_ns)
|
void Sc53C94::seq_defer_state(uint64_t delay_ns)
|
||||||
{
|
{
|
||||||
seq_timer_id = TimerManager::get_instance()->add_oneshot_timer(
|
seq_timer_id = TimerManager::get_instance()->add_oneshot_timer(
|
||||||
|
@ -166,6 +166,7 @@ protected:
|
|||||||
void exec_command();
|
void exec_command();
|
||||||
void exec_next_command();
|
void exec_next_command();
|
||||||
void fifo_push(const uint8_t data);
|
void fifo_push(const uint8_t data);
|
||||||
|
uint8_t fifo_pop();
|
||||||
|
|
||||||
void sequencer();
|
void sequencer();
|
||||||
void seq_defer_state(uint64_t delay_ns);
|
void seq_defer_state(uint64_t delay_ns);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user