FreeCalypso > hg > freecalypso-sw
diff target-utils/c139explore/lcd.c @ 953:9e1be763b626
c139explore: hbars and vbars tests implemented
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Wed, 04 Nov 2015 04:09:44 +0000 |
parents | eb27543ce18e |
children |
line wrap: on
line diff
--- a/target-utils/c139explore/lcd.c Wed Nov 04 03:51:00 2015 +0000 +++ b/target-utils/c139explore/lcd.c Wed Nov 04 04:09:44 2015 +0000 @@ -122,3 +122,53 @@ while (npix--) send_pixel_value(pixval); } + +void +cmd_hbars() +{ + int i, j, k, p; + + /* + * The result of this command should be 8 horizontal bars + * in the natural RGB order. + */ + set_lcd_addr_region(16, 79, 0, 63); + for (i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + p = 0; + if (i & 4) + p |= 0xF800; + if (i & 2) + p |= 0x07E0; + if (i & 1) + p |= 0x001F; + for (k = 0; k < 64; k++) + send_pixel_value(p); + } + } +} + +void +cmd_vbars() +{ + int i, j, k, p; + + /* + * The result of this command should be 8 vertical bars + * in the natural RGB order. + */ + set_lcd_addr_region(16, 79, 0, 63); + for (i = 0; i < 64; i++) { + for (j = 0; j < 8; j++) { + p = 0; + if (j & 4) + p |= 0xF800; + if (j & 2) + p |= 0x07E0; + if (j & 1) + p |= 0x001F; + for (k = 0; k < 8; k++) + send_pixel_value(p); + } + } +}