ESP32 Native version of Blinky, featureful controller code for WS2811/WS2812/NeoPixels
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

29 řádky
580B

  1. #pragma once
  2. #include <screen_driver.h>
  3. class Display {
  4. public:
  5. Display(size_t w, size_t h);
  6. ~Display();
  7. void refresh();
  8. size_t get_width() const { return width; }
  9. size_t get_height() const { return height; }
  10. size_t get_pitch() const { return pitch; }
  11. size_t get_stride() const { return pitch * sizeof(*buffer); }
  12. uint16_t* get_buffer() const { return buffer; }
  13. private:
  14. size_t width;
  15. size_t height;
  16. size_t pitch;
  17. uint16_t *buffer;
  18. spi_bus_handle_t bus;
  19. scr_interface_driver_t *iface_drv;
  20. scr_driver_t driver;
  21. };