mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00

<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> Display support for the following screens: - [Pimoroni GFX Hat](https://shop.pimoroni.com/products/gfx-hat?variant=12828343631955): ui.display.type = "gfxhat" Contrast and Backlight color can be imported from config.toml: ui.display.contrast = 40 ui.display.blcolor = "olive" Available backlight colors: white, grey, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua - [Adafruit miniPiTFT](https://www.adafruit.com/product/4484): ui.display.type = "minipitft" - [Adafruit miniPiTFT2](https://www.adafruit.com/product/4393): ui.display.type = "minipitft2" - [ArgonPod](https://argon40.com/products/pod-display-2-8inch): ui.display.type = "argonpod" - [DisplayHatMini](https://shop.pimoroni.com/products/display-hat-mini?variant=39496084717651): Driver updated to fix issues - I2C Oled: Default I2C address changed to 0x3C, because most boards are coming with it by default. Can be modified in config ui.display.type = "i2coled" ui.display.i2c_addr = 0x3C ui.display.width = 128 ui.display.height = 64 ## Motivation and Context Future plan for LCD and OLED screens: Change from the pwnagotchis hw libraries for drivers to LumaOLED LumaLCD packages. Luma Core: https://github.com/rm-hull/luma.core Luma LCD: https://github.com/rm-hull/luma.lcd Luma OLED: https://github.com/rm-hull/luma.oled It has the most used LCD and OLED drivers ready, and adding new screens could be easier in the future. ## How Has This Been Tested? Except the argonpod and minipitft2 all screens were tested on previous builds, should work in 2.9.2, but before release I would like to test it with an image. ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [x] I have updated the documentation accordingly. - [x] I've read the [CONTRIBUTION](https://github.com/evilsocket/pwnagotchi/blob/master/CONTRIBUTING.md) guide - [x] I have signed-off my commits with `git commit -s`
55 lines
1.5 KiB
Python
55 lines
1.5 KiB
Python
# board GPIO:
|
|
# Key1:
|
|
# Key2:
|
|
# Key3:
|
|
# Key4:
|
|
#
|
|
# Touch chipset:
|
|
# HW info: https://argon40.com/products/pod-display-2-8inch
|
|
# HW datasheet:
|
|
|
|
import logging
|
|
|
|
import pwnagotchi.ui.fonts as fonts
|
|
from pwnagotchi.ui.hw.base import DisplayImpl
|
|
|
|
|
|
class ArgonPod(DisplayImpl):
|
|
def __init__(self, config):
|
|
super(ArgonPod, self).__init__(config, 'argonpod')
|
|
self._display = None
|
|
|
|
def layout(self):
|
|
fonts.setup(12, 10, 12, 70, 25, 9)
|
|
self._layout['width'] = 320
|
|
self._layout['height'] = 240
|
|
self._layout['face'] = (0, 36)
|
|
self._layout['name'] = (150, 36)
|
|
self._layout['channel'] = (0, 0)
|
|
self._layout['aps'] = (40, 0)
|
|
self._layout['uptime'] = (240, 0)
|
|
self._layout['line1'] = [0, 14, 320, 14]
|
|
self._layout['line2'] = [0, 220, 320, 220]
|
|
self._layout['friend_face'] = (0, 130)
|
|
self._layout['friend_name'] = (40, 135)
|
|
self._layout['shakes'] = (0, 220)
|
|
self._layout['mode'] = (280, 220)
|
|
self._layout['status'] = {
|
|
'pos': (150, 48),
|
|
'font': fonts.status_font(fonts.Medium),
|
|
'max': 20
|
|
}
|
|
|
|
return self._layout
|
|
|
|
def initialize(self):
|
|
logging.info("Initializing Argon Pod display")
|
|
from pwnagotchi.ui.hw.libs.argon.argonpod.ILI9341 import ILI9341
|
|
self._display = ILI9341(0, 0, 22, 18)
|
|
|
|
def render(self, canvas):
|
|
self._display.display(canvas)
|
|
|
|
def clear(self):
|
|
self._display.clear()
|