From b0eb578eafc06b1ff9624996c5b93b55e9595743 Mon Sep 17 00:00:00 2001 From: penguinencounter <49845522+penguinencounter@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:25:56 -0700 Subject: [PATCH] hell yeah --- .../teamcode/drivers/UARTBridgeI2CDevice.kt | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drivers/UARTBridgeI2CDevice.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drivers/UARTBridgeI2CDevice.kt index 28f23fdd66f..5e88edf002f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drivers/UARTBridgeI2CDevice.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drivers/UARTBridgeI2CDevice.kt @@ -14,8 +14,69 @@ class UARTBridgeI2CDevice(deviceClient: I2cDeviceSynch, deviceClientIsOwned: Boo override fun getDeviceName() = "SandboxElectronics_SC16IS750_I2C_UART_Bridge" + enum class Register(val byteN: Byte) { + /** + * Receive Holding Register (read only) + */ + RHR(0x00), + + /** + * Transmit Holding Register (write only) + */ + THR(0x00), + + /** + * Interrupt Enable Register (read/write) + */ + IER(0x01), + + /** + * Interrupt Identification Register (read) + * Do not burst-read + */ + IIR(0x02), + + /** + * FIFO Control Register (write) + */ + FCR(0x02), + + /** + * Line Control Register (read) + */ + LCR(0x03), + + /** + * Modem Control Register (read) + */ + MCR(0x04), + LSR(0x05), + MSR(0x06), + SPR(0x07), + TCR(0x06), + TLR(0x07), + TXLVL(0x08), + RXLVL(0x09), + IODir(0x0a), + IOState(0x0b), + IOIntEna(0x0c), + RESERVED1(0x0d), + IOControl(0x0e), + EFCR(0x0f), + + DLL(0x00), + DLH(0x01), + + EFR(0x02), + XON1(0x04), + XON2(0x05), + XOFF1(0x06), + XOFF2(0x07) + } + @Synchronized override fun doInitialize(): Boolean { - deviceClient.read + + TODO() } } \ No newline at end of file