Simple program to test BlockMove API on the RA8875 display. Tested with RA8875 v148 and mbed v148

Dependencies:   mbed RA8875

Committer:
WiredHome
Date:
Sun Mar 29 18:14:15 2020 +0000
Revision:
4:e5375f29d8d4
Parent:
0:d06677ab6ca6
Pick up a bug-fix on jpeg rendering

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:d06677ab6ca6 1 #include "ResistiveTouchCal.h"
WiredHome 0:d06677ab6ca6 2
WiredHome 0:d06677ab6ca6 3 void CalibrateTS(RA8875 & lcd)
WiredHome 0:d06677ab6ca6 4 {
WiredHome 0:d06677ab6ca6 5 FILE * fh;
WiredHome 0:d06677ab6ca6 6 tpMatrix_t matrix;
WiredHome 0:d06677ab6ca6 7 RetCode_t r;
WiredHome 0:d06677ab6ca6 8 Timer testperiod;
WiredHome 0:d06677ab6ca6 9
WiredHome 0:d06677ab6ca6 10 r = lcd.TouchPanelCalibrate("Calibrate the touch panel", &matrix);
WiredHome 0:d06677ab6ca6 11 if (r == noerror) {
WiredHome 0:d06677ab6ca6 12 fh = fopen("/local/tpcal.cfg", "wb");
WiredHome 0:d06677ab6ca6 13 if (fh) {
WiredHome 0:d06677ab6ca6 14 fwrite(&matrix, sizeof(tpMatrix_t), 1, fh);
WiredHome 0:d06677ab6ca6 15 fclose(fh);
WiredHome 0:d06677ab6ca6 16 printf(" tp cal written.\r\n");
WiredHome 0:d06677ab6ca6 17 lcd.cls();
WiredHome 0:d06677ab6ca6 18 } else {
WiredHome 0:d06677ab6ca6 19 printf(" couldn't open tpcal file.\r\n");
WiredHome 0:d06677ab6ca6 20 }
WiredHome 0:d06677ab6ca6 21 } else {
WiredHome 0:d06677ab6ca6 22 printf("error return: %d\r\n", r);
WiredHome 0:d06677ab6ca6 23 }
WiredHome 0:d06677ab6ca6 24 lcd.cls();
WiredHome 0:d06677ab6ca6 25 }
WiredHome 0:d06677ab6ca6 26
WiredHome 0:d06677ab6ca6 27 void InitTS(RA8875 & lcd)
WiredHome 0:d06677ab6ca6 28 {
WiredHome 0:d06677ab6ca6 29 FILE * fh;
WiredHome 0:d06677ab6ca6 30 tpMatrix_t matrix;
WiredHome 0:d06677ab6ca6 31
WiredHome 0:d06677ab6ca6 32 fh = fopen("/local/tpcal.cfg", "rb");
WiredHome 0:d06677ab6ca6 33 if (fh) {
WiredHome 0:d06677ab6ca6 34 fread(&matrix, sizeof(tpMatrix_t), 1, fh);
WiredHome 0:d06677ab6ca6 35 fclose(fh);
WiredHome 0:d06677ab6ca6 36 lcd.TouchPanelSetMatrix(&matrix);
WiredHome 0:d06677ab6ca6 37 printf(" tp cal loaded.\r\n");
WiredHome 0:d06677ab6ca6 38 } else {
WiredHome 0:d06677ab6ca6 39 CalibrateTS(lcd);
WiredHome 0:d06677ab6ca6 40 }
WiredHome 0:d06677ab6ca6 41 }