esp-who/examples/esp32-s3-eye/main/include/app_lcd.hpp

50 lines
1.1 KiB
C++
Raw Normal View History

2022-03-02 19:38:29 +08:00
#pragma once
#include "screen_driver.h"
#include "__base__.hpp"
#include "app_camera.hpp"
2022-03-03 14:35:04 +08:00
#include "app_button.hpp"
2022-03-02 19:38:29 +08:00
#include "app_speech.hpp"
#define BOARD_LCD_MOSI 47
#define BOARD_LCD_MISO -1
#define BOARD_LCD_SCK 21
#define BOARD_LCD_CS 44
#define BOARD_LCD_DC 43
#define BOARD_LCD_RST -1
#define BOARD_LCD_BL 48
#define BOARD_LCD_PIXEL_CLOCK_HZ (40 * 1000 * 1000)
#define BOARD_LCD_BK_LIGHT_ON_LEVEL 0
#define BOARD_LCD_BK_LIGHT_OFF_LEVEL !BOARD_LCD_BK_LIGHT_ON_LEVEL
#define BOARD_LCD_H_RES 240
#define BOARD_LCD_V_RES 240
#define BOARD_LCD_CMD_BITS 8
#define BOARD_LCD_PARAM_BITS 8
#define LCD_HOST SPI2_HOST
class AppLCD : public Observer, public Frame
{
private:
2022-03-03 14:35:04 +08:00
AppButton *key;
2022-03-02 19:38:29 +08:00
AppSpeech *speech;
public:
scr_driver_t driver;
bool switch_on;
bool paper_drawn;
2022-03-03 14:35:04 +08:00
AppLCD(AppButton *key,
2022-03-02 19:38:29 +08:00
AppSpeech *speech,
QueueHandle_t xQueueFrameI = nullptr,
QueueHandle_t xQueueFrameO = nullptr,
void (*callback)(camera_fb_t *) = esp_camera_fb_return);
void draw_wallpaper();
void draw_color(int color);
void update();
void run();
};