Shadowtrance a4dc633063
Feature additions (#434)
Lots of things "ported" over from the "enhanced" fork. With some adjustments here and there.

KeyboardBacklight driver (for T-Deck only currently)
Trackball driver (for T-Deck only currently)
Keyboard backlight sleep/wake (for T-Deck only currently...also requires keyboard firmware update)
Display sleep/wake
Files - create file/folder
Keyboard settings (for T-Deck only currently)
Time & Date settings tweaks
Locale settings tweaks
Systeminfo additions
Espnow wifi coexist

initI2cDevices - moved to T-deck init.cpp / initBoot
KeyboardInitService - removed,  moved to T-deck init.cpp / initBoot
Adjusted TIMER_UPDATE_INTERVAL to 2 seconds.
Added lock to ActionCreateFolder

Maybe missed some things in the list.

Display wake could do with some kind of block on wake first touch to prevent UI elements being hit when waking device with touch. Same with encoder/trackball/keyboard press i guess.

The original code was written by @cscott0108 at https://github.com/cscott0108/tactility-enhanced-t-deck
2026-01-02 12:14:55 +01:00

37 lines
940 B
C++

#include "TrackballDevice.h"
#include <Trackball/Trackball.h> // Driver
bool TrackballDevice::start() {
if (initialized) {
return true;
}
// T-Deck trackball GPIO configuration from LilyGo reference
trackball::TrackballConfig config = {
.pinRight = GPIO_NUM_2, // BOARD_TBOX_G02
.pinUp = GPIO_NUM_3, // BOARD_TBOX_G01
.pinLeft = GPIO_NUM_1, // BOARD_TBOX_G04
.pinDown = GPIO_NUM_15, // BOARD_TBOX_G03
.pinClick = GPIO_NUM_0, // BOARD_BOOT_PIN
.movementStep = 1 // pixels per movement
};
indev = trackball::init(config);
if (indev != nullptr) {
initialized = true;
return true;
}
return false;
}
bool TrackballDevice::stop() {
if (initialized) {
// LVGL will handle indev cleanup
trackball::deinit();
indev = nullptr;
initialized = false;
}
return true;
}