Skip to content

Commit 9a34a9d

Browse files
authored
Update peripherals.py
1 parent df52bdf commit 9a34a9d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

adafruit_fruitjam/peripherals.py

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

82+
def get_display_config():
83+
"""
84+
Get the current display size configuration.
85+
86+
:return: width: The width of the display in pixels.
87+
:return: height: The height of the display in pixels.
88+
:return: pixel_depth of the display in pixels
89+
"""
90+
try:
91+
display = (picodvi.Framebuffer.width, picodvi.Framebuffer.height, picodvi.Framebuffer.color_depth)
92+
return display
93+
except ValueError as e:
94+
return (None, None, None)
8295

8396
class Peripherals:
8497
"""Peripherals Helper Class for the FruitJam Library

0 commit comments

Comments
 (0)