FreeCalypso > hg > freecalypso-hwlab
diff lcdtest/busops.c @ 14:5a602e512b12
lcdtest: read ops split into command issuance and FTDI read
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 07 Apr 2018 01:19:14 +0000 |
parents | 238a77db4134 |
children | 4b7cac119fb5 |
line wrap: on
line diff
--- a/lcdtest/busops.c Fri Apr 06 06:43:02 2018 +0000 +++ b/lcdtest/busops.c Sat Apr 07 01:19:14 2018 +0000 @@ -72,27 +72,3 @@ cmd[8] = val16; do_ftdi_write(cmd, 9); } - -bus_read(rs) -{ - u_char cmd[8], resp[2]; - - /* set RS */ - cmd[0] = 0x82; - cmd[1] = rs ? 0x03 : 0x02; - cmd[2] = 0x03; - /* read upper byte */ - cmd[3] = 0x90; - cmd[4] = 0; /* dummy addr */ - /* read lower byte */ - cmd[5] = 0x90; - cmd[6] = 0; /* dummy addr */ - /* send immediate */ - cmd[7] = 0x87; - do_ftdi_write(cmd, 8); - if (ftdi_read_data(&ftdi, resp, 2) != 2) { - fprintf(stderr, "FTDI read error: %s\n", ftdi.error_str); - exit(1); - } - return (resp[0] << 8) | resp[1]; -}