Update CYD-E32R28T and fixed some minor issues (#319)
This commit is contained in:
committed by
GitHub
parent
c0ed8f0a44
commit
65335578a4
@@ -0,0 +1,41 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <Xpt2046SoftSpi.h>
|
||||
#include <Ili934xDisplay.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
|
||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
auto config = std::make_unique<Xpt2046SoftSpi::Configuration>(
|
||||
CYD_TOUCH_MOSI_PIN,
|
||||
CYD_TOUCH_MISO_PIN,
|
||||
CYD_TOUCH_SCK_PIN,
|
||||
CYD_TOUCH_CS_PIN,
|
||||
CYD_DISPLAY_HORIZONTAL_RESOLUTION,
|
||||
CYD_DISPLAY_VERTICAL_RESOLUTION,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
return std::make_shared<Xpt2046SoftSpi>(std::move(config));
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
|
||||
CYD_DISPLAY_SPI_HOST,
|
||||
CYD_DISPLAY_PIN_CS,
|
||||
CYD_DISPLAY_PIN_DC,
|
||||
CYD_DISPLAY_HORIZONTAL_RESOLUTION,
|
||||
CYD_DISPLAY_VERTICAL_RESOLUTION,
|
||||
createTouch(),
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
LCD_RGB_ELEMENT_ORDER_BGR
|
||||
);
|
||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
||||
return std::make_shared<Ili934xDisplay>(std::move(configuration));
|
||||
}
|
||||
Reference in New Issue
Block a user