Implemented peeking with and without data for interrupt and blocking mode

This commit is contained in:
2019-08-02 18:20:06 +02:00
parent 95963295e2
commit a3d76a138d
4 changed files with 67 additions and 7 deletions

View File

@@ -73,6 +73,15 @@ class Hardware {
*Registers::IO_REG = byte;
}
static bool peekBlocking() FORCE_INLINE
{
if (*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::RECEIVE_COMPLETE)) {
return true;
}
return false;
}
static void enableDataRegEmptyInt() FORCE_INLINE
{
*Registers::CTRL_STAT_REG_B |= (1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE);