# GBA Serial Port Notes ## UART Mode (non-FIFO) This mode can probably be made to work with the `embedded_hal` crate, somehow or another. 1) set up UART mode with `RCNT=0` and `SIOCNT=3<<12` 2) build a value to write to `SCCNT_L` and set it * baud rate (whichever you want) * data length = 8-bit (bit set) * (optional) send enabled * (optional) recv enabled * (optional) irq enabled 3) Write data to `SIODATA8` to set it for sending, and Read data from `SIODATA8` to get it after receiving. `SIODATA8` read/write are disjoint, writing an outgoing byte doesn't destroy the incoming byte 4) When any of `SCCNT_L` bits 4-6 are flagged on (for send, recv, err), an interrupt will fire. Always acknowledge the serial interrupt before doing the handling code or the serial status bits will mess up and it'll softlock (?)