Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
add_subdirectory(Libraries/QRCode)
add_subdirectory(Libraries/minitar)
add_subdirectory(Libraries/minmea)
add_subdirectory(Modules/hal-device)
add_subdirectory(Modules/hal-device-module)
add_subdirectory(Modules/lvgl-module)

# FreeRTOS
set(FREERTOS_CONFIG_FILE_DIRECTORY ${PROJECT_SOURCE_DIR}/Devices/simulator/Source CACHE STRING "")
Expand Down
2 changes: 1 addition & 1 deletion Devices/btt-panda-touch/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <PwmBacklight.h>
#include <RgbDisplay.h>

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 41 and interrupt pin is 40
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
Expand Down
2 changes: 1 addition & 1 deletion Devices/cyd-4848s040c/Source/devices/St7701Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ lvgl_port_display_rgb_cfg_t St7701Display::getLvglPortDisplayRgbConfig(esp_lcd_p
};
}

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable St7701Display::getTouchDevice() {
std::shared_ptr<tt::hal::touch::TouchDevice> St7701Display::getTouchDevice() {
if (touchDevice == nullptr) {
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
Expand Down
4 changes: 2 additions & 2 deletions Devices/cyd-4848s040c/Source/devices/St7701Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class St7701Display final : public EspLcdDisplay {

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable touchDevice;
std::shared_ptr<tt::hal::touch::TouchDevice> touchDevice;

bool createIoHandle(esp_lcd_panel_io_handle_t& outHandle) override;

Expand All @@ -27,7 +27,7 @@ class St7701Display final : public EspLcdDisplay {

std::string getDescription() const override { return "ST7701S RGB display"; }

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable getTouchDevice() override;
std::shared_ptr<tt::hal::touch::TouchDevice> getTouchDevice() override;

void setBacklightDuty(uint8_t backlightDuty) override;

Expand Down
2 changes: 1 addition & 1 deletion Devices/cyd-8048s043c/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <PwmBacklight.h>
#include <RgbDisplay.h>

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 38 and interrupt pin is 18
// or INT = NC, schematic and other info floating around is kinda conflicting...
auto configuration = std::make_unique<Gt911Touch::Configuration>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <Gt911Touch.h>
#include <RgbDisplay.h>

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 38 and interrupt pin is 18
// or INT = NC, schematic and other info floating around is kinda conflicting...
auto configuration = std::make_unique<Gt911Touch::Configuration>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <PwmBacklight.h>
#include <RgbDisplay.h>

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 38 and interrupt pin is 18
// or INT = NC, schematic and other info floating around is kinda conflicting...
auto configuration = std::make_unique<Gt911Touch::Configuration>(
Expand Down
24 changes: 12 additions & 12 deletions Devices/guition-jc3248w535c/Source/Axs15231b/Axs15231bDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ class Axs15231bDisplay final : public tt::hal::display::DisplayDevice {
uint32_t bufferSize; // Size in pixel count. 0 means default, which is 1/10 of the screen size
lcd_rgb_element_order_t rgbElementOrder;
std::shared_ptr<tt::hal::touch::TouchDevice> touch;
std::function<void(uint8_t)> _Nullable backlightDutyFunction = nullptr;
std::function<void(uint8_t)> backlightDutyFunction = nullptr;
};

private:

esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
esp_lcd_panel_handle_t _Nullable panelHandle = nullptr;
lv_display_t* _Nullable lvglDisplay = nullptr;
uint16_t* _Nullable buffer1 = nullptr;
uint16_t* _Nullable buffer2 = nullptr;
uint16_t* _Nullable tempBuf = nullptr;
SemaphoreHandle_t _Nullable teSyncSemaphore = nullptr;
esp_lcd_panel_io_handle_t ioHandle = nullptr;
esp_lcd_panel_handle_t panelHandle = nullptr;
lv_display_t* lvglDisplay = nullptr;
uint16_t* buffer1 = nullptr;
uint16_t* buffer2 = nullptr;
uint16_t* tempBuf = nullptr;
SemaphoreHandle_t teSyncSemaphore = nullptr;
bool teIsrInstalled = false;
bool isrServiceInstalledByUs = false;

std::unique_ptr<Configuration> configuration;
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable displayDriver;
std::shared_ptr<tt::hal::display::DisplayDriver> displayDriver;

bool createIoHandle();

Expand Down Expand Up @@ -118,9 +118,9 @@ class Axs15231bDisplay final : public tt::hal::display::DisplayDevice {

bool stopLvgl() override;

lv_display_t* _Nullable getLvglDisplay() const override { return lvglDisplay; }
lv_display_t* getLvglDisplay() const override { return lvglDisplay; }

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable getTouchDevice() override { return configuration->touch; }
std::shared_ptr<tt::hal::touch::TouchDevice> getTouchDevice() override { return configuration->touch; }

void setBacklightDuty(uint8_t backlightDuty) override {
if (configuration->backlightDutyFunction != nullptr) {
Expand All @@ -132,7 +132,7 @@ class Axs15231bDisplay final : public tt::hal::display::DisplayDevice {

bool supportsDisplayDriver() const override { return true; }

std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable getDisplayDriver() override;
std::shared_ptr<tt::hal::display::DisplayDriver> getDisplayDriver() override;

static void lvgl_port_flush_callback(lv_display_t *drv, const lv_area_t *area, uint8_t *color_map);

Expand Down
2 changes: 1 addition & 1 deletion Devices/guition-jc8048w550c/Source/devices/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <PwmBacklight.h>
#include <RgbDisplay.h>

std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 38 and interrupt pin is 18
// or INT = NC, schematic and other info floating around is kinda conflicting...
auto configuration = std::make_unique<Gt911Touch::Configuration>(
Expand Down
4 changes: 2 additions & 2 deletions Devices/lilygo-tdeck/Source/devices/TdeckKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class TdeckKeyboard final : public tt::hal::keyboard::KeyboardDevice {

lv_indev_t* _Nullable deviceHandle = nullptr;
lv_indev_t* deviceHandle = nullptr;

public:

Expand All @@ -15,5 +15,5 @@ class TdeckKeyboard final : public tt::hal::keyboard::KeyboardDevice {
bool startLvgl(lv_display_t* display) override;
bool stopLvgl() override;
bool isAttached() const override;
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
lv_indev_t* getLvglIndev() override { return deviceHandle; }
};
4 changes: 2 additions & 2 deletions Devices/lilygo-tlora-pager/Source/devices/TpagerEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class TpagerEncoder final : public tt::hal::encoder::EncoderDevice {

lv_indev_t* _Nullable encHandle = nullptr;
lv_indev_t* encHandle = nullptr;
pcnt_unit_handle_t encPcntUnit = nullptr;

bool initEncoder();
Expand All @@ -26,5 +26,5 @@ class TpagerEncoder final : public tt::hal::encoder::EncoderDevice {

int getEncoderPulses() const;

lv_indev_t* _Nullable getLvglIndev() override { return encHandle; }
lv_indev_t* getLvglIndev() override { return encHandle; }
};
4 changes: 2 additions & 2 deletions Devices/lilygo-tlora-pager/Source/devices/TpagerKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class TpagerKeyboard final : public tt::hal::keyboard::KeyboardDevice {

lv_indev_t* _Nullable kbHandle = nullptr;
lv_indev_t* kbHandle = nullptr;
gpio_num_t backlightPin = GPIO_NUM_NC;
ledc_timer_t backlightTimer;
ledc_channel_t backlightChannel;
Expand Down Expand Up @@ -45,7 +45,7 @@ class TpagerKeyboard final : public tt::hal::keyboard::KeyboardDevice {
bool stopLvgl() override;

bool isAttached() const override;
lv_indev_t* _Nullable getLvglIndev() override { return kbHandle; }
lv_indev_t* getLvglIndev() override { return kbHandle; }

bool setBacklightDuty(uint8_t duty);
void makeBacklightImpulse();
Expand Down
6 changes: 3 additions & 3 deletions Devices/lilygo-tlora-pager/Source/drivers/TloraPager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ static int stop(Device* device) {
Driver tlora_pager_driver = {
.name = "T-Lora Pager",
.compatible = (const char*[]) { "lilygo,tlora-pager", nullptr },
.startDevice = start,
.stopDevice = stop,
.start_device = start,
.stop_device = stop,
.api = nullptr,
.deviceType = nullptr,
.device_type = nullptr,
.owner = &device_module,
.driver_private = nullptr
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CardputerKeyboard final : public tt::hal::keyboard::KeyboardDevice {

lv_indev_t* _Nullable kbHandle = nullptr;
lv_indev_t* kbHandle = nullptr;
QueueHandle_t queue = nullptr;

std::shared_ptr<Tca8418> keypad;
Expand Down Expand Up @@ -42,5 +42,5 @@ class CardputerKeyboard final : public tt::hal::keyboard::KeyboardDevice {
bool stopLvgl() override;

bool isAttached() const override;
lv_indev_t* _Nullable getLvglIndev() override { return kbHandle; }
lv_indev_t* getLvglIndev() override { return kbHandle; }
};
4 changes: 2 additions & 2 deletions Devices/m5stack-cardputer/Source/devices/CardputerEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class CardputerEncoder final : public tt::hal::encoder::EncoderDevice {
KEYBOARD::Keyboard keyboard;
int lastKeyNum = 0;
lv_indev_t* _Nullable lvglDevice = nullptr;
lv_indev_t* lvglDevice = nullptr;

static void readCallback(lv_indev_t* indev, lv_indev_data_t* data);

Expand All @@ -25,5 +25,5 @@ class CardputerEncoder final : public tt::hal::encoder::EncoderDevice {
bool startLvgl(lv_display_t* display) override;
bool stopLvgl() override;

lv_indev_t* _Nullable getLvglIndev() override { return lvglDevice; }
lv_indev_t* getLvglIndev() override { return lvglDevice; }
};
4 changes: 2 additions & 2 deletions Devices/m5stack-cardputer/Source/devices/CardputerKeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class CardputerKeyboard : public tt::hal::keyboard::KeyboardDevice {
KEYBOARD::Keyboard keyboard;
int lastKeyNum = 0;
lv_indev_t* _Nullable lvglDevice = nullptr;
lv_indev_t* lvglDevice = nullptr;

static void readCallback(lv_indev_t* indev, lv_indev_data_t* data);

Expand All @@ -22,5 +22,5 @@ class CardputerKeyboard : public tt::hal::keyboard::KeyboardDevice {

bool isAttached() const override { return true; }

lv_indev_t* _Nullable getLvglIndev() override { return lvglDevice; }
lv_indev_t* getLvglIndev() override { return lvglDevice; }
};
3 changes: 0 additions & 3 deletions Devices/simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})

target_link_libraries(Simulator PRIVATE ${SDL2_LIBRARIES})

add_definitions(-D_Nullable=)
add_definitions(-D_Nonnull=)

endif()
108 changes: 0 additions & 108 deletions Devices/simulator/Source/LvglTask.cpp

This file was deleted.

5 changes: 0 additions & 5 deletions Devices/simulator/Source/LvglTask.h

This file was deleted.

18 changes: 0 additions & 18 deletions Devices/simulator/Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,3 @@ void freertosMain() {
}

} // namespace

/**
* Assert implementation as defined in the FreeRTOSConfig.h
* It allows you to set breakpoints and debug asserts.
*/
void vAssertCalled(unsigned long line, const char* const file) {
volatile uint32_t set_to_nonzero_in_debugger_to_continue = 0;
LOGGER.error("Assert triggered at {}:{}", file, line);
taskENTER_CRITICAL();
{
// Step out by attaching a debugger and setting set_to_nonzero_in_debugger_to_continue
while (set_to_nonzero_in_debugger_to_continue == 0) {
// NO-OP
}
}
taskEXIT_CRITICAL();
}

Loading