ESP32 Native version of Blinky, featureful controller code for WS2811/WS2812/NeoPixels
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 line
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. };