@@ -210,7 +210,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
210210 r = display -> sdCardInit ();
211211 if (r )
212212 {
213- r = display -> drawBitmapFromSd (strTemp , x , y );
213+ r = display -> image . drawBitmapFromSd (strTemp , x , y );
214214 SerialBT -> print ("#H(" );
215215 SerialBT -> print (r , DEC );
216216 SerialBT -> println (")*" );
@@ -355,7 +355,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
355355 r = display -> sdCardInit ();
356356 if (r )
357357 {
358- r = display -> drawImage (strTemp , x , y );
358+ r = display -> image . draw (strTemp , x , y );
359359 SerialBT -> print ("#H(" );
360360 SerialBT -> print (r , DEC );
361361 SerialBT -> println (")*" );
@@ -392,26 +392,26 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
392392 sscanf (s + 3 , "%d,%d,%d" , & hr , & min , & sec );
393393 // sprintf(temp, "display->rtcSetTime(%d, %d, %d);\n\r", hr, min, sec);
394394 // SerialBT->println(temp);
395- display -> rtcSetTime (hr , min , sec );
395+ display -> rtc . SetTime (hr , min , sec );
396396 break ;
397397 case 'X' :
398398 sscanf (s + 3 , "%d,%d,%d,%d" , & wday , & day , & mon , & yr );
399399 // sprintf(temp, "display->rtcSetDate(%d, %d, %d, %d);\n\r", wday, day, mon, yr);
400400 // SerialBT->println(temp);
401- display -> rtcSetDate (wday , day , mon , yr );
401+ display -> rtc . SetDate (wday , day , mon , yr );
402402 break ;
403403 case 'Y' :
404404 sscanf (s + 3 , "%d" , & ep );
405405 // sprintf(temp, "display->rtcSetEpoch(%d);\n\r", ep);
406406 // SerialBT->println(temp);
407- display -> rtcSetEpoch (ep );
407+ display -> rtc . SetEpoch (ep );
408408 break ;
409409 case 'Z' :
410410 sscanf (s + 3 , "%c" , & b );
411411 if (b == '?' )
412412 {
413413 SerialBT -> print ("#Z(" );
414- SerialBT -> print (display -> rtcGetEpoch ());
414+ SerialBT -> print (display -> rtc . GetEpoch ());
415415 SerialBT -> println (")*" );
416416 SerialBT -> flush ();
417417 }
@@ -423,30 +423,30 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
423423 SerialBT -> println ("INVALID" );
424424 break ;
425425 }
426- display -> rtcGetRtcData ();
426+ display -> rtc . GetRtcData ();
427427 SerialBT -> print ("#a(" );
428428 switch (k )
429429 {
430430 case 0 :
431- SerialBT -> print (display -> rtcGetSecond ());
431+ SerialBT -> print (display -> rtc . GetSecond ());
432432 break ;
433433 case 1 :
434- SerialBT -> print (display -> rtcGetMinute ());
434+ SerialBT -> print (display -> rtc . GetMinute ());
435435 break ;
436436 case 2 :
437- SerialBT -> print (display -> rtcGetHour ());
437+ SerialBT -> print (display -> rtc . GetHour ());
438438 break ;
439439 case 3 :
440- SerialBT -> print (display -> rtcGetDay ());
440+ SerialBT -> print (display -> rtc . GetDay ());
441441 break ;
442442 case 4 :
443- SerialBT -> print (display -> rtcGetWeekday ());
443+ SerialBT -> print (display -> rtc . GetWeekday ());
444444 break ;
445445 case 5 :
446- SerialBT -> print (display -> rtcGetMonth ());
446+ SerialBT -> print (display -> rtc . GetMonth ());
447447 break ;
448448 case 6 :
449- SerialBT -> print (display -> rtcGetYear ());
449+ SerialBT -> print (display -> rtc . GetYear ());
450450 break ;
451451 }
452452 SerialBT -> println (")*" );
@@ -456,20 +456,20 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
456456 sscanf (s + 3 , "%d,%d,%d,%d,%d" , & as , & am , & ah , & ad , & aw );
457457 // sprintf(temp, "display->rtcSetAlarm(%d, %d, %d, %d, %d);\n\r", as, am, ah, ad, aw);
458458 // SerialBT->println(temp);
459- display -> rtcSetAlarm (as , am , ah , ad , aw );
459+ display -> rtc . SetAlarm (as , am , ah , ad , aw );
460460 break ;
461461 case 'c' :
462462 sscanf (s + 3 , "%d,%d" , & ae , & amc );
463463 // sprintf(temp, "display->rtcSetAlarmEpoch(%d, %d);\n\r", ae, amc);
464464 // SerialBT->println(temp);
465- display -> rtcSetAlarmEpoch (ae , amc );
465+ display -> rtc . SetAlarmEpoch (ae , amc );
466466 break ;
467467 case 'd' :
468468 sscanf (s + 3 , "%c" , & b );
469469 if (b == '?' )
470470 {
471471 SerialBT -> print ("#d(" );
472- SerialBT -> print (display -> rtcCheckAlarmFlag ());
472+ SerialBT -> print (display -> rtc . CheckAlarmFlag ());
473473 SerialBT -> println (")*" );
474474 SerialBT -> flush ();
475475 }
@@ -479,7 +479,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
479479 if (b == '1' )
480480 {
481481 // SerialBT->println("display->rtcClearAlarmFlag()");
482- display -> rtcClearAlarmFlag ();
482+ display -> rtc . ClearAlarmFlag ();
483483 SerialBT -> flush ();
484484 }
485485 break ;
@@ -494,19 +494,19 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
494494 switch (k )
495495 {
496496 case 0 :
497- SerialBT -> print (display -> rtcGetAlarmSecond ());
497+ SerialBT -> print (display -> rtc . GetAlarmSecond ());
498498 break ;
499499 case 1 :
500- SerialBT -> print (display -> rtcGetAlarmMinute ());
500+ SerialBT -> print (display -> rtc . GetAlarmMinute ());
501501 break ;
502502 case 2 :
503- SerialBT -> print (display -> rtcGetAlarmHour ());
503+ SerialBT -> print (display -> rtc . GetAlarmHour ());
504504 break ;
505505 case 3 :
506- SerialBT -> print (display -> rtcGetAlarmDay ());
506+ SerialBT -> print (display -> rtc . GetAlarmDay ());
507507 break ;
508508 case 4 :
509- SerialBT -> print (display -> rtcGetAlarmWeekday ());
509+ SerialBT -> print (display -> rtc . GetAlarmWeekday ());
510510 break ;
511511 }
512512 SerialBT -> println (")*" );
@@ -523,14 +523,14 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
523523
524524 // sprintf(temp, "display->rtcTimerSet(%d, %d, %d, %d);\n\r", sc, v, ie, ip);
525525 // SerialBT->println(temp);
526- display -> rtcTimerSet (sc , v , ie , ip );
526+ display -> rtc . TimerSet (sc , v , ie , ip );
527527 break ;
528528 case 'h' :
529529 sscanf (s + 3 , "%c" , & b );
530530 if (b == '?' )
531531 {
532532 SerialBT -> print ("#h(" );
533- SerialBT -> print (display -> rtcCheckTimerFlag ());
533+ SerialBT -> print (display -> rtc . CheckTimerFlag ());
534534 SerialBT -> println (")*" );
535535 SerialBT -> flush ();
536536 }
@@ -540,23 +540,23 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
540540 if (b == '1' )
541541 {
542542 // SerialBT->println("display->rtcClearTimerFlag()");
543- display -> rtcClearTimerFlag ();
543+ display -> rtc . ClearTimerFlag ();
544544 }
545545 break ;
546546 case 'j' :
547547 sscanf (s + 3 , "%c" , & b );
548548 if (b == '1' )
549549 {
550550 // SerialBT->println("display->rtcDisableTimer()");
551- display -> rtcDisableTimer ();
551+ display -> rtc . DisableTimer ();
552552 }
553553 break ;
554554 case 'k' :
555555 sscanf (s + 3 , "%c" , & b );
556556 if (b == '?' )
557557 {
558558 SerialBT -> print ("#k(" );
559- SerialBT -> print (display -> rtcIsSet ());
559+ SerialBT -> print (display -> rtc . IsSet ());
560560 SerialBT -> println (")*" );
561561 SerialBT -> flush ();
562562 }
@@ -566,27 +566,27 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
566566 if (b == '1' )
567567 {
568568 // SerialBT->println("display->rtcReset()");
569- display -> rtcReset ();
569+ display -> rtc . Reset ();
570570 }
571571 break ;
572572 case 'm' :
573573 sscanf (s + 3 , "%c" , & b );
574574 if (b == '1' )
575575 {
576- display -> frontlight (true);
576+ display -> frontlight . setState (true);
577577 // SerialBT->println("display->frontlight(true);");
578578 }
579579 else
580580 {
581- display -> frontlight (false);
581+ display -> frontlight . setState (false);
582582 // SerialBT->println("display->frontlight(false);");
583583 }
584584 break ;
585585 case 'n' :
586586 sscanf (s + 3 , "%d" , & br );
587587 // sprintf(temp, "display->setFrontlight(%d);\n\r", br);
588588 // SerialBT->println(temp);
589- display -> setFrontlight (br );
589+ display -> frontlight . setBrightness (br );
590590 break ;
591591 case 'o' :
592592 sscanf (s + 3 , "%d" , & pwrs );
@@ -604,15 +604,15 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
604604 {
605605 // sprintf(temp, "display->tsShutdown();\n\r");
606606 // SerialBT->println(temp);
607- display -> tsShutdown ();
607+ display -> touchscreen . shutdown ();
608608 }
609609 break ;
610610 case 'r' :
611611 sscanf (s + 3 , "%c" , & b );
612612 if (b == '?' )
613613 {
614614 SerialBT -> print ("#r(" );
615- SerialBT -> print (display -> tsAvailable ());
615+ SerialBT -> print (display -> touchscreen . available ());
616616 SerialBT -> println (")*" );
617617 SerialBT -> flush ();
618618 }
@@ -621,7 +621,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
621621 sscanf (s + 3 , "%c" , & b );
622622 if (b == '?' )
623623 {
624- if (display -> tsGetData (tx1 , ty1 ) != 0 )
624+ if (display -> touchscreen . getData (tx1 , ty1 ) != 0 )
625625 {
626626 SerialBT -> print ("#s(" );
627627 SerialBT -> print (tx1 [0 ]);
@@ -636,7 +636,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
636636 sscanf (s + 3 , "%c" , & b );
637637 if (b == '?' )
638638 {
639- display -> tsGetRawData (rt );
639+ display -> touchscreen . getRawData (rt );
640640 for (int i = 0 ; i < 8 ; ++ i )
641641 {
642642 SerialBT -> print ("Reg " );
@@ -650,7 +650,7 @@ void run(char commandBuffer[], size_t n, Inkplate *display, BluetoothSerial *Ser
650650 // sprintf(temp, "display->touchInArea(%hu, %hu, %hu, %hu);\n\r", tx2, ty2, tw, th);
651651 // SerialBT->println(temp);
652652 SerialBT -> print ("#u(" );
653- SerialBT -> print (display -> touchInArea (tx2 , ty2 , tw , th ));
653+ SerialBT -> print (display -> touchscreen . touchInArea (tx2 , ty2 , tw , th ));
654654 SerialBT -> println (")*" );
655655 SerialBT -> flush ();
656656 break ;
0 commit comments