Driver improvements (#226)
- Created driver subprojects: `FT5x06`, `FT6x36`, `CST816S`. - Refactored existing projects to use new drivers. - Improve `PwmBacklight` driver: expose frequency, channel id and timer id - Update `build-and-release-all.sh` for recent board addition
This commit is contained in:
committed by
GitHub
parent
6e8fbae62b
commit
933bc5fb97
@@ -7,7 +7,7 @@
|
||||
#include <Xpt2046Power.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (CROWPANEL_LCD_BITS_PER_PIXEL / 8))
|
||||
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
#include "CrowPanelDisplay.h"
|
||||
#include "CrowPanelDisplayConstants.h"
|
||||
#include "CrowPanelTouch.h"
|
||||
#include "Ili934xDisplay.h"
|
||||
|
||||
#include <Ili934xDisplay.h>
|
||||
#include <Xpt2046Touch.h>
|
||||
|
||||
#include <PwmBacklight.h>
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
std::shared_ptr<Xpt2046Touch> createTouch() {
|
||||
auto configuration = std::make_unique<Xpt2046Touch::Configuration>(
|
||||
CROWPANEL_LCD_SPI_HOST,
|
||||
CROWPANEL_TOUCH_PIN_CS,
|
||||
240,
|
||||
320,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
#define TAG "crowpanel_display"
|
||||
return std::make_shared<Xpt2046Touch>(std::move(configuration));
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
auto touch = createTouch();
|
||||
|
||||
@@ -6,13 +6,4 @@
|
||||
#define CROWPANEL_LCD_PIN_DC GPIO_NUM_2 // RS
|
||||
#define CROWPANEL_LCD_HORIZONTAL_RESOLUTION 320
|
||||
#define CROWPANEL_LCD_VERTICAL_RESOLUTION 240
|
||||
#define CROWPANEL_LCD_BITS_PER_PIXEL 16
|
||||
#define CROWPANEL_LCD_SPI_TRANSFER_HEIGHT (CROWPANEL_LCD_VERTICAL_RESOLUTION / 10)
|
||||
|
||||
// Backlight (PWM)
|
||||
#define CROWPANEL_LCD_BACKLIGHT_LEDC_TIMER LEDC_TIMER_0
|
||||
#define CROWPANEL_LCD_BACKLIGHT_LEDC_MODE LEDC_LOW_SPEED_MODE
|
||||
#define CROWPANEL_LCD_BACKLIGHT_LEDC_CHANNEL LEDC_CHANNEL_0
|
||||
#define CROWPANEL_LCD_BACKLIGHT_LEDC_DUTY_RES LEDC_TIMER_8_BIT
|
||||
#define CROWPANEL_LCD_BACKLIGHT_LEDC_FREQUENCY (4000)
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#include "CrowPanelTouch.h"
|
||||
#include "CrowPanelDisplayConstants.h"
|
||||
|
||||
std::shared_ptr<Xpt2046Touch> createTouch() {
|
||||
auto configuration = std::make_unique<Xpt2046Touch::Configuration>(
|
||||
CROWPANEL_LCD_SPI_HOST,
|
||||
GPIO_NUM_33,
|
||||
240,
|
||||
320,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
return std::make_shared<Xpt2046Touch>(std::move(configuration));
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <Xpt2046Touch.h>
|
||||
|
||||
std::shared_ptr<Xpt2046Touch> createTouch();
|
||||
Reference in New Issue
Block a user