40 lines
1022 B
C++
40 lines
1022 B
C++
#ifndef TFT_HPP
|
|
#define TFT_HPP
|
|
|
|
#include <lvgl.h>
|
|
#include <freertos/FreeRTOS.h>
|
|
|
|
// Uncomment the following line to enable using double buffering of LVGL color
|
|
// data.
|
|
// #define USE_DOUBLE_BUFFERING 1
|
|
|
|
// rotation swaps the horizontal and vertical pixel counts
|
|
#define DISPLAY_HORIZONTAL_PIXELS 480
|
|
#define DISPLAY_VERTICAL_PIXELS 320
|
|
#define DISPLAY_COMMAND_BITS 8
|
|
#define DISPLAY_PARAMETER_BITS 8
|
|
#define DISPLAY_REFRESH_HZ 40000000
|
|
#define DISPLAY_SPI_QUEUE_LEN 10
|
|
#define SPI_MAX_TRANSFER_SIZE 32768
|
|
|
|
#define TFT_INVERT_COLOR false
|
|
|
|
// Default to 50 lines of color data
|
|
#define LV_BUFFER_SIZE DISPLAY_HORIZONTAL_PIXELS * 50
|
|
#define LVGL_UPDATE_PERIOD_MS 5
|
|
|
|
#define BACKLIGHT_LEDC_MODE LEDC_LOW_SPEED_MODE
|
|
#define BACKLIGHT_LEDC_CHANNEL LEDC_CHANNEL_0
|
|
#define BACKLIGHT_LEDC_TIMER LEDC_TIMER_1
|
|
#define BACKLIGHT_LEDC_TIMER_RESOLUTION LEDC_TIMER_10_BIT
|
|
#define BACKLIGHT_LEDC_FRQUENCY 5000
|
|
|
|
extern lv_obj_t* screen;
|
|
|
|
void init_tft();
|
|
|
|
bool lvgl_lock(TickType_t ticks_to_wait);
|
|
void lvgl_unlock();
|
|
|
|
#endif // TFT_HPP
|