mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-20 07:25:06 +00:00
New style
This commit is contained in:
parent
eeddc029ca
commit
3b9004ffbc
@ -1,16 +1,15 @@
|
|||||||
#include "Tactility/lvgl/LvglSync.h"
|
#include "Tactility/lvgl/LvglSync.h"
|
||||||
#include "devices/TpagerDisplay.h"
|
#include "devices/Display.h"
|
||||||
|
#include "devices/SdCard.h"
|
||||||
#include "devices/TpagerEncoder.h"
|
#include "devices/TpagerEncoder.h"
|
||||||
#include "devices/TpagerDisplayConstants.h"
|
|
||||||
#include "devices/TpagerKeyboard.h"
|
#include "devices/TpagerKeyboard.h"
|
||||||
#include "devices/TpagerPower.h"
|
#include "devices/TpagerPower.h"
|
||||||
#include "devices/TpagerSdCard.h"
|
|
||||||
|
|
||||||
#include <Bq25896.h>
|
#include <Bq25896.h>
|
||||||
#include <Drv2605.h>
|
#include <Drv2605.h>
|
||||||
#include <Tactility/hal/Configuration.h>
|
#include <Tactility/hal/Configuration.h>
|
||||||
|
|
||||||
#define TPAGER_SPI_TRANSFER_SIZE_LIMIT (TPAGER_LCD_HORIZONTAL_RESOLUTION * TPAGER_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
|
#define TPAGER_SPI_TRANSFER_SIZE_LIMIT (480 * 222 * (LV_COLOR_DEPTH / 8))
|
||||||
|
|
||||||
bool tpagerInit();
|
bool tpagerInit();
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
#include "TpagerDisplay.h"
|
#include "Display.h"
|
||||||
#include "TpagerDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
#include <PwmBacklight.h>
|
||||||
#include <St7796Display.h>
|
#include <St7796Display.h>
|
||||||
|
|
||||||
#include <driver/spi_master.h>
|
#define TPAGER_LCD_SPI_HOST SPI2_HOST
|
||||||
|
#define TPAGER_LCD_PIN_CS GPIO_NUM_38
|
||||||
|
#define TPAGER_LCD_PIN_DC GPIO_NUM_37 // RS
|
||||||
|
#define TPAGER_LCD_HORIZONTAL_RESOLUTION 222
|
||||||
|
#define TPAGER_LCD_VERTICAL_RESOLUTION 480
|
||||||
|
#define TPAGER_LCD_SPI_TRANSFER_HEIGHT (TPAGER_LCD_VERTICAL_RESOLUTION / 10)
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||||
auto configuration = std::make_unique<St7796Display::Configuration>(
|
auto configuration = std::make_unique<St7796Display::Configuration>(
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "TpagerSdCard.h"
|
#include "SdCard.h"
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
#include <Tactility/lvgl/LvglSync.h>
|
||||||
@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define TPAGER_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define TPAGER_LCD_PIN_CS GPIO_NUM_38
|
|
||||||
#define TPAGER_LCD_PIN_DC GPIO_NUM_37 // RS
|
|
||||||
#define TPAGER_LCD_HORIZONTAL_RESOLUTION 222
|
|
||||||
#define TPAGER_LCD_VERTICAL_RESOLUTION 480
|
|
||||||
#define TPAGER_LCD_SPI_TRANSFER_HEIGHT (TPAGER_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
@ -111,7 +111,7 @@ void TpagerEncoder::initEncoder() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TpagerEncoder::getEncoderPulses() {
|
int TpagerEncoder::getEncoderPulses() const {
|
||||||
int pulses = 0;
|
int pulses = 0;
|
||||||
pcnt_unit_get_count(encPcntUnit, &pulses);
|
pcnt_unit_get_count(encPcntUnit, &pulses);
|
||||||
return pulses;
|
return pulses;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class TpagerEncoder final : public tt::hal::encoder::EncoderDevice {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
TpagerEncoder() {}
|
TpagerEncoder() {}
|
||||||
~TpagerEncoder() {}
|
~TpagerEncoder() override {}
|
||||||
|
|
||||||
std::string getName() const override { return "T-Lora Pager Encoder"; }
|
std::string getName() const override { return "T-Lora Pager Encoder"; }
|
||||||
std::string getDescription() const override { return "The encoder wheel next to the display"; }
|
std::string getDescription() const override { return "The encoder wheel next to the display"; }
|
||||||
@ -23,7 +23,7 @@ public:
|
|||||||
bool startLvgl(lv_display_t* display) override;
|
bool startLvgl(lv_display_t* display) override;
|
||||||
bool stopLvgl() override;
|
bool stopLvgl() override;
|
||||||
|
|
||||||
int getEncoderPulses();
|
int getEncoderPulses() const;
|
||||||
|
|
||||||
lv_indev_t* _Nullable getLvglIndev() override { return encHandle; }
|
lv_indev_t* _Nullable getLvglIndev() override { return encHandle; }
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user