Skip to content

Commit 8d3f1ab

Browse files
authored
Merge pull request #3 from adafruit/TheKitty-patch-1
Update peripherals.py to include a new get_display_config function
2 parents df52bdf + d774cd9 commit 8d3f1ab

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

adafruit_fruitjam/peripherals.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ def request_display_config(width, height):
8080
supervisor.runtime.display = framebufferio.FramebufferDisplay(fb)
8181

8282

83+
def get_display_config():
84+
"""
85+
Get the current display size configuration.
86+
87+
:return: width: The width of the display in pixels.
88+
:return: height: The height of the display in pixels.
89+
:return: pixel_depth of the display in pixels
90+
"""
91+
92+
try:
93+
display = supervisor.runtime.display
94+
display_config = (display.width, display.height, display.framebuffer.color_depth)
95+
return display_config
96+
except ValueError:
97+
return (None, None, None)
98+
99+
83100
class Peripherals:
84101
"""Peripherals Helper Class for the FruitJam Library
85102

0 commit comments

Comments
 (0)