Kerry Martin
/
Liz_Test_Code
KSM edits
Diff: main.cpp
- Revision:
- 3:ca6a1026c28e
- Parent:
- 2:2076d9cc6db9
- Child:
- 5:bb970d40cd7d
- Child:
- 7:1002bb8871c0
diff -r 2076d9cc6db9 -r ca6a1026c28e main.cpp --- a/main.cpp Fri Jan 17 17:24:52 2014 +0000 +++ b/main.cpp Sun Dec 28 21:56:03 2014 +0000 @@ -8,6 +8,8 @@ int main() { int i; + Timer t; + float f = 10000000; pc.baud(460800); // I like a snappy terminal, so crank it up! pc.printf("\r\nRA8875 Test - Build " __DATE__ " " __TIME__ "\r\n"); @@ -15,11 +17,15 @@ pc.printf("Turning on display\r\n"); RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name - //lcd.Power(true); // display power is on, but the backlight is independent - //lcd.Backlight(1.0); - + t.start(); + lcd.init(); + lcd.frequency(f); + lcd.cls(); + wait_ms(250); + uint32_t tStart = t.read_us(); lcd.puts(0,0, - "RA8875 lcd(p5, p6, p7, p12, NC, \"tft\");\r\n\r\n" + "RA8875 lcd(p5, p6, p7, p12, NC, \"tft\");\r\n" + "lcd.init(true, 480,272,16);\r\n" "lcd.circle( 400,25, 25, BrightRed);\r\n" "lcd.fillcircle( 400,25, 15, RGB(128,255,128));\r\n" "lcd.ellipse( 440,75, 35,20, BrightBlue);\r\n" @@ -47,6 +53,17 @@ lcd.line( 430,200, 460,230, RGB(0,255,0)); for (i=0; i<=30; i+=5) lcd.pixel(435+i,200+i, White); - while (1) - ; + uint32_t tEnd = t.read_us(); + pc.printf("@ %4.2f MHz, elapsed time is %u usec.\r\n", (float)f/1000000, tEnd-tStart); + + lcd.KeypadInit(); + while(1) { + while(!lcd.readable()) + ; + if (lcd.readable()) { + int k = lcd.getc(); + pc.printf("key: %02X \r\n", k); + } + wait_ms(50); + } }