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:
Thu Dec 17 12:19:37 2015 +0000
Revision:
6:8e392d0ff74a
Parent:
5:bb970d40cd7d
Child:
9:2fcc3ee75ebd
Child:
10:02c622fa4969
Update with test mode disabled.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:037b95a5cc85 1 #include "mbed.h"
WiredHome 0:037b95a5cc85 2
WiredHome 0:037b95a5cc85 3 #include "RA8875.h"
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 0:037b95a5cc85 13
WiredHome 0:037b95a5cc85 14 int main()
WiredHome 0:037b95a5cc85 15 {
WiredHome 5:bb970d40cd7d 16 RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name
WiredHome 2:2076d9cc6db9 17
WiredHome 5:bb970d40cd7d 18 pc.baud(460800); // I like a snappy terminal, so crank it up!
WiredHome 5:bb970d40cd7d 19 pc.printf("\r\nRA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
WiredHome 2:2076d9cc6db9 20
WiredHome 3:ca6a1026c28e 21 lcd.init();
WiredHome 6:8e392d0ff74a 22
WiredHome 6:8e392d0ff74a 23
WiredHome 6:8e392d0ff74a 24 // **************************
WiredHome 6:8e392d0ff74a 25 //RunTestSet(lcd, pc);
WiredHome 6:8e392d0ff74a 26
WiredHome 6:8e392d0ff74a 27
WiredHome 5:bb970d40cd7d 28 lcd.foreground(BrightBlue);
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 5:bb970d40cd7d 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 5:bb970d40cd7d 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 5:bb970d40cd7d 42 lcd.puts("BPG_Arial10x10 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 43 lcd.SelectUserFont(BPG_Arial20x20);
WiredHome 5:bb970d40cd7d 44 lcd.puts("BPG_Arial20x20 ABCD\r\n");
WiredHome 5:bb970d40cd7d 45 lcd.SelectUserFont(BPG_Arial31x32);
WiredHome 5:bb970d40cd7d 46 lcd.puts("BPG_Arial31x32 ABCD\r\n");
WiredHome 5:bb970d40cd7d 47 lcd.SelectUserFont(BPG_Arial63x63);
WiredHome 5:bb970d40cd7d 48 lcd.puts("BPG_Arial63x63 ABCD\r\n");
WiredHome 5:bb970d40cd7d 49
WiredHome 5:bb970d40cd7d 50 RetCode_t r = lcd.PrintScreen(0,0,480,272,"/local/file.bmp");
WiredHome 5:bb970d40cd7d 51 pc.printf(" PrintScreen returned %d\r\n", r);
WiredHome 3:ca6a1026c28e 52
WiredHome 3:ca6a1026c28e 53 while(1) {
WiredHome 5:bb970d40cd7d 54 ; // end
WiredHome 3:ca6a1026c28e 55 }
WiredHome 0:037b95a5cc85 56 }