Implemented interrupt driven tx
This commit is contained in:
17
hardware.hpp
17
hardware.hpp
@@ -45,7 +45,7 @@ class Hardware {
|
||||
*Registers::CTRL_STAT_REG_C = controlRegC;
|
||||
}
|
||||
|
||||
static void txByteBlocking(typename cfg::data_t byte) FORCE_INLINE
|
||||
static void txByteBlocking(const typename cfg::data_t &byte) FORCE_INLINE
|
||||
{
|
||||
while (!(*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::DATA_REG_EMPTY)))
|
||||
;
|
||||
@@ -53,6 +53,21 @@ class Hardware {
|
||||
*Registers::IO_REG = byte;
|
||||
}
|
||||
|
||||
static void txByteInterrupt(volatile const typename cfg::data_t &byte) FORCE_INLINE
|
||||
{
|
||||
*Registers::IO_REG = byte;
|
||||
}
|
||||
|
||||
static void enableDataRegEmptyInt() FORCE_INLINE
|
||||
{
|
||||
*Registers::CTRL_STAT_REG_B |= (1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE);
|
||||
}
|
||||
|
||||
static void disableDataRegEmptyInt() FORCE_INLINE
|
||||
{
|
||||
*Registers::CTRL_STAT_REG_B &= ~(1 << CtrlFlagsB::DATA_REG_EMPTY_INT_ENABLE);
|
||||
}
|
||||
|
||||
private:
|
||||
struct DataBitsVal {
|
||||
uint8_t regCVal = 0;
|
||||
|
||||
Reference in New Issue
Block a user