abstracting display, touch and sd

This commit is contained in:
Adolfo Reyna
2026-01-28 20:12:41 -05:00
parent 57426c6e7d
commit adfbef7228
396 changed files with 101836 additions and 272 deletions

View File

@@ -0,0 +1,31 @@
#include "low_level_touch.h"
#include "low_level_touch_ft6336u.h"
#include <cstdio>
LowLevelTouch* LowLevelTouch::create(TouchType type, int screen_width, int screen_height,
bool swap_xy, bool invert_x, bool invert_y) {
LowLevelTouch* touch = nullptr;
switch (type) {
case TOUCH_TYPE_FT6336U:
printf("Creating FT6336U touch controller...\n");
touch = new LowLevelTouchFT6336U(screen_width, screen_height, swap_xy, invert_x, invert_y);
break;
case TOUCH_TYPE_NONE:
printf("No touch controller configured\n");
return nullptr;
default:
printf("Unknown touch type: %d\n", type);
return nullptr;
}
if (touch && !touch->init()) {
printf("Failed to initialize touch controller\n");
delete touch;
return nullptr;
}
return touch;
}