Share commo DMA related code for use with SPU

This commit is contained in:
Jaby
2024-09-10 22:50:05 +02:00
committed by Jaby
parent 584abcf545
commit b33fdca221
6 changed files with 70 additions and 54 deletions

View File

@@ -5,7 +5,7 @@
namespace JabyEngine {
namespace SPU {
namespace internal {
namespace DMA {
struct DMA {
static void wait() {
DMA_IO::SPU.wait();
}
@@ -14,7 +14,7 @@ namespace JabyEngine {
SPU_IO::ControlRegister.set_transfer_mode(SPU_IO::ControlRegister::Stop);
}
namespace Receive {
struct Receive {
static void prepare() {
SPU_IO::DataTransferControl.write(SPU_IO::DataTransferControl::NormalTransferMode());
SPU_IO::ControlRegister.set_transfer_mode(SPU_IO::ControlRegister::Stop);
@@ -36,8 +36,8 @@ namespace JabyEngine {
DMA_IO::SPU.block_ctrl.write(DMA_IO::BCR::from(SyncMode1::BlockSize.with(wordsPerBlock), SyncMode1::BlockAmount.with(blockCount)));
DMA_IO::SPU.channel_ctrl.write(DMA_IO::CHCHR::StartSPUReceive());
}
}
}
};
};
}
}
}