Skip to content

Commit 2b5dbef

Browse files
authored
Merge branch 'master' into pmtiles
2 parents e1ed3bd + a3e0e1b commit 2b5dbef

File tree

11 files changed

+596
-166
lines changed

11 files changed

+596
-166
lines changed

.trunk/trunk.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cli:
66
plugins:
77
sources:
88
- id: trunk
9-
ref: v1.7.1
9+
ref: v1.7.2
1010
uri: https://github.com/trunk-io/plugins
1111
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1212
runtimes:
@@ -17,15 +17,15 @@ runtimes:
1717
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
1818
lint:
1919
enabled:
20-
20+
2121
2222
23-
23+
2424
25-
- trivy@0.64.1
25+
- trivy@0.65.0
2626
27-
- taplo@0.9.3
28-
27+
- taplo@0.10.0
28+
2929
3030
3131
@@ -34,7 +34,7 @@ lint:
3434
3535
3636
37-
- shellcheck@0.10.0
37+
- shellcheck@0.11.0
3838
3939
- git-diff-check
4040

include/graphics/view/TFT/TFTView_320x240.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ class TFTView_320x240 : public MeshtasticView
398398
bool packetLogEnabled; // display received packets
399399
bool detectorRunning; // meshDetector is active
400400
bool formatSD; // offer to format SD card
401+
uint16_t buttonSize; // size of group/chat buttons in pixels
401402
uint16_t statisticTableRows; // number of rows in statistics table
402403
uint16_t packetCounter; // number of packets in packet log
403404
time_t lastrun60, lastrun10, lastrun5, lastrun1; // timers for task loop
Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,94 @@
11
#pragma once
22

33
#include "input/InputDriver.h"
4+
#include <list>
5+
#include <memory>
6+
#include <string>
47

58
class I2CKeyboardInputDriver : public InputDriver
69
{
710
public:
811
I2CKeyboardInputDriver(void);
912
virtual void init(void) override;
10-
virtual void task_handler(void) override;
11-
virtual ~I2CKeyboardInputDriver(void);
13+
virtual void task_handler(void) override{};
14+
virtual void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) = 0;
15+
virtual ~I2CKeyboardInputDriver(void) {}
16+
17+
struct KeyboardDefinition {
18+
I2CKeyboardInputDriver *driver; // Pointer to the driver instance
19+
std::string name; // Name of the keyboard
20+
uint8_t address; // I2C address of the keyboard
21+
};
22+
23+
using KeyboardList = std::list<std::unique_ptr<KeyboardDefinition>>;
24+
static KeyboardList &getI2CKeyboardList(void) { return i2cKeyboardList; }
25+
26+
protected:
27+
bool registerI2CKeyboard(I2CKeyboardInputDriver *driver, std::string name, uint8_t address);
1228

1329
private:
1430
static void keyboard_read(lv_indev_t *indev, lv_indev_data_t *data);
15-
};
31+
32+
static KeyboardList i2cKeyboardList; // list of registered I2C keyboards
33+
};
34+
35+
class TDeckKeyboardInputDriver : public I2CKeyboardInputDriver
36+
{
37+
public:
38+
TDeckKeyboardInputDriver(uint8_t address);
39+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
40+
virtual ~TDeckKeyboardInputDriver(void) {}
41+
};
42+
43+
class TCA8418KeyboardInputDriver : public I2CKeyboardInputDriver
44+
{
45+
public:
46+
TCA8418KeyboardInputDriver(uint8_t address);
47+
void init(void) override;
48+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
49+
virtual ~TCA8418KeyboardInputDriver(void) {}
50+
};
51+
52+
class TLoraPagerKeyboardInputDriver : public TCA8418KeyboardInputDriver
53+
{
54+
public:
55+
TLoraPagerKeyboardInputDriver(uint8_t address);
56+
void init(void) override;
57+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
58+
virtual ~TLoraPagerKeyboardInputDriver(void) {}
59+
};
60+
61+
class TDeckProKeyboardInputDriver : public TCA8418KeyboardInputDriver
62+
{
63+
public:
64+
TDeckProKeyboardInputDriver(uint8_t address);
65+
void init(void) override;
66+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
67+
virtual ~TDeckProKeyboardInputDriver(void) {}
68+
};
69+
70+
class BBQ10KeyboardInputDriver : public I2CKeyboardInputDriver
71+
{
72+
public:
73+
BBQ10KeyboardInputDriver(uint8_t address);
74+
void init(void) override;
75+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
76+
virtual ~BBQ10KeyboardInputDriver(void) {}
77+
};
78+
79+
class CardKBInputDriver : public I2CKeyboardInputDriver
80+
{
81+
public:
82+
CardKBInputDriver(uint8_t address);
83+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
84+
virtual ~CardKBInputDriver(void) {}
85+
};
86+
87+
class MPR121KeyboardInputDriver : public I2CKeyboardInputDriver
88+
{
89+
public:
90+
MPR121KeyboardInputDriver(uint8_t address);
91+
void init(void) override;
92+
void readKeyboard(uint8_t address, lv_indev_t *indev, lv_indev_data_t *data) override;
93+
virtual ~MPR121KeyboardInputDriver(void) {}
94+
};

include/input/I2CKeyboardScanner.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
class I2CKeyboardInputDriver;
4+
5+
/**
6+
* @brief This class is used to scan I2C connected keyboards and creates
7+
* the corresponding input device (factory).
8+
* It is used by the T-Deck, T-Deck Pro, T-Lora Pager, and other
9+
* I2C connected keyboards.
10+
*/
11+
class I2CKeyboardScanner
12+
{
13+
public:
14+
I2CKeyboardScanner(void);
15+
virtual I2CKeyboardInputDriver *scan(void);
16+
virtual ~I2CKeyboardScanner(void) {}
17+
};

0 commit comments

Comments
 (0)