mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
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
37 lines
926 B
C++
37 lines
926 B
C++
#pragma once
|
|
|
|
#include <driver/i2c.h>
|
|
#include <cstdint>
|
|
|
|
namespace keyboardbacklight {
|
|
|
|
/**
|
|
* @brief Initialize keyboard backlight control
|
|
* @param i2cPort I2C port number (I2C_NUM_0 or I2C_NUM_1)
|
|
* @param slaveAddress I2C slave address (default 0x55 for T-Deck keyboard)
|
|
* @return true if initialization succeeded
|
|
*/
|
|
bool init(i2c_port_t i2cPort, uint8_t slaveAddress = 0x55);
|
|
|
|
/**
|
|
* @brief Set keyboard backlight brightness
|
|
* @param brightness Brightness level (0-255, 0=off, 255=max)
|
|
* @return true if command succeeded
|
|
*/
|
|
bool setBrightness(uint8_t brightness);
|
|
|
|
/**
|
|
* @brief Set default keyboard backlight brightness for ALT+B toggle
|
|
* @param brightness Default brightness level (30-255)
|
|
* @return true if command succeeded
|
|
*/
|
|
bool setDefaultBrightness(uint8_t brightness);
|
|
|
|
/**
|
|
* @brief Get current keyboard backlight brightness
|
|
* @return Current brightness level (0-255)
|
|
*/
|
|
uint8_t getBrightness();
|
|
|
|
}
|