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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 #include "mbed.h"           // v112
00003 #include "RA8875.h"         // v102
00004 #include "MyFont18x32.h"
00005 #include "BPG_Arial08x08.h"
00006 #include "BPG_Arial10x10.h"
00007 #include "BPG_Arial20x20.h"
00008 #include "BPG_Arial31x32.h"
00009 #include "BPG_Arial63x63.h"
00010 
00011 #include "SDFileSystem.h" 
00012 #include "FATFileSystem.h" 
00013 
00014 
00015 
00016 //LocalFileSystem local("local");     // Because I want <PrintScreen>
00017 // Localfile system is not avail on K64F, but SD card is.
00018 SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd");
00019 
00020 Serial pc(USBTX, USBRX);            // And a little feedback
00021 
00022 int main()
00023 {
00024 //    RA8875 lcd(p5, p6, p7, p12, NC, "tft");    // MOSI, MISO, SCK, /ChipSelect, /reset, name
00025 RA8875 lcd(PTD2, PTD3, PTD1, PTD0, NC, "tft");    // MOSI, MISO, SCK, /ChipSelect, /reset, name
00026     
00027    pc.baud(115200);    
00028    pc.printf("\r\nRA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
00029 
00030     lcd.init();
00031     
00032     
00033     // **************************
00034     //RunTestSet(lcd, pc);  // If the library was compiled for test mode...
00035     
00036     lcd.foreground(RGB(255,255,0));
00037     lcd.puts(0,0, "RA8875 Soft Fonts - Build " __DATE__ " " __TIME__ "\r\n");
00038 
00039     lcd.SelectUserFont(Dave_Smart18x32);
00040     lcd.puts("**** ! Soft Fonts ! **** 0123456789\r\n");
00041     lcd.puts("ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
00042     //lcd.puts("abcdefghijklmnopqrstuvwxyz\r\n");
00043     lcd.SelectUserFont();
00044     lcd.puts("Back to normal\r\n");
00045     lcd.SelectUserFont(BPG_Arial08x08);
00046     lcd.puts("BPG_Arial08x08 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
00047     //lcd.puts("BPG_Arial08x08 abcdefghijklmnopqrstuvwxyz\r\n");    
00048     lcd.SelectUserFont(BPG_Arial10x10);
00049     lcd.puts("BPG_Arial10x10 ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n");
00050     //lcd.puts("BPG_Arial10x10 abcdefghijklmnopqrstuvwxyz\r\n");
00051     lcd.SelectUserFont(BPG_Arial20x20);
00052     lcd.puts("BPG_Arial20x20  ");
00053     lcd.SelectUserFont(BPG_Arial31x32);
00054     lcd.puts("BPG_Arial31x32\r\n");
00055     lcd.SelectUserFont(BPG_Arial63x63);
00056     lcd.puts("BPG_Arial63x63");
00057 
00058     pc.printf("PrintScreen activated ...\r\n");
00059     RetCode_t r = lcd.PrintScreen(0,0,480,272,"/sd/file.bmp");
00060     pc.printf("  PrintScreen returned %d\r\n", r);
00061     
00062     while(1) {
00063         ;       // end
00064     }
00065 }