From 26eb580043ad176bdc58d996f30d470e1073ef00 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 2 May 2024 21:52:59 +1000 Subject: move driver includes into a subdir as well --- src/drivers/include/display.hpp | 81 ----------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 src/drivers/include/display.hpp (limited to 'src/drivers/include/display.hpp') diff --git a/src/drivers/include/display.hpp b/src/drivers/include/display.hpp deleted file mode 100644 index d2e18a5c..00000000 --- a/src/drivers/include/display.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2023 jacqueline - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include -#include -#include - -#include "driver/spi_master.h" -#include "lvgl/lvgl.h" -#include "result.hpp" -#include "tasks.hpp" - -#include "display_init.hpp" -#include "gpios.hpp" - -namespace drivers { - -/* - * LVGL display driver for ST77XX family displays. - */ -class Display { - public: - /* - * Creates the display driver, and resets and reinitialises the display - * over SPI. This never fails, since unfortunately these display don't give - * us back any kind of signal to tell us we're actually using them correctly. - */ - static auto Create(IGpios& expander, - const displays::InitialisationData& init_data) -> Display*; - - Display(IGpios& gpio, spi_device_handle_t handle); - ~Display(); - - auto SetDisplayOn(bool) -> void; - auto SetBrightness(uint_fast8_t) -> void; - - /* Driver callback invoked by LVGL when there is new data to display. */ - void OnLvglFlush(lv_disp_drv_t* disp_drv, - const lv_area_t* area, - lv_color_t* color_map); - - // Not copyable or movable. - Display(const Display&) = delete; - Display& operator=(const Display&) = delete; - - private: - IGpios& gpio_; - spi_device_handle_t handle_; - - bool first_flush_finished_; - bool display_on_; - uint_fast8_t brightness_; - - lv_disp_draw_buf_t buffers_; - lv_disp_drv_t driver_; - lv_disp_t* display_ = nullptr; - - enum TransactionType { - COMMAND = 0, - DATA = 1, - }; - - void SendInitialisationSequence(const uint8_t* data); - - void SendCommandWithData(uint8_t command, const uint8_t* data, size_t length); - void SendCmd(const uint8_t* data, size_t length); - void SendData(const uint8_t* data, size_t length); - - void SendTransaction(TransactionType type, - const uint8_t* data, - size_t length); - - auto SetDutyCycle(uint_fast8_t, bool) -> void; -}; - -} // namespace drivers -- cgit v1.2.3