FRDM-K64F version of David Smart's RA8875_Demo using SDFileSystem to write to an SD card instead of LocalFileSystem

Dependencies:   RA8875 SDFileSystem mbed

Fork of RA8875_Demo by David Smart

/media/uploads/unix_guru/ra8875_demo.png

Committer:
unix_guru
Date:
Tue Feb 23 02:49:18 2016 +0000
Revision:
13:3f6204d6140a
Parent:
12:e8a127d78000
K64F Version of RA8875_Demo

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
unix_guru 13:3f6204d6140a 11 #include "SDFileSystem.h"
unix_guru 13:3f6204d6140a 12 #include "FATFileSystem.h"
unix_guru 13:3f6204d6140a 13
unix_guru 13:3f6204d6140a 14
unix_guru 13:3f6204d6140a 15
unix_guru 13:3f6204d6140a 16 //LocalFileSystem local("local"); // Because I want <PrintScreen>
unix_guru 13:3f6204d6140a 17 // Localfile system is not avail on K64F, but SD card is.
unix_guru 13:3f6204d6140a 18 SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd");
unix_guru 13:3f6204d6140a 19
WiredHome 5:bb970d40cd7d 20 Serial pc(USBTX, USBRX); // And a little feedback
WiredHome 0:037b95a5cc85 21
WiredHome 0:037b95a5cc85 22 int main()
WiredHome 0:037b95a5cc85 23 {
unix_guru 13:3f6204d6140a 24 // RA8875 lcd(p5, p6, p7, p12, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name
unix_guru 13:3f6204d6140a 25 RA8875 lcd(PTD2, PTD3, PTD1, PTD0, NC, "tft"); // MOSI, MISO, SCK, /ChipSelect, /reset, name
WiredHome 2:2076d9cc6db9 26
unix_guru 13:3f6204d6140a 27 pc.baud(115200);
unix_guru 13:3f6204d6140a 28 pc.printf("\r\nRA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
WiredHome 2:2076d9cc6db9 29
WiredHome 3:ca6a1026c28e 30 lcd.init();
WiredHome 6:8e392d0ff74a 31
WiredHome 6:8e392d0ff74a 32
WiredHome 6:8e392d0ff74a 33 // **************************
WiredHome 9:02c622fa4969 34 //RunTestSet(lcd, pc); // If the library was compiled for test mode...
WiredHome 6:8e392d0ff74a 35
WiredHome 9:02c622fa4969 36 lcd.foreground(RGB(255,255,0));
WiredHome 5:bb970d40cd7d 37 lcd.puts(0,0, "RA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
WiredHome 0:037b95a5cc85 38
WiredHome 5:bb970d40cd7d 39 lcd.SelectUserFont(Dave_Smart18x32);
WiredHome 5:bb970d40cd7d 40 lcd.puts("**** ! Soft Fonts ! **** 0123456789\r\n");
WiredHome 5:bb970d40cd7d 41 lcd.puts("ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 9:02c622fa4969 42 //lcd.puts("abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 43 lcd.SelectUserFont();
WiredHome 5:bb970d40cd7d 44 lcd.puts("Back to normal\r\n");
WiredHome 5:bb970d40cd7d 45 lcd.SelectUserFont(BPG_Arial08x08);
WiredHome 5:bb970d40cd7d 46 lcd.puts("BPG_Arial08x08 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 9:02c622fa4969 47 //lcd.puts("BPG_Arial08x08 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 48 lcd.SelectUserFont(BPG_Arial10x10);
WiredHome 5:bb970d40cd7d 49 lcd.puts("BPG_Arial10x10 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
WiredHome 9:02c622fa4969 50 //lcd.puts("BPG_Arial10x10 abcdefghijklmnopqrstuvwxyz\r\n");
WiredHome 5:bb970d40cd7d 51 lcd.SelectUserFont(BPG_Arial20x20);
WiredHome 9:02c622fa4969 52 lcd.puts("BPG_Arial20x20 ");
WiredHome 5:bb970d40cd7d 53 lcd.SelectUserFont(BPG_Arial31x32);
WiredHome 9:02c622fa4969 54 lcd.puts("BPG_Arial31x32\r\n");
WiredHome 5:bb970d40cd7d 55 lcd.SelectUserFont(BPG_Arial63x63);
WiredHome 9:02c622fa4969 56 lcd.puts("BPG_Arial63x63");
WiredHome 5:bb970d40cd7d 57
WiredHome 9:02c622fa4969 58 pc.printf("PrintScreen activated ...\r\n");
unix_guru 13:3f6204d6140a 59 RetCode_t r = lcd.PrintScreen(0,0,480,272,"/sd/file.bmp");
WiredHome 5:bb970d40cd7d 60 pc.printf(" PrintScreen returned %d\r\n", r);
WiredHome 3:ca6a1026c28e 61
WiredHome 3:ca6a1026c28e 62 while(1) {
WiredHome 5:bb970d40cd7d 63 ; // end
WiredHome 3:ca6a1026c28e 64 }
WiredHome 0:037b95a5cc85 65 }