pub fn write(&mut self, data: &[u8]) -> Result<(), Error> {
        for chunk in data.chunks(64) {
            for byte in chunk {
                self.regs()
                    .ep1()
                    .write(|w| unsafe { w.rdwr_byte().bits(*byte) });
            }
            self.regs().ep1_conf().modify(|_, w| w.wr_done().set_bit());

            // FIXME: raw register access
            while self.regs().ep1_conf().read().bits() & 0b011 == 0b000 {
                // wait
            }
        }

        Ok(())
    }
Write data to the serial output in chunks of up to 64 bytes
esp-hal/src/usb_serial_jtag.rs