Demonstration of Soft Fonts

Dependencies:   mbed RA8875

Fork of RA8875_Demo by David Smart

Demo of Software based fonts mixed with RA8875 hosted fonts.

/media/uploads/WiredHome/softfont2.png

Committer:
WiredHome
Date:
Tue May 03 10:52:01 2016 +0000
Revision:
14:07b3f223d9ba
Parent:
13:43cc0a997c53
Child:
15:b4e3349cd319
Updated RA8875 and mbed libraries

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:037b95a5cc85 1
WiredHome 13:43cc0a997c53 2 #include "mbed.h" // v115
WiredHome 13:43cc0a997c53 3 #include "RA8875.h" // v107
WiredHome 5:bb970d40cd7d 4 #include "MyFont18x32.h"
WiredHome 5:bb970d40cd7d 5 #include "BPG_Arial08x08.h"
WiredHome 5:bb970d40cd7d 6 #include "BPG_Arial10x10.h"
WiredHome 5:bb970d40cd7d 7 #include "BPG_Arial20x20.h"
WiredHome 5:bb970d40cd7d 8 #include "BPG_Arial31x32.h"
WiredHome 5:bb970d40cd7d 9 #include "BPG_Arial63x63.h"
WiredHome 0:037b95a5cc85 10
WiredHome 5:bb970d40cd7d 11 LocalFileSystem local("local"); // Because I want <PrintScreen>
WiredHome 5:bb970d40cd7d 12 Serial pc(USBTX, USBRX); // And a little feedback
WiredHome 13:43cc0a997c53 13 Timer measurement;
WiredHome 0:037b95a5cc85 14
WiredHome 0:037b95a5cc85 15 int main()
WiredHome 0:037b95a5cc85 16 {
WiredHome 5:bb970d40cd7d 17 RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name
WiredHome 2:2076d9cc6db9 18
WiredHome 5:bb970d40cd7d 19 pc.baud(460800); // I like a snappy terminal, so crank it up!
WiredHome 5:bb970d40cd7d 20 pc.printf("\r\nRA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
WiredHome 2:2076d9cc6db9 21
WiredHome 13:43cc0a997c53 22 measurement.start();
WiredHome 14:07b3f223d9ba 23 lcd.init(480,272,8);
WiredHome 6:8e392d0ff74a 24
WiredHome 6:8e392d0ff74a 25 // **************************
WiredHome 10:02c622fa4969 26 //RunTestSet(lcd, pc); // If the library was compiled for test mode...
WiredHome 6:8e392d0ff74a 27
WiredHome 10:02c622fa4969 28 lcd.foreground(RGB(255,255,0));
WiredHome 5:bb970d40cd7d 29 lcd.puts(0,0, "RA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
WiredHome 0:037b95a5cc85 30
WiredHome 5:bb970d40cd7d 31 lcd.SelectUserFont(Dave_Smart18x32);
WiredHome 5:bb970d40cd7d 32 lcd.puts("**** ! Soft Fonts ! **** 0123456789\r\n");
WiredHome 5:bb970d40cd7d 33 lcd.puts("ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 10:02c622fa4969 34 //lcd.puts("abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 35 lcd.SelectUserFont();
WiredHome 5:bb970d40cd7d 36 lcd.puts("Back to normal\r\n");
WiredHome 5:bb970d40cd7d 37 lcd.SelectUserFont(BPG_Arial08x08);
WiredHome 5:bb970d40cd7d 38 lcd.puts("BPG_Arial08x08 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 10:02c622fa4969 39 //lcd.puts("BPG_Arial08x08 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 40 lcd.SelectUserFont(BPG_Arial10x10);
WiredHome 5:bb970d40cd7d 41 lcd.puts("BPG_Arial10x10 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 10:02c622fa4969 42 //lcd.puts("BPG_Arial10x10 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 43 lcd.SelectUserFont(BPG_Arial20x20);
WiredHome 10:02c622fa4969 44 lcd.puts("BPG_Arial20x20 ");
WiredHome 5:bb970d40cd7d 45 lcd.SelectUserFont(BPG_Arial31x32);
WiredHome 10:02c622fa4969 46 lcd.puts("BPG_Arial31x32\r\n");
WiredHome 5:bb970d40cd7d 47 lcd.SelectUserFont(BPG_Arial63x63);
WiredHome 10:02c622fa4969 48 lcd.puts("BPG_Arial63x63");
WiredHome 13:43cc0a997c53 49 pc.printf("Time trial completed in %d uSec\r\n", measurement.read_us());
WiredHome 5:bb970d40cd7d 50
WiredHome 10:02c622fa4969 51 pc.printf("PrintScreen activated ...\r\n");
WiredHome 5:bb970d40cd7d 52 RetCode_t r = lcd.PrintScreen(0,0,480,272,"/local/file.bmp");
WiredHome 5:bb970d40cd7d 53 pc.printf(" PrintScreen returned %d\r\n", r);
WiredHome 3:ca6a1026c28e 54
WiredHome 3:ca6a1026c28e 55 while(1) {
WiredHome 5:bb970d40cd7d 56 ; // end
WiredHome 3:ca6a1026c28e 57 }
WiredHome 0:037b95a5cc85 58 }