Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions adafruit_fruitjam/peripherals.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ def request_display_config(width, height):
supervisor.runtime.display = framebufferio.FramebufferDisplay(fb)


def get_display_config():
"""
Get the current display size configuration.

:return: width: The width of the display in pixels.
:return: height: The height of the display in pixels.
:return: pixel_depth of the display in pixels
"""

try:
display = supervisor.runtime.display
display_config = (display.width, display.height, display.framebuffer.color_depth)
return display_config
except ValueError:
return (None, None, None)


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

Expand Down