Update more converted IO

This commit is contained in:
2024-09-29 16:05:52 +02:00
parent 9620b0ec41
commit 5bafe78ab5
7 changed files with 36 additions and 42 deletions

View File

@@ -11,17 +11,17 @@ namespace JabyEngine {
using namespace Periphery_IO;
static void connect_to(uint16_t port) {
JOY_CTRL.write(Value::JOY_CTRL::create_for(port));
JOY_CTRL.write(Periphery_IO_Values::JOY_CTRL::create_for(port));
busy_loop(500);
}
static void close_connection() {
JOY_CTRL.write(Value::JOY_CTRL::close());
JOY_CTRL.write(Periphery_IO_Values::JOY_CTRL::close());
}
static void send_byte(uint8_t byte) {
while(!JOY_STAT.is_ready_transfer());
JOY_TX_DATA.write(Value::JOY_TX_DATA::create(byte));
JOY_TX_DATA.write(Periphery_IO_Values::JOY_TX_DATA::create(byte));
}
static uint8_t read_byte() {
@@ -30,8 +30,8 @@ namespace JabyEngine {
}
static void acknowledge() {
while(JOY_STAT.read().is_set(Value::JOY_STAT::ACKIrqLow));
JOY_CTRL.write(JOY_CTRL.read().set(Value::JOY_CTRL::ACK));
while(JOY_STAT.read().is_set(Periphery_IO_Values::JOY_STAT::ACKIrqLow));
JOY_CTRL.write(JOY_CTRL.read().set(Periphery_IO_Values::JOY_CTRL::ACK));
Interrupt::ack_irq(Interrupt::Periphery);
}