Add drivers to module and make start/stop optional (#580)
This commit is contained in:
committed by
GitHub
parent
08eac48e64
commit
429125734a
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct Module btt_panda_touch_module = {
|
||||
.name = "btt-panda-touch",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module btt_panda_touch_module = {
|
||||
.name = "btt-panda-touch"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_2432s024c_module = {
|
||||
.name = "cyd-2432s024c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct Module cyd_2432s024r_module = {
|
||||
.name = "cyd-2432s024r",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module cyd_2432s024r_module = {
|
||||
.name = "cyd-2432s024r"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct Module cyd_2432s028r_module = {
|
||||
.name = "cyd-2432s028r",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module cyd_2432s028r_module = {
|
||||
.name = "cyd-2432s028r"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct Module cyd_2432s028rv3_module = {
|
||||
.name = "cyd-2432s028rv3",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module cyd_2432s028rv3_module = {
|
||||
.name = "cyd-2432s028rv3"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_2432s032c_module = {
|
||||
.name = "cyd-2432s032c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "cyd-2432s032c"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_3248s035c_module = {
|
||||
.name = "cyd-3248s035c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "cyd-3248s035c"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_4848s040c_module = {
|
||||
.name = "cyd-4848s040c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "cyd-4848s040c"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_8048s043c_module = {
|
||||
.name = "cyd-8048s043c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "cyd-8048s043c"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_e32r28t_module = {
|
||||
.name = "cyd-e32r28t",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "cyd-e32r28t"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module cyd_e32r32p_module = {
|
||||
.name = "cyd-e32r32p",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "cyd-e32r32p"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module elecrow_crowpanel_advance_28_module = {
|
||||
.name = "elecrow-crowpanel-advance-28",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr
|
||||
.name = "elecrow-crowpanel-advance-28"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module elecrow_crowpanel_advance_35_module = {
|
||||
.name = "elecrow-crowpanel-advance-35",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "elecrow-crowpanel-advance-35"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module elecrow_crowpanel_advance_50_module = {
|
||||
.name = "elecrow-crowpanel-advance-50",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "elecrow-crowpanel-advance-50"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module elecrow_crowpanel_basic_28_module = {
|
||||
.name = "elecrow-crowpanel-basic-28",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "elecrow-crowpanel-basic-28"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module elecrow_crowpanel_basic_35_module = {
|
||||
.name = "elecrow-crowpanel-basic-35",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "elecrow-crowpanel-basic-35"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module elecrow_crowpanel_basic_50_module = {
|
||||
.name = "elecrow-crowpanel-basic-50",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "elecrow-crowpanel-basic-50"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module es3c28p_module = {
|
||||
.name = "es3c28p",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "es3c28p"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module generic_esp32_module = {
|
||||
.name = "generic-esp32",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "generic-esp32"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module generic_esp32c6_module = {
|
||||
.name = "generic-esp32c6",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "generic-esp32c6"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module generic_esp32p4_module = {
|
||||
.name = "generic-esp32p4",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "generic-esp32p4"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module generic_esp32s3_module = {
|
||||
.name = "generic-esp32s3",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "generic-esp32s3"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module guition_jc1060p470ciwy_module = {
|
||||
.name = "guition-jc1060p470ciwy",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "guition-jc1060p470ciwy"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module guition_jc2432w328c_module = {
|
||||
.name = "guition-jc2432w328c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "guition-jc2432w328c"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module guition_jc8048w550c_module = {
|
||||
.name = "guition-jc8048w550c",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "guition-jc8048w550c"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module heltec_wifi_lora_32_v3_module = {
|
||||
.name = "heltec-wifi-lora-32-v3",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "heltec-wifi-lora-32-v3"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module lilygo_tdeck_max_module = {
|
||||
.name = "lilygo-tdeck-max",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module lilygo_tdeck_max_module = {
|
||||
.name = "lilygo-tdeck-max"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ hardware.tinyUsb=true
|
||||
hardware.esptoolFlashFreq=120M
|
||||
hardware.bluetooth=true
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=2.8"
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
constexpr auto* TAG = "tdeck-plus";
|
||||
|
||||
// Legacy placeholder (required until legacy HAL is cleaned up everywhere)
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
|
||||
extern "C" {
|
||||
|
||||
void subscribe_events() {
|
||||
|
||||
@@ -12,6 +12,8 @@ hardware.tinyUsb=true
|
||||
hardware.esptoolFlashFreq=120M
|
||||
hardware.bluetooth=true
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=2.8"
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
|
||||
constexpr auto* TAG = "tdeck";
|
||||
|
||||
// Legacy placeholder (required until legacy HAL is cleaned up everywhere)
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
|
||||
extern "C" {
|
||||
|
||||
void subscribe_events() {
|
||||
@@ -63,9 +60,7 @@ static error_t stop() {
|
||||
Module lilygo_tdeck_module = {
|
||||
.name = "lilygo-tdeck",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.stop = stop
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -30,16 +30,17 @@ static error_t start() {
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
if (gpio_set_level(POWER_ON_PIN, 0) != ESP_OK) {
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module lilygo_tdisplay_s3_module = {
|
||||
Module lilygo_tdisplay_s3_module = {
|
||||
.name = "lilygo-tdisplay-s3",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.stop = stop
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module lilygo_tdisplay_module = {
|
||||
.name = "lilygo-tdisplay",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module lilygo_tdisplay_module = {
|
||||
.name = "lilygo-tdisplay"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module lilygo_tdongle_s3_module = {
|
||||
.name = "lilygo-tdongle-s3",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module lilygo_tdongle_s3_module = {
|
||||
.name = "lilygo-tdongle-s3"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module lilygo_thmi_module = {
|
||||
.name = "lilygo-thmi",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module lilygo_thmi_module = {
|
||||
.name = "lilygo-thmi"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ hardware.tinyUsb=true
|
||||
hardware.esptoolFlashFreq=40M
|
||||
hardware.bluetooth=true
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=2.33"
|
||||
|
||||
@@ -15,18 +15,15 @@
|
||||
|
||||
constexpr auto* TAG = "T-Lora Pager";
|
||||
|
||||
// Legacy placeholder (required until legacy HAL is cleaned up everywhere). All board
|
||||
// peripherals are kernel drivers now (see the .dts): display (st7796), battery (bq27220),
|
||||
// charger power-off (bq25896), haptics (drv2605), keyboard (tca8418) and the encoder wheel
|
||||
// (lilygo,tpager-encoder, bound to LVGL below).
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
|
||||
extern "C" {
|
||||
|
||||
static void subscribe_events() {
|
||||
tt::kernel::SystemEventSubscription event_subscription;
|
||||
|
||||
static error_t start() {
|
||||
|
||||
LOG_I(TAG, LOG_MESSAGE_POWER_ON_START);
|
||||
|
||||
tt::kernel::subscribeSystemEvent(tt::kernel::SystemEvent::BootSplash, [](tt::kernel::SystemEvent) {
|
||||
event_subscription = tt::kernel::subscribeSystemEvent(tt::kernel::SystemEvent::BootSplash, [](tt::kernel::SystemEvent) {
|
||||
// The kernel tpager_encoder device is already started by kernel_init(); this just
|
||||
// registers it as an LVGL input device, which requires LVGL to be up first.
|
||||
lvgl_lock();
|
||||
@@ -50,23 +47,18 @@ static void subscribe_events() {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static error_t start() {
|
||||
subscribe_events();
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
tt::kernel::unsubscribeSystemEvent(event_subscription);
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module lilygo_tlora_pager_module = {
|
||||
Module lilygo_tlora_pager_module = {
|
||||
.name = "lilygo-tlora-pager",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.stop = stop
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module m5stack_cardputer_adv_module = {
|
||||
.name = "m5stack-cardputer-adv",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module m5stack_cardputer_adv_module = {
|
||||
.name = "m5stack-cardputer-adv"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
Module m5stack_cardputer_module = {
|
||||
.name = "m5stack-cardputer",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "m5stack-cardputer"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
@@ -7,11 +6,7 @@ extern "C" {
|
||||
// and axp192-module's start()), replacing what used to be done by hand here via a
|
||||
// DEVICE_EVENT_STARTED device_listener.
|
||||
Module m5stack_core2_module = {
|
||||
.name = "m5stack-core2",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "m5stack-core2"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct Module m5stack_cores3_module = {
|
||||
.name = "m5stack-cores3",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module m5stack_cores3_module = {
|
||||
.name = "m5stack-cores3"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
@@ -9,26 +7,16 @@ extern Driver papers3_power_driver;
|
||||
extern Driver papers3_power_supply_driver;
|
||||
extern Driver papers3_display_driver;
|
||||
|
||||
static error_t start() {
|
||||
check(driver_construct_add(&papers3_power_supply_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&papers3_power_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&papers3_display_driver) == ERROR_NONE);
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
check(driver_remove_destruct(&papers3_display_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&papers3_power_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&papers3_power_supply_driver) == ERROR_NONE);
|
||||
return ERROR_NONE;
|
||||
}
|
||||
static Driver* const papers3_drivers[] = {
|
||||
&papers3_display_driver,
|
||||
&papers3_power_driver,
|
||||
&papers3_power_supply_driver,
|
||||
nullptr
|
||||
};
|
||||
|
||||
Module m5stack_papers3_module = {
|
||||
.name = "m5stack-papers3",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.drivers = papers3_drivers
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -56,9 +56,7 @@ static error_t stop() {
|
||||
Module m5stack_stackchan_module = {
|
||||
.name = "m5stack-stackchan",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.stop = stop
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ constexpr auto* TAG = "StickCPlus2";
|
||||
|
||||
extern "C" {
|
||||
|
||||
static bool init_power() {
|
||||
static error_t init_power() {
|
||||
// CH552 applies 4 V to GPIO 0, which reduces Wi-Fi sensitivity.
|
||||
// Setting output to high adds a bias of 3.3 V and suppresses over-voltage:
|
||||
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT);
|
||||
@@ -17,25 +17,12 @@ static bool init_power() {
|
||||
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(GPIO_NUM_4, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static error_t start() {
|
||||
init_power();
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
Module m5stack_stickc_plus2_module = {
|
||||
.name = "m5stack-stickc-plus2",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.start = init_power
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module m5stack_sticks3_module = {
|
||||
.name = "m5stack-sticks3",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "m5stack-sticks3"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "devices/tab5_power_control.h"
|
||||
#include "devices/tab_5_camera.h"
|
||||
|
||||
#define TAG "Tab5"
|
||||
constexpr auto* TAG = "Tab5";
|
||||
|
||||
// PI4IOE5V6408-0 (0x43) bit 1
|
||||
constexpr auto GPIO_EXP0_PIN_SPEAKER_ENABLE = 1;
|
||||
@@ -65,44 +65,31 @@ static void on_io_expander0_started(Device* device, DeviceEvent event, void* con
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
|
||||
/* Crash when construct fails, because if a single driver fails to construct,
|
||||
* there is no guarantee that the previously constructed drivers can be destroyed */
|
||||
check(driver_construct_add(&tab5_keyboard_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&tab5_power_control_driver) == ERROR_NONE);
|
||||
|
||||
tab5_detect_start();
|
||||
|
||||
tab5_camera_init();
|
||||
|
||||
device_listener_add(on_io_expander0_started, nullptr);
|
||||
|
||||
tab5_headphone_detect_start();
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
tab5_headphone_detect_stop();
|
||||
|
||||
device_listener_remove(on_io_expander0_started);
|
||||
|
||||
tab5_detect_stop();
|
||||
|
||||
/* Crash when destruct fails, because if a single driver fails to destruct,
|
||||
* there is no guarantee that the previously destroyed drivers can be recovered */
|
||||
check(driver_remove_destruct(&tab5_keyboard_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&tab5_power_control_driver) == ERROR_NONE);
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static Driver* const tab5_drivers[] = {
|
||||
&tab5_keyboard_driver,
|
||||
&tab5_power_control_driver,
|
||||
nullptr
|
||||
};
|
||||
|
||||
Module m5stack_tab5_module = {
|
||||
.name = "m5stack-tab5",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.drivers = tab5_drivers
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -38,29 +38,26 @@ static void on_device_event(Device* device, DeviceEvent event, void* context) {
|
||||
}
|
||||
|
||||
static error_t start() {
|
||||
/* We crash when construct fails, because if a single driver fails to construct,
|
||||
* there is no guarantee that the previously constructed drivers can be destroyed */
|
||||
check(driver_construct_add(&unphone_power_switch_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&unphone_nav_buttons_driver) == ERROR_NONE);
|
||||
device_listener_add(on_device_event, nullptr);
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
device_listener_remove(&on_device_event);
|
||||
/* We crash when destruct fails, because if a single driver fails to destruct,
|
||||
* there is no guarantee that the previously destroyed drivers can be recovered */
|
||||
check(driver_remove_destruct(&unphone_nav_buttons_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&unphone_power_switch_driver) == ERROR_NONE);
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module unphone_module = {
|
||||
static Driver* const unphone_drivers[] = {
|
||||
&unphone_nav_buttons_driver,
|
||||
&unphone_power_switch_driver,
|
||||
nullptr
|
||||
};
|
||||
|
||||
Module unphone_module = {
|
||||
.name = "unphone",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.drivers = unphone_drivers
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,8 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
struct Module waveshare_esp32_s3_geek_module = {
|
||||
.name = "waveshare-esp32-s3-geek",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
Module waveshare_esp32_s3_geek_module = {
|
||||
.name = "waveshare-esp32-s3-geek"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module waveshare_s3_lcd_13_module = {
|
||||
.name = "waveshare-s3-lcd-13",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "waveshare-s3-lcd-13"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module waveshare_s3_touch_lcd_128_module = {
|
||||
.name = "waveshare-s3-touch-lcd-128",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "waveshare-s3-touch-lcd-128"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module waveshare_s3_touch_lcd_147_module = {
|
||||
.name = "waveshare-s3-touch-lcd-147",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "waveshare-s3-touch-lcd-147"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module waveshare_s3_touch_lcd_43_module = {
|
||||
.name = "waveshare-s3-touch-lcd-43",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "waveshare-s3-touch-lcd-43"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
#include <tactility/error.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
Module wireless_tag_wt32_sc01_plus_module = {
|
||||
.name = "wireless-tag-wt32-sc01-plus",
|
||||
.start = [] -> error_t { return ERROR_NONE; },
|
||||
.stop = [] -> error_t { return ERROR_NONE; },
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.name = "wireless-tag-wt32-sc01-plus"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user