Demonstration of Soft Fonts
Fork of RA8875_Demo by
Demo of Software based fonts mixed with RA8875 hosted fonts.
main.cpp@0:037b95a5cc85, 2014-01-17 (annotated)
- Committer:
- WiredHome
- Date:
- Fri Jan 17 03:19:55 2014 +0000
- Revision:
- 0:037b95a5cc85
- Child:
- 2:2076d9cc6db9
Demo Program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 0:037b95a5cc85 | 1 | #include "mbed.h" |
WiredHome | 0:037b95a5cc85 | 2 | |
WiredHome | 0:037b95a5cc85 | 3 | #include "RA8875.h" |
WiredHome | 0:037b95a5cc85 | 4 | |
WiredHome | 0:037b95a5cc85 | 5 | RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name |
WiredHome | 0:037b95a5cc85 | 6 | |
WiredHome | 0:037b95a5cc85 | 7 | Serial pc(USBTX, USBRX); |
WiredHome | 0:037b95a5cc85 | 8 | |
WiredHome | 0:037b95a5cc85 | 9 | int main() |
WiredHome | 0:037b95a5cc85 | 10 | { |
WiredHome | 0:037b95a5cc85 | 11 | pc.baud(460800); // I like a snappy terminal, so crank it up! |
WiredHome | 0:037b95a5cc85 | 12 | pc.printf("\r\nRA8875 Test - Build " __DATE__ " " __TIME__ "\r\n"); |
WiredHome | 0:037b95a5cc85 | 13 | |
WiredHome | 0:037b95a5cc85 | 14 | pc.printf("Turning on display\r\n"); |
WiredHome | 0:037b95a5cc85 | 15 | lcd.Reset(); |
WiredHome | 0:037b95a5cc85 | 16 | lcd.Power(true); // display power is on, but the backlight is independent |
WiredHome | 0:037b95a5cc85 | 17 | lcd.background(Black); |
WiredHome | 0:037b95a5cc85 | 18 | lcd.foreground(Blue); |
WiredHome | 0:037b95a5cc85 | 19 | lcd.cls(); |
WiredHome | 0:037b95a5cc85 | 20 | lcd.Backlight(1.0); |
WiredHome | 0:037b95a5cc85 | 21 | |
WiredHome | 0:037b95a5cc85 | 22 | lcd.puts(0,0, "Raio RA8875 Display Controller Library\r\n"); |
WiredHome | 0:037b95a5cc85 | 23 | lcd.puts("This library uses a 4-wire SPI interface.\r\n\r\n" |
WiredHome | 0:037b95a5cc85 | 24 | "lcd.circle( 400,15, 15, BrightRed);\r\n" |
WiredHome | 0:037b95a5cc85 | 25 | "lcd.fillcircle( 440,15, 15, RGB(128,255,128));\r\n" |
WiredHome | 0:037b95a5cc85 | 26 | "lcd.ellipse( 400,50, 25,10, BrightBlue);\r\n" |
WiredHome | 0:037b95a5cc85 | 27 | "lcd.fillellipse( 440,50, 25,10, Blue);\r\n" |
WiredHome | 0:037b95a5cc85 | 28 | "lcd.triangle( 400,75, 430,90, 410,100, Magenta);\r\n" |
WiredHome | 0:037b95a5cc85 | 29 | "lcd.filltriangle( 440,100, 480,120, 450,130, Cyan);\r\n" |
WiredHome | 0:037b95a5cc85 | 30 | "lcd.rect( 400,150, 479,200, Brown);\r\n" |
WiredHome | 0:037b95a5cc85 | 31 | "lcd.fillrect( 410,160, 470,190, Pink);\r\n" |
WiredHome | 0:037b95a5cc85 | 32 | "lcd.roundrect( 405,200, 450,255, 10,16, Yellow);\r\n" |
WiredHome | 0:037b95a5cc85 | 33 | "lcd.fillroundrect(420,220, 435,250, 5,8, RGB(10,30,50));"); |
WiredHome | 0:037b95a5cc85 | 34 | |
WiredHome | 0:037b95a5cc85 | 35 | lcd.circle( 400,15, 15, BrightRed); |
WiredHome | 0:037b95a5cc85 | 36 | lcd.fillcircle( 440,15, 15, RGB(128,255,128)); |
WiredHome | 0:037b95a5cc85 | 37 | lcd.ellipse( 400,50, 25,10, BrightBlue); |
WiredHome | 0:037b95a5cc85 | 38 | lcd.fillellipse( 440,50, 25,10, Blue); |
WiredHome | 0:037b95a5cc85 | 39 | lcd.triangle( 400,75, 430,90, 410,100, Magenta); |
WiredHome | 0:037b95a5cc85 | 40 | lcd.filltriangle( 440,100, 480,120, 450,130, Cyan); |
WiredHome | 0:037b95a5cc85 | 41 | lcd.rect( 400,150, 479,200, Brown); |
WiredHome | 0:037b95a5cc85 | 42 | lcd.fillrect( 410,160, 470,190, Pink); |
WiredHome | 0:037b95a5cc85 | 43 | lcd.roundrect( 405,200, 450,255, 10,16, Yellow); |
WiredHome | 0:037b95a5cc85 | 44 | lcd.fillroundrect(420,220, 435,250, 5,8, RGB(10,30,50)); |
WiredHome | 0:037b95a5cc85 | 45 | while (1) |
WiredHome | 0:037b95a5cc85 | 46 | ; |
WiredHome | 0:037b95a5cc85 | 47 | } |