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:
Sat Jan 23 17:55:47 2016 +0000
Revision:
12:e8a127d78000
Parent:
11:be714b7f0644
Child:
13:43cc0a997c53
update libs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:037b95a5cc85 1
WiredHome 12:e8a127d78000 2 #include "mbed.h" // v112
WiredHome 12:e8a127d78000 3 #include "RA8875.h" // v102
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 10:02c622fa4969 25 //RunTestSet(lcd, pc); // If the library was compiled for test mode...
WiredHome 6:8e392d0ff74a 26
WiredHome 10:02c622fa4969 27 lcd.foreground(RGB(255,255,0));
WiredHome 5:bb970d40cd7d 28 lcd.puts(0,0, "RA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
WiredHome 0:037b95a5cc85 29
WiredHome 5:bb970d40cd7d 30 lcd.SelectUserFont(Dave_Smart18x32);
WiredHome 5:bb970d40cd7d 31 lcd.puts("**** ! Soft Fonts ! **** 0123456789\r\n");
WiredHome 5:bb970d40cd7d 32 lcd.puts("ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 10:02c622fa4969 33 //lcd.puts("abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 34 lcd.SelectUserFont();
WiredHome 5:bb970d40cd7d 35 lcd.puts("Back to normal\r\n");
WiredHome 5:bb970d40cd7d 36 lcd.SelectUserFont(BPG_Arial08x08);
WiredHome 5:bb970d40cd7d 37 lcd.puts("BPG_Arial08x08 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 10:02c622fa4969 38 //lcd.puts("BPG_Arial08x08 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 39 lcd.SelectUserFont(BPG_Arial10x10);
WiredHome 5:bb970d40cd7d 40 lcd.puts("BPG_Arial10x10 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 10:02c622fa4969 41 //lcd.puts("BPG_Arial10x10 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 42 lcd.SelectUserFont(BPG_Arial20x20);
WiredHome 10:02c622fa4969 43 lcd.puts("BPG_Arial20x20 ");
WiredHome 5:bb970d40cd7d 44 lcd.SelectUserFont(BPG_Arial31x32);
WiredHome 10:02c622fa4969 45 lcd.puts("BPG_Arial31x32\r\n");
WiredHome 5:bb970d40cd7d 46 lcd.SelectUserFont(BPG_Arial63x63);
WiredHome 10:02c622fa4969 47 lcd.puts("BPG_Arial63x63");
WiredHome 5:bb970d40cd7d 48
WiredHome 10:02c622fa4969 49 pc.printf("PrintScreen activated ...\r\n");
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 }