mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-19 11:32:06 +00:00
Add Native Trackball/Joystick support, and move UserButton to Input
This commit is contained in:
parent
c3e5e2397e
commit
fe6e9263eb
@ -96,9 +96,9 @@ Lora:
|
|||||||
### Some devices, like the pinedio, may require spidev0.1 as a workaround.
|
### Some devices, like the pinedio, may require spidev0.1 as a workaround.
|
||||||
# spidev: spidev0.0
|
# spidev: spidev0.0
|
||||||
|
|
||||||
### Define GPIO buttons here:
|
### Deprecated location for User Button:
|
||||||
|
|
||||||
GPIO:
|
#GPIO:
|
||||||
# User: 6
|
# User: 6
|
||||||
|
|
||||||
### Define GPS
|
### Define GPS
|
||||||
@ -115,17 +115,6 @@ I2C:
|
|||||||
|
|
||||||
Display:
|
Display:
|
||||||
|
|
||||||
### Waveshare 1.44inch LCD HAT
|
|
||||||
# Panel: ST7735S
|
|
||||||
# CS: 8 #Chip Select
|
|
||||||
# DC: 25 # Data/Command pin
|
|
||||||
# Backlight: 24
|
|
||||||
# Width: 128
|
|
||||||
# Height: 128
|
|
||||||
# Reset: 27
|
|
||||||
# OffsetX: 0
|
|
||||||
# OffsetY: 0
|
|
||||||
|
|
||||||
### Adafruit PiTFT 2.8 TFT+Touchscreen
|
### Adafruit PiTFT 2.8 TFT+Touchscreen
|
||||||
# Panel: ILI9341
|
# Panel: ILI9341
|
||||||
# CS: 8
|
# CS: 8
|
||||||
@ -180,6 +169,16 @@ Input:
|
|||||||
|
|
||||||
# KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd
|
# KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd
|
||||||
|
|
||||||
|
### Standard User Button Config
|
||||||
|
# UserButton: 6
|
||||||
|
|
||||||
|
### Trackball/Joystick input
|
||||||
|
# TrackballUp: 6
|
||||||
|
# TrackballDown: 19
|
||||||
|
# TrackballLeft: 5
|
||||||
|
# TrackballRight: 26
|
||||||
|
# TrackballPress: 13
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
Logging:
|
Logging:
|
||||||
|
26
bin/config.d/display-waveshare-1-44.yaml
Normal file
26
bin/config.d/display-waveshare-1-44.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
### Waveshare 1.44inch LCD HAT
|
||||||
|
Display:
|
||||||
|
Panel: ST7735S
|
||||||
|
spidev: spidev0.0 # Specify either the spidev here, or the CS below
|
||||||
|
# CS: 8 #Chip Select # Optional, as this is the default pin for spidev0.0
|
||||||
|
DC: 25 # Data/Command pin
|
||||||
|
Backlight: 24
|
||||||
|
Width: 128
|
||||||
|
Height: 128
|
||||||
|
Reset: 27
|
||||||
|
OffsetX: 2
|
||||||
|
OffsetY: 1
|
||||||
|
|
||||||
|
|
||||||
|
# OffsetY: 31 # These two options are used to properly flip the screen 180 degrees
|
||||||
|
# OffsetRotate: 3
|
||||||
|
|
||||||
|
|
||||||
|
Input:
|
||||||
|
TrackballUp: 6
|
||||||
|
TrackballDown: 19
|
||||||
|
TrackballLeft: 5
|
||||||
|
TrackballRight: 26
|
||||||
|
TrackballPress: 13
|
||||||
|
|
||||||
|
# User: 21
|
@ -1184,7 +1184,7 @@ bool TFTDisplay::connect()
|
|||||||
#elif defined(T_WATCH_S3) || defined(SENSECAP_INDICATOR)
|
#elif defined(T_WATCH_S3) || defined(SENSECAP_INDICATOR)
|
||||||
tft->setRotation(2); // T-Watch S3 left-handed orientation
|
tft->setRotation(2); // T-Watch S3 left-handed orientation
|
||||||
#elif ARCH_PORTDUINO
|
#elif ARCH_PORTDUINO
|
||||||
tft->setRotation(0);
|
tft->setRotation(0); // use config.yaml to set rotation
|
||||||
#else
|
#else
|
||||||
tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label
|
tft->setRotation(3); // Orient horizontal and wide underneath the silkscreen name label
|
||||||
#endif
|
#endif
|
||||||
|
@ -526,11 +526,6 @@ bool loadConfig(const char *configPath)
|
|||||||
}
|
}
|
||||||
if (yamlConfig["GPIO"]) {
|
if (yamlConfig["GPIO"]) {
|
||||||
settingsMap[userButtonPin] = yamlConfig["GPIO"]["User"].as<int>(RADIOLIB_NC);
|
settingsMap[userButtonPin] = yamlConfig["GPIO"]["User"].as<int>(RADIOLIB_NC);
|
||||||
settingsMap[tbUpPin] = yamlConfig["GPIO"]["TrackballUp"].as<int>(RADIOLIB_NC);
|
|
||||||
settingsMap[tbDownPin] = yamlConfig["GPIO"]["TrackballDown"].as<int>(RADIOLIB_NC);
|
|
||||||
settingsMap[tbLeftPin] = yamlConfig["GPIO"]["TrackballLeft"].as<int>(RADIOLIB_NC);
|
|
||||||
settingsMap[tbRightPin] = yamlConfig["GPIO"]["TrackballRight"].as<int>(RADIOLIB_NC);
|
|
||||||
settingsMap[tbPressPin] = yamlConfig["GPIO"]["TrackballPress"].as<int>(RADIOLIB_NC);
|
|
||||||
}
|
}
|
||||||
if (yamlConfig["GPS"]) {
|
if (yamlConfig["GPS"]) {
|
||||||
std::string serialPath = yamlConfig["GPS"]["SerialPath"].as<std::string>("");
|
std::string serialPath = yamlConfig["GPS"]["SerialPath"].as<std::string>("");
|
||||||
@ -620,7 +615,12 @@ bool loadConfig(const char *configPath)
|
|||||||
if (yamlConfig["Input"]) {
|
if (yamlConfig["Input"]) {
|
||||||
settingsStrings[keyboardDevice] = (yamlConfig["Input"]["KeyboardDevice"]).as<std::string>("");
|
settingsStrings[keyboardDevice] = (yamlConfig["Input"]["KeyboardDevice"]).as<std::string>("");
|
||||||
settingsStrings[pointerDevice] = (yamlConfig["Input"]["PointerDevice"]).as<std::string>("");
|
settingsStrings[pointerDevice] = (yamlConfig["Input"]["PointerDevice"]).as<std::string>("");
|
||||||
}
|
settingsMap[userButtonPin] = yamlConfig["Input"]["User"].as<int>(RADIOLIB_NC);
|
||||||
|
settingsMap[tbUpPin] = yamlConfig["Input"]["TrackballUp"].as<int>(RADIOLIB_NC);
|
||||||
|
settingsMap[tbDownPin] = yamlConfig["Input"]["TrackballDown"].as<int>(RADIOLIB_NC);
|
||||||
|
settingsMap[tbLeftPin] = yamlConfig["Input"]["TrackballLeft"].as<int>(RADIOLIB_NC);
|
||||||
|
settingsMap[tbRightPin] = yamlConfig["Input"]["TrackballRight"].as<int>(RADIOLIB_NC);
|
||||||
|
settingsMap[tbPressPin] = yamlConfig["Input"]["TrackballPress"].as<int>(RADIOLIB_NC); }
|
||||||
|
|
||||||
if (yamlConfig["Webserver"]) {
|
if (yamlConfig["Webserver"]) {
|
||||||
settingsMap[webserverport] = (yamlConfig["Webserver"]["Port"]).as<int>(-1);
|
settingsMap[webserverport] = (yamlConfig["Webserver"]["Port"]).as<int>(-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user