mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 23:15:05 +00:00
Board update
This commit is contained in:
parent
b9c3e5f773
commit
3b0f2354a0
@ -1,22 +1,27 @@
|
|||||||
#include "CYD2432S024C.h"
|
#include "CYD2432S024C.h"
|
||||||
#include "hal/YellowDisplay.h"
|
#include "devices/Display.h"
|
||||||
#include "hal/YellowDisplayConstants.h"
|
#include "devices/SdCard.h"
|
||||||
#include "hal/YellowSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
#include <Tactility/lvgl/LvglSync.h>
|
||||||
#include <PwmBacklight.h>
|
#include <PwmBacklight.h>
|
||||||
|
|
||||||
#define CYD_SPI_TRANSFER_SIZE_LIMIT (TWODOTFOUR_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
|
#define CYD_SPI_TRANSFER_SIZE_LIMIT (TWODOTFOUR_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
|
||||||
|
|
||||||
bool initBoot() {
|
static bool initBoot() {
|
||||||
return driver::pwmbacklight::init(TWODOTFOUR_LCD_PIN_BACKLIGHT);
|
return driver::pwmbacklight::init(TWODOTFOUR_LCD_PIN_BACKLIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static tt::hal::DeviceVector createDevices() {
|
||||||
|
return {
|
||||||
|
createDisplay(),
|
||||||
|
createSdCard()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const tt::hal::Configuration cyd_2432s024c_config = {
|
const tt::hal::Configuration cyd_2432s024c_config = {
|
||||||
.initBoot = initBoot,
|
.initBoot = initBoot,
|
||||||
.createDisplay = createDisplay,
|
.createDevices = createDevices,
|
||||||
.sdcard = createYellowSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
.i2c = {
|
||||||
tt::hal::i2c::Configuration {
|
tt::hal::i2c::Configuration {
|
||||||
.name = "First",
|
.name = "First",
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#include "YellowDisplay.h"
|
#include "Display.h"
|
||||||
#include "Cst816Touch.h"
|
#include "Cst816Touch.h"
|
||||||
#include "YellowDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <Ili934xDisplay.h>
|
#include <Ili934xDisplay.h>
|
||||||
#include <PwmBacklight.h>
|
#include <PwmBacklight.h>
|
||||||
@ -1,5 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Tactility/hal/display/DisplayDevice.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#define TWODOTFOUR_LCD_PIN_BACKLIGHT GPIO_NUM_27
|
#define TWODOTFOUR_LCD_PIN_BACKLIGHT GPIO_NUM_27
|
||||||
|
|
||||||
// Display
|
// Display
|
||||||
@ -11,3 +14,4 @@
|
|||||||
#define TWODOTFOUR_LCD_PIN_CS GPIO_NUM_15
|
#define TWODOTFOUR_LCD_PIN_CS GPIO_NUM_15
|
||||||
#define TWODOTFOUR_LCD_PIN_DC GPIO_NUM_2
|
#define TWODOTFOUR_LCD_PIN_DC GPIO_NUM_2
|
||||||
|
|
||||||
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "YellowSdCard.h"
|
#include "SdCard.h"
|
||||||
|
|
||||||
#define TAG "twodotfour_sdcard"
|
#define TAG "twodotfour_sdcard"
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
|
|||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
using tt::hal::sdcard::SpiSdCardDevice;
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createYellowSdCard() {
|
std::shared_ptr<SdCardDevice> createSdCard() {
|
||||||
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
|
auto configuration = std::make_unique<SpiSdCardDevice::Config>(
|
||||||
SDCARD_PIN_CS,
|
SDCARD_PIN_CS,
|
||||||
GPIO_NUM_NC,
|
GPIO_NUM_NC,
|
||||||
@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
using tt::hal::sdcard::SdCardDevice;
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createYellowSdCard();
|
std::shared_ptr<SdCardDevice> createSdCard();
|
||||||
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// Touch
|
|
||||||
#define TWODOTFOUR_TOUCH_I2C_PORT I2C_NUM_0
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user