framebufferio
– 原生帧缓冲显示驱动¶
该framebufferio
模块包含管理显示输出的类,包括与刷新率和部分更新同步。它与 from 类结合使用displayio
以将项目实际放置在显示器上;和类喜欢RGBMatrix
实际驱动显示器。
在这些板上可用
- ARAMCON Badge 2019
- ARAMCON2 Badge
- ATMegaZero ESP32-S2
- Adafruit CLUE nRF52840 Express
- Adafruit Circuit Playground Bluefruit
- Adafruit EdgeBadge
- Adafruit Feather Bluefruit Sense
- Adafruit Feather M4 CAN
- Adafruit Feather M4 Express
- Adafruit Feather MIMXRT1011
- Adafruit Feather RP2040
- Adafruit Feather STM32F405 Express
- Adafruit Feather nRF52840 Express
- Adafruit FunHouse
- Adafruit Grand Central M4 Express
- Adafruit Hallowing M4 Express
- Adafruit ItsyBitsy M4 Express
- Adafruit ItsyBitsy RP2040
- Adafruit ItsyBitsy nRF52840 Express
- Adafruit LED Glasses Driver nRF52840
- Adafruit Macropad RP2040
- Adafruit MagTag
- Adafruit Matrix Portal M4
- Adafruit Metro ESP32S2
- Adafruit Metro M4 Airlift Lite
- Adafruit Metro M4 Express
- Adafruit Metro nRF52840 Express
- Adafruit Monster M4SK
- Adafruit PyGamer
- Adafruit PyPortal
- Adafruit PyPortal Pynt
- Adafruit PyPortal Titano
- Adafruit Pybadge
- Adafruit QT Py RP2040
- Adafruit QT2040 Trinkey
- Adafruit Trellis M4 Express
- AloriumTech Evo M51
- Arduino Nano 33 BLE
- Arduino Nano RP2040 Connect
- Artisense Reference Design RD00
- AtelierDuMaker nRF52840 Breakout
- BDMICRO VINA-D51
- BLE-SS dev board Multi Sensor
- BastBLE
- BastWiFi
- BlueMicro840
- CP32-M4
- Capable Robot Programmable USB Hub
- Challenger RP2040 WiFi
- CircuitBrains Deluxe
- CrumpS2
- Cytron Maker Pi RP2040
- DynOSSAT-EDU-OBC
- ESP 12k NodeMCU
- Electronut Labs Blip
- Electronut Labs Papyr
- EncoderPad RP2040
- Espruino Wifi
- Feather ESP32S2 without PSRAM
- Feather MIMXRT1011
- Feather MIMXRT1062
- FeatherS2
- FeatherS2 Neo
- FeatherS2 PreRelease
- Franzininho WIFI w/Wroom
- Franzininho WIFI w/Wrover
- Gravitech Cucumber M
- Gravitech Cucumber MS
- Gravitech Cucumber R
- Gravitech Cucumber RS
- HMI-DevKit-1.1
- HiiBot BlueFi
- IMXRT1010-EVK
- IkigaiSense Vita nRF52840
- Kaluga 1
- LILYGO TTGO T8 ESP32-S2 w/Display
- MDBT50Q-DB-40
- MDBT50Q-RX Dongle
- MEOWBIT
- MORPHEANS MorphESP-240
- MakerDiary nRF52840 MDK
- MakerDiary nRF52840 MDK USB Dongle
- Makerdiary M60 Keyboard
- Makerdiary Pitaya Go
- Makerdiary nRF52840 M.2 Developer Kit
- Melopero Shake RP2040
- Metro MIMXRT1011
- Mini SAM M4
- NUCLEO STM32F746
- NUCLEO STM32F767
- NUCLEO STM32H743
- OPENMV-H7 R1
- Oak Dev Tech BREAD2040
- Oak Dev Tech PixelWing ESP32S2
- Open Hardware Summit 2020 Badge
- PCA10056 nRF52840-DK
- PCA10059 nRF52840 Dongle
- PYB LR Nano V2
- Particle Argon
- Particle Boron
- Particle Xenon
- Pimoroni Interstate 75
- Pimoroni Keybow 2040
- Pimoroni PGA2040
- Pimoroni Pico LiPo (16MB)
- Pimoroni Pico LiPo (4MB)
- Pimoroni PicoSystem
- Pimoroni Plasma 2040
- Pimoroni Tiny 2040
- PyKey60
- PyboardV1_1
- Raspberry Pi Pico
- S2Mini
- SAM E54 Xplained Pro
- SAM32v26
- ST STM32F746G Discovery
- STM32F411E_DISCO
- STM32F412G_DISCO
- STM32F4_DISCO
- Saola 1 w/Wroom
- Saola 1 w/Wrover
- Seeeduino Wio Terminal
- Silicognition LLC M4-Shim
- SparkFun MicroMod RP2040 Processor
- SparkFun MicroMod SAMD51 Processor
- SparkFun MicroMod nRF52840 Processor
- SparkFun Pro Micro RP2040
- SparkFun Pro nRF52840 Mini
- SparkFun STM32 MicroMod Processor
- SparkFun Thing Plus - RP2040
- SparkFun Thing Plus - SAMD51
- TG-Boards' Datalore IP M4
- TG-Watch
- THUNDERPACK_v11
- THUNDERPACK_v12
- Targett Module Clip w/Wroom
- Targett Module Clip w/Wrover
- Teensy 4.0
- Teensy 4.1
- Teknikio Bluebird
- The Open Book Feather
- TinkeringTech ScoutMakes Azul
- TinyS2
- UARTLogger II
- WarmBit BluePixel nRF52840
- iMX RT 1020 EVK
- iMX RT 1060 EVK
- microS2
- nanoESP32-S2 w/Wrover
- nanoESP32-S2 w/Wroom
- nice!nano
- stm32f411ce-blackpill
- stm32f411ce-blackpill-with-flash
-
class
framebufferio.
FramebufferDisplay
(framebuffer: _typing.FrameBuffer, *, rotation: int = 0, auto_refresh: bool = True)¶ 使用 RAM 中的帧缓冲区管理更新显示
这将初始化一个显示并将其连接到 CircuitPython。与 CircuitPython 中的其他对象不同,Display 对象在
displayio.release_displays()
被调用之前一直存在。这样做是为了让 CircuitPython 可以使用显示本身。使用给定的帧缓冲区(缓冲区、数组、ulab.array 等)创建一个 Display 对象
- 参数
framebuffer (FrameBuffer) – 显示器连接到的帧缓冲区
auto_refresh (bool) – 自动刷新屏幕
rotation (int) –显示顺时针旋转度数。必须以 90 度为增量(0、90、180、270)
-
auto_refresh
:bool¶ 当显示自动刷新时为真。
-
brightness
:float¶ 显示的亮度为浮点数。0.0 表示关闭,1.0 表示全亮度。当
auto_brightness
为 True 时, 的值brightness
会自动改变。如果brightness
设置,auto_brightness
将被禁用并设置为 False。
-
auto_brightness
:bool¶ 当显示亮度根据环境光传感器或其他方法自动调整时为真。请注意,某些显示器可能默认将此设置为 True,但实际上并未实现自动亮度调整。
auto_brightness
如果brightness
手动设置,则设置为 False 。
-
width
:int¶ 获取帧缓冲区的宽度
-
height
:int¶ 获取帧缓冲区的高度
-
rotation
:int¶ 以度为单位的整数形式的显示旋转。
-
framebuffer
:_typing.FrameBuffer¶ 显示器正在使用的帧缓冲区
-
show
(self, group: displayio.Group) → None¶ 切换到显示给定的图层组。当 group 为 None 时,将显示默认的 CircuitPython 终端。
- 参数
group (Group) – 要显示的组。
-
refresh
(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) → bool¶ 当自动刷新关闭时,等待目标帧率,然后刷新显示,返回 True。如果自上次针对给定目标帧速率的刷新调用以来调用时间过长,则刷新会立即返回 False 而不更新屏幕,希望有助于赶上进度。
如果自上次成功刷新以来的时间低于最小帧速率,则会引发异常。将 minimum_frames_per_second 设置为 0 以禁用。
当自动刷新打开时,立即更新显示。(显示也将更新而不调用此。)
-
fill_row
(self, y: int, buffer: _typing.WriteableBuffer) → _typing.WriteableBuffer¶ 从单行中提取像素
- 参数
y (int) – 区域的上边缘
buffer (WriteableBuffer) – 放置像素数据的缓冲区