Add drivers to module and make start/stop optional (#580)

This commit is contained in:
Ken Van Hoeylandt
2026-07-23 23:28:09 +02:00
committed by GitHub
parent 08eac48e64
commit 429125734a
131 changed files with 488 additions and 2381 deletions
-5
View File
@@ -1,5 +0,0 @@
idf_component_register(
SRC_DIRS "Source"
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lcd esp_lcd_touch esp_lvgl_port
)
-3
View File
@@ -1,3 +0,0 @@
# EspLcdCompat
A set of helper classes to implement `esp_lcd` drivers in Tactility.
@@ -1,130 +0,0 @@
#include "EspLcdDisplay.h"
#include "EspLcdDisplayDriver.h"
#include <tactility/log.h>
#include <tactility/check.h>
#include <Tactility/hal/touch/TouchDevice.h>
#include <cassert>
#include <esp_lvgl_port_disp.h>
constexpr auto* TAG = "EspLcdDisplay";
EspLcdDisplay::~EspLcdDisplay() {
check(
displayDriver == nullptr || displayDriver.use_count() < 2, // 1 reference is held by this class
"DisplayDriver is still in use. This will cause memory access violations."
);
}
bool EspLcdDisplay::start() {
if (!createIoHandle(ioHandle)) {
LOG_E(TAG, "Failed to create IO handle");
return false;
}
if (!createPanelHandle(ioHandle, panelHandle)) {
LOG_E(TAG, "Failed to create panel handle");
esp_lcd_panel_io_del(ioHandle);
return false;
}
return true;
}
bool EspLcdDisplay::stop() {
if (lvglDisplay != nullptr) {
stopLvgl();
lvglDisplay = nullptr;
}
if (panelHandle != nullptr && esp_lcd_panel_del(panelHandle) != ESP_OK) {
return false;
}
if (ioHandle != nullptr && esp_lcd_panel_io_del(ioHandle) != ESP_OK) {
return false;
}
if (displayDriver != nullptr && displayDriver.use_count() > 1) {
LOG_W(TAG, "DisplayDriver is still in use.");
}
return true;
}
bool EspLcdDisplay::startLvgl() {
assert(lvglDisplay == nullptr);
if (displayDriver != nullptr && displayDriver.use_count() > 1) {
LOG_W(TAG, "DisplayDriver is still in use.");
}
auto lvgl_port_config = getLvglPortDisplayConfig(ioHandle, panelHandle);
if (isRgbPanel()) {
auto rgb_config = getLvglPortDisplayRgbConfig(ioHandle, panelHandle);
lvglDisplay = lvgl_port_add_disp_rgb(&lvgl_port_config , &rgb_config);
} else {
lvglDisplay = lvgl_port_add_disp(&lvgl_port_config );
}
auto touch_device = getTouchDevice();
if (touch_device != nullptr && touch_device->supportsLvgl()) {
touch_device->startLvgl(lvglDisplay);
}
return lvglDisplay != nullptr;
}
bool EspLcdDisplay::stopLvgl() {
if (lvglDisplay == nullptr) {
return false;
}
auto touch_device = getTouchDevice();
if (touch_device != nullptr) {
touch_device->stopLvgl();
}
lvgl_port_remove_disp(lvglDisplay);
lvglDisplay = nullptr;
return true;
}
std::shared_ptr<tt::hal::display::DisplayDriver> EspLcdDisplay::getDisplayDriver() {
assert(lvglDisplay == nullptr); // Still attached to LVGL context. Call stopLvgl() first.
if (displayDriver == nullptr) {
auto lvgl_port_config = getLvglPortDisplayConfig(ioHandle, panelHandle);
tt::hal::display::ColorFormat color_format;
if (lvgl_port_config.color_format == LV_COLOR_FORMAT_I1) {
color_format = tt::hal::display::ColorFormat::Monochrome;
} else if (lvgl_port_config.color_format == LV_COLOR_FORMAT_RGB565) {
if (rgbElementOrder == LCD_RGB_ELEMENT_ORDER_RGB) {
if (lvgl_port_config.flags.swap_bytes) {
color_format = tt::hal::display::ColorFormat::RGB565Swapped;
} else {
color_format = tt::hal::display::ColorFormat::RGB565;
}
} else {
if (lvgl_port_config.flags.swap_bytes) {
color_format = tt::hal::display::ColorFormat::BGR565Swapped;
} else {
color_format = tt::hal::display::ColorFormat::BGR565;
}
}
} else if (lvgl_port_config.color_format == LV_COLOR_FORMAT_RGB888) {
color_format = tt::hal::display::ColorFormat::RGB888;
} else {
check(false, "unsupported driver");
}
displayDriver = std::make_shared<EspLcdDisplayDriver>(
panelHandle,
lvgl_port_config.hres,
lvgl_port_config.vres,
color_format
);
}
return displayDriver;
}
@@ -1,64 +0,0 @@
#pragma once
#include <tactility/check.h>
#include <Tactility/hal/display/DisplayDevice.h>
#include <esp_lcd_types.h>
#include <esp_lvgl_port_disp.h>
/** @deprecated use EspLcdDisplayV2 */
class EspLcdDisplay : public tt::hal::display::DisplayDevice {
esp_lcd_panel_io_handle_t ioHandle = nullptr;
esp_lcd_panel_handle_t panelHandle = nullptr;
lv_display_t* lvglDisplay = nullptr;
std::shared_ptr<tt::hal::display::DisplayDriver> displayDriver;
/** @warning This is never changed, so a driver that needs BGR is not supported */
lcd_rgb_element_order_t rgbElementOrder = LCD_RGB_ELEMENT_ORDER_RGB;
protected:
// Used for sending commands such as setting curves
esp_lcd_panel_io_handle_t getIoHandle() const { return ioHandle; }
virtual bool createIoHandle(esp_lcd_panel_io_handle_t& outHandle) = 0;
virtual bool createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) = 0;
virtual lvgl_port_display_cfg_t getLvglPortDisplayConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) = 0;
virtual bool isRgbPanel() const { return false; }
virtual lvgl_port_display_rgb_cfg_t getLvglPortDisplayRgbConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) { check(false, "Not supported"); }
public:
EspLcdDisplay() = default;
~EspLcdDisplay() override;
bool start() final;
bool stop() final;
// region LVGL
bool supportsLvgl() const final { return true; }
bool startLvgl() final;
bool stopLvgl() final;
lv_display_t* getLvglDisplay() const final { return lvglDisplay; }
// endregion
// region DisplayDriver
bool supportsDisplayDriver() const override { return true; }
/** @return a NativeDisplay instance if this device supports it */
std::shared_ptr<tt::hal::display::DisplayDriver> getDisplayDriver() final;
// endregion
};
@@ -1,47 +0,0 @@
#pragma once
#include <Tactility/hal/display/DisplayDriver.h>
#include <esp_lcd_panel_ops.h>
#if CONFIG_SOC_MIPI_DSI_SUPPORTED
#include <esp_lcd_mipi_dsi.h>
#endif
class EspLcdDisplayDriver : public tt::hal::display::DisplayDriver {
esp_lcd_panel_handle_t panelHandle;
uint16_t hRes;
uint16_t vRes;
tt::hal::display::ColorFormat colorFormat;
public:
EspLcdDisplayDriver(
esp_lcd_panel_handle_t panelHandle,
uint16_t hRes,
uint16_t vRes,
tt::hal::display::ColorFormat colorFormat
) : panelHandle(panelHandle), hRes(hRes), vRes(vRes), colorFormat(colorFormat) {}
tt::hal::display::ColorFormat getColorFormat() const override {
return colorFormat;
}
bool drawBitmap(int xStart, int yStart, int xEnd, int yEnd, const void* pixelData) override {
bool result = esp_lcd_panel_draw_bitmap(panelHandle, xStart, yStart, xEnd, yEnd, pixelData) == ESP_OK;
return result;
}
uint16_t getPixelWidth() const override { return hRes; }
uint16_t getPixelHeight() const override { return vRes; }
#if CONFIG_SOC_MIPI_DSI_SUPPORTED
uint8_t getFrameBuffers(void* outBuffers[2]) const override {
if (outBuffers == nullptr) {
return 0;
}
return (esp_lcd_dpi_panel_get_frame_buffer(panelHandle, 2, &outBuffers[0], &outBuffers[1]) == ESP_OK) ? 2 : 0;
}
#endif
};
@@ -1,231 +0,0 @@
#include "EspLcdDisplayV2.h"
#include "EspLcdDisplayDriver.h"
#include <tactility/log.h>
#include <tactility/check.h>
#include <Tactility/hal/touch/TouchDevice.h>
#include <cassert>
#include <esp_lvgl_port_disp.h>
constexpr auto* TAG = "EspLcdDispV2";
inline unsigned int getBufferSize(const std::shared_ptr<EspLcdConfiguration>& configuration) {
if (configuration->bufferSize != DEFAULT_BUFFER_SIZE) {
return configuration->bufferSize;
} else {
return configuration->horizontalResolution * (configuration->verticalResolution / 10);
}
}
EspLcdDisplayV2::~EspLcdDisplayV2() {
check(
displayDriver == nullptr || displayDriver.use_count() < 2, // 1 reference is held by this class
"DisplayDriver is still in use. This will cause memory access violations."
);
}
bool EspLcdDisplayV2::applyConfiguration() const {
if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
LOG_E(TAG, "Failed to reset panel");
return false;
}
if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
LOG_E(TAG, "Failed to init panel");
return false;
}
if (configuration->invertColor && esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
LOG_E(TAG, "Failed to set panel to invert");
return false;
}
// Warning: it looks like LVGL rotation is broken when "gap" is set and the screen is moved to a non-default orientation
int gap_x = configuration->swapXY ? configuration->gapY : configuration->gapX;
int gap_y = configuration->swapXY ? configuration->gapX : configuration->gapY;
bool should_set_gap = gap_x != 0 || gap_y != 0;
if (should_set_gap && esp_lcd_panel_set_gap(panelHandle, gap_x, gap_y) != ESP_OK) {
LOG_E(TAG, "Failed to set panel gap");
return false;
}
if (configuration->swapXY && esp_lcd_panel_swap_xy(panelHandle, configuration->swapXY) != ESP_OK) {
LOG_E(TAG, "Failed to swap XY ");
return false;
}
bool should_set_mirror = configuration->mirrorX || configuration->mirrorY;
if (should_set_mirror && esp_lcd_panel_mirror(panelHandle, configuration->mirrorX, configuration->mirrorY) != ESP_OK) {
LOG_E(TAG, "Failed to set panel to mirror");
return false;
}
if (configuration->invertColor && esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
LOG_E(TAG, "Failed to set panel to invert");
return false;
}
if (esp_lcd_panel_disp_on_off(panelHandle, true) != ESP_OK) {
LOG_E(TAG, "Failed to turn display on");
return false;
}
return true;
}
bool EspLcdDisplayV2::start() {
if (!createIoHandle(ioHandle)) {
LOG_E(TAG, "Failed to create IO handle");
return false;
}
esp_lcd_panel_dev_config_t panel_config = createPanelConfig(configuration, configuration->resetPin);
if (!createPanelHandle(ioHandle, panel_config, panelHandle)) {
LOG_E(TAG, "Failed to create panel handle");
esp_lcd_panel_io_del(ioHandle);
ioHandle = nullptr;
return false;
}
if (!applyConfiguration()) {
esp_lcd_panel_del(panelHandle);
panelHandle = nullptr;
esp_lcd_panel_io_del(ioHandle);
ioHandle = nullptr;
return false;
}
return true;
}
bool EspLcdDisplayV2::stop() {
if (lvglDisplay != nullptr) {
stopLvgl();
lvglDisplay = nullptr;
}
if (panelHandle != nullptr && esp_lcd_panel_del(panelHandle) != ESP_OK) {
return false;
}
if (ioHandle != nullptr && esp_lcd_panel_io_del(ioHandle) != ESP_OK) {
return false;
}
if (displayDriver != nullptr && displayDriver.use_count() > 1) {
LOG_W(TAG, "DisplayDriver is still in use.");
}
return true;
}
bool EspLcdDisplayV2::startLvgl() {
assert(lvglDisplay == nullptr);
if (displayDriver != nullptr && displayDriver.use_count() > 1) {
LOG_W(TAG, "DisplayDriver is still in use.");
}
auto lvgl_port_config = getLvglPortDisplayConfig(configuration, ioHandle, panelHandle);
if (useDsiPanel()) {
auto dsi_config = getLvglPortDisplayDsiConfig(ioHandle, panelHandle);
lvglDisplay = lvgl_port_add_disp_dsi(&lvgl_port_config, &dsi_config);
} else if (isRgbPanel()) {
auto rgb_config = getLvglPortDisplayRgbConfig(ioHandle, panelHandle);
lvglDisplay = lvgl_port_add_disp_rgb(&lvgl_port_config, &rgb_config);
} else {
lvglDisplay = lvgl_port_add_disp(&lvgl_port_config);
}
auto touch_device = getTouchDevice();
if (touch_device != nullptr && touch_device->supportsLvgl()) {
touch_device->startLvgl(lvglDisplay);
}
return lvglDisplay != nullptr;
}
bool EspLcdDisplayV2::stopLvgl() {
if (lvglDisplay == nullptr) {
return false;
}
auto touch_device = getTouchDevice();
if (touch_device != nullptr) {
touch_device->stopLvgl();
}
lvgl_port_remove_disp(lvglDisplay);
lvglDisplay = nullptr;
return true;
}
lvgl_port_display_cfg_t EspLcdDisplayV2::getLvglPortDisplayConfig(std::shared_ptr<EspLcdConfiguration> configuration, esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
return lvgl_port_display_cfg_t {
.io_handle = ioHandle,
.panel_handle = panelHandle,
.control_handle = nullptr,
.buffer_size = getBufferSize(configuration),
.double_buffer = false,
.trans_size = 0,
.hres = configuration->horizontalResolution,
.vres = configuration->verticalResolution,
.monochrome = configuration->monochrome,
.rotation = {
.swap_xy = configuration->swapXY,
.mirror_x = configuration->mirrorX,
.mirror_y = configuration->mirrorY,
},
.color_format = configuration->lvglColorFormat,
.flags = {
.buff_dma = configuration->buffSpiram ? 0u : 1u,
.buff_spiram = configuration->buffSpiram ? 1u : 0u,
.sw_rotate = configuration->swRotate ? 1u : 0u,
.swap_bytes = configuration->lvglSwapBytes,
.full_refresh = 0,
.direct_mode = 0
}
};
}
std::shared_ptr<tt::hal::display::DisplayDriver> EspLcdDisplayV2::getDisplayDriver() {
assert(lvglDisplay == nullptr); // Still attached to LVGL context. Call stopLvgl() first.
if (displayDriver == nullptr) {
auto lvgl_port_config = getLvglPortDisplayConfig(configuration, ioHandle, panelHandle);
auto panel_config = createPanelConfig(configuration, GPIO_NUM_NC);
tt::hal::display::ColorFormat color_format;
if (lvgl_port_config.color_format == LV_COLOR_FORMAT_I1) {
color_format = tt::hal::display::ColorFormat::Monochrome;
} else if (lvgl_port_config.color_format == LV_COLOR_FORMAT_RGB565) {
if (panel_config.rgb_ele_order == LCD_RGB_ELEMENT_ORDER_RGB) {
if (lvgl_port_config.flags.swap_bytes) {
color_format = tt::hal::display::ColorFormat::RGB565Swapped;
} else {
color_format = tt::hal::display::ColorFormat::RGB565;
}
} else {
if (lvgl_port_config.flags.swap_bytes) {
color_format = tt::hal::display::ColorFormat::BGR565Swapped;
} else {
color_format = tt::hal::display::ColorFormat::BGR565;
}
}
} else if (lvgl_port_config.color_format == LV_COLOR_FORMAT_RGB888) {
color_format = tt::hal::display::ColorFormat::RGB888;
} else {
check(false, "unsupported driver");
}
displayDriver = std::make_shared<EspLcdDisplayDriver>(
panelHandle,
lvgl_port_config.hres,
lvgl_port_config.vres,
color_format
);
}
return displayDriver;
}
@@ -1,114 +0,0 @@
#pragma once
#include <tactility/check.h>
#include <Tactility/hal/display/DisplayDevice.h>
#include <esp_lcd_panel_dev.h>
#include <esp_lcd_types.h>
#include <esp_lvgl_port_disp.h>
constexpr auto DEFAULT_BUFFER_SIZE = 0;
struct EspLcdConfiguration {
unsigned int horizontalResolution;
unsigned int verticalResolution;
int gapX;
int gapY;
bool monochrome;
bool swapXY;
bool mirrorX;
bool mirrorY;
bool invertColor;
uint32_t bufferSize; // Size in pixel count. 0 means default, which is 1/10 of the screen size
bool swRotate = false; // Use LVGL software rotation instead of hardware swap_xy (required for MIPI-DSI panels that don't support swap_xy)
bool buffSpiram = false; // Allocate LVGL draw buffers from PSRAM instead of DMA-capable internal SRAM (required when sw_rotate needs a 3rd buffer that won't fit in internal SRAM)
std::shared_ptr<tt::hal::touch::TouchDevice> touch;
std::function<void(uint8_t)> _Nullable backlightDutyFunction;
gpio_num_t resetPin;
lv_color_format_t lvglColorFormat;
bool lvglSwapBytes;
lcd_rgb_element_order_t rgbElementOrder;
uint32_t bitsPerPixel;
};
class EspLcdDisplayV2 : public tt::hal::display::DisplayDevice {
esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
esp_lcd_panel_handle_t _Nullable panelHandle = nullptr;
lv_display_t* _Nullable lvglDisplay = nullptr;
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable displayDriver;
std::shared_ptr<EspLcdConfiguration> configuration;
bool applyConfiguration() const;
lvgl_port_display_cfg_t getLvglPortDisplayConfig(std::shared_ptr<EspLcdConfiguration> configuration, esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle);
protected:
virtual bool createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) = 0;
virtual esp_lcd_panel_dev_config_t createPanelConfig(std::shared_ptr<EspLcdConfiguration> espLcdConfiguration, gpio_num_t resetPin) = 0;
virtual bool createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_panel_dev_config_t& panelConfig, esp_lcd_panel_handle_t& panelHandle) = 0;
virtual bool isRgbPanel() const { return false; }
virtual lvgl_port_display_rgb_cfg_t getLvglPortDisplayRgbConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) { check(false, "Not supported"); }
// Hook for MIPI-DSI DPI panels to let LVGL port use DSI-specific path
virtual bool useDsiPanel() const { return false; }
virtual lvgl_port_display_dsi_cfg_t getLvglPortDisplayDsiConfig(esp_lcd_panel_io_handle_t /*ioHandle*/, esp_lcd_panel_handle_t /*panelHandle*/) {
return lvgl_port_display_dsi_cfg_t{ .flags = { .avoid_tearing = 0 } };
}
// Used for sending commands such as setting curves
esp_lcd_panel_io_handle_t getIoHandle() const { return ioHandle; }
public:
explicit EspLcdDisplayV2(const std::shared_ptr<EspLcdConfiguration>& configuration) :
configuration(configuration)
{}
~EspLcdDisplayV2() override;
bool start() final;
bool stop() final;
// region LVGL
bool supportsLvgl() const final { return true; }
bool startLvgl() final;
bool stopLvgl() final;
lv_display_t* _Nullable getLvglDisplay() const final { return lvglDisplay; }
// endregion
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable getTouchDevice() override { return configuration->touch; }
// region Backlight
void setBacklightDuty(uint8_t backlightDuty) override {
if (configuration->backlightDutyFunction != nullptr) {
configuration->backlightDutyFunction(backlightDuty);
}
}
bool supportsBacklightDuty() const override { return configuration->backlightDutyFunction != nullptr; }
// endregion
// region DisplayDriver
bool supportsDisplayDriver() const override { return true; }
/** @return a NativeDisplay instance if this device supports it */
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable getDisplayDriver() final;
// endregion
};
@@ -1,70 +0,0 @@
#include "EspLcdSpiDisplay.h"
#include <esp_lcd_panel_commands.h>
#include <tactility/log.h>
constexpr auto* TAG = "EspLcdSpiDisplay";
bool EspLcdSpiDisplay::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
LOG_I(TAG, "createIoHandle");
const esp_lcd_panel_io_spi_config_t panel_io_config = {
.cs_gpio_num = spiConfiguration->csPin,
.dc_gpio_num = spiConfiguration->dcPin,
.spi_mode = 0,
.pclk_hz = spiConfiguration->pixelClockFrequency,
.trans_queue_depth = spiConfiguration->transactionQueueDepth,
.on_color_trans_done = nullptr,
.user_ctx = nullptr,
.lcd_cmd_bits = 8,
.lcd_param_bits = 8,
.cs_ena_pretrans = 0,
.cs_ena_posttrans = 0,
.flags = {
.dc_high_on_cmd = 0,
.dc_low_on_data = 0,
.dc_low_on_param = 0,
.octal_mode = 0,
.quad_mode = 0,
.sio_mode = 1,
.lsb_first = 0,
.cs_high_active = 0
}
};
if (esp_lcd_new_panel_io_spi(spiConfiguration->spiHostDevice, &panel_io_config, &outHandle) != ESP_OK) {
LOG_E(TAG, "Failed to create panel");
return false;
}
return true;
}
void EspLcdSpiDisplay::setGammaCurve(uint8_t index) {
uint8_t gamma_curve;
switch (index) {
case 0:
gamma_curve = 0x01;
break;
case 1:
gamma_curve = 0x04;
break;
case 2:
gamma_curve = 0x02;
break;
case 3:
gamma_curve = 0x08;
break;
default:
return;
}
const uint8_t param[] = {
gamma_curve
};
auto io_handle = getIoHandle();
assert(io_handle != nullptr);
if (esp_lcd_panel_io_tx_param(io_handle, LCD_CMD_GAMSET, param, 1) != ESP_OK) {
LOG_E(TAG, "Failed to set gamma");
}
}
@@ -1,49 +0,0 @@
#pragma once
#include "EspLcdDisplayV2.h"
#include <driver/spi_common.h>
#include <esp_lcd_io_spi.h>
#include <esp_lcd_types.h>
/**
* Adds IO implementations on top of EspLcdDisplayV2
* @warning This is an abstract class. You need to extend it to use it.
*/
class EspLcdSpiDisplay : public EspLcdDisplayV2 {
public:
struct SpiConfiguration {
spi_host_device_t spiHostDevice;
gpio_num_t csPin;
gpio_num_t dcPin;
unsigned int pixelClockFrequency = 80'000'000; // Hertz
size_t transactionQueueDepth = 10;
};
explicit EspLcdSpiDisplay(const std::shared_ptr<EspLcdConfiguration>& configuration, const std::shared_ptr<SpiConfiguration> spiConfiguration, int gammaCurveCount) :
EspLcdDisplayV2(configuration),
spiConfiguration(spiConfiguration),
gammaCurveCount(gammaCurveCount)
{}
private:
std::shared_ptr<SpiConfiguration> spiConfiguration;
int gammaCurveCount;
protected:
bool createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) override;
// region Gamma
void setGammaCurve(uint8_t index) override;
uint8_t getGammaCurveCount() const override { return gammaCurveCount; }
// endregion
};
@@ -1,93 +0,0 @@
#include "EspLcdTouch.h"
#include <EspLcdTouchDriver.h>
#include <tactility/log.h>
#include <esp_lvgl_port_touch.h>
constexpr auto* TAG = "EspLcdTouch";
bool EspLcdTouch::start() {
if (!createIoHandle(ioHandle) != ESP_OK) {
LOG_E(TAG, "Touch IO failed");
return false;
}
config = createEspLcdTouchConfig();
if (!createTouchHandle(ioHandle, config, touchHandle)) {
LOG_E(TAG, "Driver init failed");
esp_lcd_panel_io_del(ioHandle);
ioHandle = nullptr;
return false;
}
return true;
}
bool EspLcdTouch::stop() {
if (lvglDevice != nullptr) {
stopLvgl();
}
if (ioHandle != nullptr) {
esp_lcd_panel_io_del(ioHandle);
ioHandle = nullptr;
}
if (touchHandle != nullptr) {
esp_lcd_touch_del(touchHandle);
touchHandle = nullptr;
}
return true;
}
bool EspLcdTouch::startLvgl(lv_disp_t* display) {
if (lvglDevice != nullptr) {
return false;
}
if (touchDriver != nullptr && touchDriver.use_count() > 1) {
LOG_W(TAG, "TouchDriver is still in use.");
}
const lvgl_port_touch_cfg_t touch_cfg = {
.disp = display,
.handle = touchHandle,
};
LOG_I(TAG, "Adding touch to LVGL");
lvglDevice = lvgl_port_add_touch(&touch_cfg);
if (lvglDevice == nullptr) {
LOG_E(TAG, "Adding touch failed");
return false;
}
return true;
}
bool EspLcdTouch::stopLvgl() {
if (lvglDevice == nullptr) {
return false;
}
lvgl_port_remove_touch(lvglDevice);
lvglDevice = nullptr;
return true;
}
std::shared_ptr<tt::hal::touch::TouchDriver> _Nullable EspLcdTouch::getTouchDriver() {
assert(lvglDevice == nullptr); // Still attached to LVGL context. Call stopLvgl() first.
if (touchHandle == nullptr) {
return nullptr;
}
if (touchDriver == nullptr) {
touchDriver = std::make_shared<EspLcdTouchDriver>(touchHandle);
}
return touchDriver;
}
-44
View File
@@ -1,44 +0,0 @@
#pragma once
#include <esp_lcd_touch.h>
#include <esp_lcd_types.h>
#include <lvgl.h>
#include <Tactility/hal/touch/TouchDevice.h>
#include <Tactility/hal/touch/TouchDriver.h>
class EspLcdTouch : public tt::hal::touch::TouchDevice {
esp_lcd_touch_config_t config;
esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
esp_lcd_touch_handle_t _Nullable touchHandle = nullptr;
lv_indev_t* lvglDevice = nullptr;
std::shared_ptr<tt::hal::touch::TouchDriver> touchDriver;
protected:
esp_lcd_touch_handle_t _Nullable getTouchHandle() const { return touchHandle; }
virtual bool createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) = 0;
virtual bool createTouchHandle(esp_lcd_panel_io_handle_t ioHandle, const esp_lcd_touch_config_t& configuration, esp_lcd_touch_handle_t& touchHandle) = 0;
virtual esp_lcd_touch_config_t createEspLcdTouchConfig() = 0;
public:
bool start() final;
bool stop() final;
bool supportsLvgl() const final { return true; }
bool startLvgl(lv_display_t* display) final;
bool stopLvgl() final;
lv_indev_t* getLvglIndev() final { return lvglDevice; }
bool supportsTouchDriver() override { return true; }
std::shared_ptr<tt::hal::touch::TouchDriver> _Nullable getTouchDriver() final;
};
@@ -1,13 +0,0 @@
#include "EspLcdTouchDriver.h"
#include <tactility/log.h>
constexpr auto* TAG = "EspLcdTouchDriver";
bool EspLcdTouchDriver::getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* _Nullable strength, uint8_t* pointCount, uint8_t maxPointCount) {
if (esp_lcd_touch_read_data(handle) != ESP_OK) {
LOG_E(TAG, "Read data failed");
return false;
}
return esp_lcd_touch_get_coordinates(handle, x, y, strength, pointCount, maxPointCount);
}
@@ -1,15 +0,0 @@
#pragma once
#include <esp_lcd_touch.h>
#include <Tactility/hal/touch/TouchDriver.h>
class EspLcdTouchDriver final : public tt::hal::touch::TouchDriver {
esp_lcd_touch_handle_t handle;
public:
EspLcdTouchDriver(esp_lcd_touch_handle_t handle) : handle(handle) {}
bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* pointCount, uint8_t maxPointCount) override;
};
+9 -14
View File
@@ -1,19 +1,14 @@
# Audio codec module
Defines `AUDIO_CODEC_TYPE` and the codec-agnostic `AudioCodecApi` (open/close/
read/write/volume/mute/native-rate/native-channels/capabilities) that every
audio codec driver in this repo implements (ES8311, ES8388, ES7210, AW88298,
the dummy I2S amps, the PDM mic). This is intentionally low-level: no
resampling or mixing, one codec device per chip. Most app code should go
through `audio_stream` (see `Drivers/audio-stream-module`) instead of talking
to a codec device directly.
Defines codec-agnostic `AudioCodecApi` (open/close/read/write/volume/mute/native-rate/native-channels/capabilities)
that every audio codec driver in this repo implements (ES8311, ES8388, ES7210, AW88298, the dummy I2S amps, the PDM mic).
This is intentionally low-level: no resampling or mixing, one codec device per chip. Most app code should go through
`audio_stream` (see `Drivers/audio-stream-module`) instead of talking to a codec device directly.
Also provides `audio_codec_adapters.h`: glue that lets a codec driver build an
`esp_codec_dev` control/data/GPIO interface (`audio_codec_ctrl_if_t` /
`audio_codec_data_if_t` / `audio_codec_gpio_if_t`) directly from Tactility's
own I2C controller, I2S controller, and GPIO pin devices, so a codec driver
only ever needs `device_get_parent()`/`device_find_by_name()` plus a handful
of devicetree properties -- it never touches the platform I2C/I2S/GPIO APIs
directly.
Also provides `audio_codec_adapters.h`: glue that lets a codec driver build an `esp_codec_dev` control/data/GPIO
interface (`audio_codec_ctrl_if_t` / `audio_codec_data_if_t` / `audio_codec_gpio_if_t`) directly from Tactility's
own I2C controller, I2S controller, and GPIO pin devices, so a codec driver only ever needs
`device_get_parent()`/`device_find_by_name()` plus a handful of devicetree properties -- it never touches the platform
I2C/I2S/GPIO APIs directly.
License: [Apache v2.0](LICENSE-Apache-2.0.md)
@@ -44,8 +44,7 @@ Module audio_stream_module = {
.name = "audio-stream",
.start = start,
.stop = stop,
.symbols = audio_stream_module_symbols,
.internal = nullptr
.symbols = audio_stream_module_symbols
};
}
+7 -15
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,24 +6,17 @@ extern "C" {
extern Driver aw88298_driver;
static error_t start() {
check(driver_construct_add(&aw88298_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&aw88298_driver) == ERROR_NONE);
return ERROR_NONE;
}
extern const ModuleSymbol aw88298_module_symbols[];
static Driver* const aw88298_drivers[] = {
&aw88298_driver,
nullptr
};
Module aw88298_module = {
.name = "aw88298",
.start = start,
.stop = stop,
.symbols = aw88298_module_symbols,
.internal = nullptr
.drivers = aw88298_drivers,
.symbols = aw88298_module_symbols
};
}
+5 -14
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,22 +6,14 @@ extern "C" {
extern Driver aw9523b_driver;
static error_t start() {
check(driver_construct_add(&aw9523b_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&aw9523b_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const aw9523b_drivers[] = {
&aw9523b_driver,
nullptr
};
Module aw9523b_module = {
.name = "aw9523b",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = aw9523b_drivers
};
}
+8 -21
View File
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <drivers/axp192.h>
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -10,6 +9,13 @@ extern Driver axp192_driver;
extern Driver axp192_power_supply_driver;
extern Driver axp192_backlight_driver;
static Driver* const axp192_drivers[] = {
&axp192_driver,
&axp192_power_supply_driver,
&axp192_backlight_driver,
nullptr
};
const struct ModuleSymbol axp192_module_symbols[] = {
DEFINE_MODULE_SYMBOL(axp192_is_rail_enabled),
DEFINE_MODULE_SYMBOL(axp192_set_rail_enabled),
@@ -27,28 +33,9 @@ const struct ModuleSymbol axp192_module_symbols[] = {
MODULE_SYMBOL_TERMINATOR
};
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(&axp192_driver) == ERROR_NONE);
check(driver_construct_add(&axp192_power_supply_driver) == ERROR_NONE);
check(driver_construct_add(&axp192_backlight_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&axp192_backlight_driver) == ERROR_NONE);
check(driver_remove_destruct(&axp192_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&axp192_driver) == ERROR_NONE);
return ERROR_NONE;
}
Module axp192_module = {
.name = "axp192",
.start = start,
.stop = stop,
.drivers = axp192_drivers,
.symbols = axp192_module_symbols,
.internal = nullptr
};
+9 -23
View File
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <drivers/axp2101.h>
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -10,6 +9,13 @@ extern Driver axp2101_driver;
extern Driver axp2101_power_supply_driver;
extern Driver axp2101_backlight_driver;
static Driver* const axp2101_drivers[] = {
&axp2101_driver,
&axp2101_power_supply_driver,
&axp2101_backlight_driver,
nullptr
};
const struct ModuleSymbol axp2101_module_symbols[] = {
DEFINE_MODULE_SYMBOL(axp2101_is_dcdc_enabled),
DEFINE_MODULE_SYMBOL(axp2101_set_dcdc_enabled),
@@ -28,30 +34,10 @@ const struct ModuleSymbol axp2101_module_symbols[] = {
MODULE_SYMBOL_TERMINATOR
};
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(&axp2101_driver) == ERROR_NONE);
check(driver_construct_add(&axp2101_power_supply_driver) == ERROR_NONE);
check(driver_construct_add(&axp2101_backlight_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&axp2101_backlight_driver) == ERROR_NONE);
check(driver_remove_destruct(&axp2101_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&axp2101_driver) == ERROR_NONE);
return ERROR_NONE;
}
Module axp2101_module = {
.name = "axp2101",
.start = start,
.stop = stop,
.symbols = axp2101_module_symbols,
.internal = nullptr
.drivers = axp2101_drivers,
.symbols = axp2101_module_symbols
};
}
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver axs5106_driver;
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(&axs5106_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&axs5106_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const axs5106_drivers[] = {
&axs5106_driver,
nullptr
};
Module axs5106_module = {
.name = "axs5106",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = axs5106_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver bm8563_driver;
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(&bm8563_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&bm8563_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const bm8563_drivers[] = {
&bm8563_driver,
nullptr
};
Module bm8563_module = {
.name = "bm8563",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = bm8563_drivers
};
}
+6 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,28 +6,17 @@ extern "C" {
extern Driver bmi270_driver;
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(&bmi270_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&bmi270_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const bmi270_drivers[] = {
&bmi270_driver,
nullptr
};
extern const ModuleSymbol bmi270_module_symbols[];
Module bmi270_module = {
.name = "bmi270",
.start = start,
.stop = stop,
.symbols = bmi270_module_symbols,
.internal = nullptr
.drivers = bmi270_drivers,
.symbols = bmi270_module_symbols
};
}
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver bq24295_driver;
extern Driver bq24295_power_supply_driver;
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(&bq24295_driver) == ERROR_NONE);
check(driver_construct_add(&bq24295_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&bq24295_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&bq24295_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const bq24295_drivers[] = {
&bq24295_driver,
&bq24295_power_supply_driver,
nullptr
};
Module bq24295_module = {
.name = "bq24295",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = bq24295_drivers
};
}
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver bq25896_driver;
extern Driver bq25896_power_supply_driver;
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(&bq25896_power_supply_driver) == ERROR_NONE);
check(driver_construct_add(&bq25896_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&bq25896_driver) == ERROR_NONE);
check(driver_remove_destruct(&bq25896_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const bq25896_drivers[] = {
&bq25896_driver,
&bq25896_power_supply_driver,
nullptr
};
Module bq25896_module = {
.name = "bq25896",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = bq25896_drivers
};
} // extern "C"
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver bq27220_driver;
extern Driver bq27220_power_supply_driver;
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(&bq27220_power_supply_driver) == ERROR_NONE);
check(driver_construct_add(&bq27220_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&bq27220_driver) == ERROR_NONE);
check(driver_remove_destruct(&bq27220_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const bq27220_drivers[] = {
&bq27220_driver,
&bq27220_power_supply_driver,
nullptr
};
Module bq27220_module = {
.name = "bq27220",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = bq27220_drivers
};
} // extern "C"
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver button_control_driver;
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(&button_control_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&button_control_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const button_control_drivers[] = {
&button_control_driver,
nullptr
};
Module button_control_module = {
.name = "button-control",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = button_control_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ch422g_driver;
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(&ch422g_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ch422g_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ch422g_drivers[] = {
&ch422g_driver,
nullptr
};
Module ch422g_module = {
.name = "ch422g",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ch422g_drivers
};
}
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver cst328_driver;
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(&cst328_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&cst328_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const cst328_drivers[] = {
&cst328_driver,
nullptr
};
Module cst328_module = {
.name = "cst328",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = cst328_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver cst66xx_driver;
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(&cst66xx_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&cst66xx_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const cst66xx_drivers[] = {
&cst66xx_driver,
nullptr
};
Module cst66xx_module = {
.name = "cst66xx",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = cst66xx_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver cst816s_driver;
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(&cst816s_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&cst816s_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const cst816s_drivers[] = {
&cst816s_driver,
nullptr
};
Module cst816s_module = {
.name = "cst816s",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = cst816s_drivers
};
} // extern "C"
+5 -12
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,20 +6,14 @@ extern "C" {
extern Driver cst816t_driver;
static error_t start() {
return driver_construct_add(&cst816t_driver);
}
static error_t stop() {
return driver_remove_destruct(&cst816t_driver);
}
static Driver* const cst816t_drivers[] = {
&cst816t_driver,
nullptr
};
Module cst816t_module = {
.name = "cst816t",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = cst816t_drivers
};
} // extern "C"
+5 -14
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,22 +6,14 @@ extern "C" {
extern Driver drv2605_driver;
static error_t start() {
check(driver_construct_add(&drv2605_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&drv2605_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const drv2605_drivers[] = {
&drv2605_driver,
nullptr
};
Module drv2605_module = {
.name = "drv2605",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = drv2605_drivers
};
} // extern "C"
+6 -14
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,24 +6,17 @@ extern "C" {
extern Driver dummy_i2s_amp_driver;
static error_t start() {
check(driver_construct_add(&dummy_i2s_amp_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&dummy_i2s_amp_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const dummy_drivers[] = {
&dummy_i2s_amp_driver,
nullptr
};
extern const ModuleSymbol dummy_i2s_amp_module_symbols[];
Module dummy_i2s_amp_module = {
.name = "dummy_i2s_amp",
.start = start,
.stop = stop,
.symbols = dummy_i2s_amp_module_symbols,
.internal = nullptr
.drivers = dummy_drivers,
.symbols = dummy_i2s_amp_module_symbols
};
}
+5 -13
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,24 +6,17 @@ extern "C" {
extern Driver es7210_driver;
static error_t start() {
check(driver_construct_add(&es7210_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&es7210_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const es7210_drivers[] = {
&es7210_driver,
nullptr
};
extern const ModuleSymbol es7210_module_symbols[];
Module es7210_module = {
.name = "es7210",
.start = start,
.stop = stop,
.drivers = es7210_drivers,
.symbols = es7210_module_symbols,
.internal = nullptr
};
}
+6 -14
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,24 +6,17 @@ extern "C" {
extern Driver es8311_driver;
static error_t start() {
check(driver_construct_add(&es8311_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&es8311_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const es8311_drivers[] = {
&es8311_driver,
nullptr
};
extern const ModuleSymbol es8311_module_symbols[];
Module es8311_module = {
.name = "es8311",
.start = start,
.stop = stop,
.symbols = es8311_module_symbols,
.internal = nullptr
.drivers = es8311_drivers,
.symbols = es8311_module_symbols
};
}
+6 -14
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,24 +6,17 @@ extern "C" {
extern Driver es8388_driver;
static error_t start() {
check(driver_construct_add(&es8388_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&es8388_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const es8388_drivers[] = {
&es8388_driver,
nullptr
};
extern const ModuleSymbol es8388_module_symbols[];
Module es8388_module = {
.name = "es8388",
.start = start,
.stop = stop,
.symbols = es8388_module_symbols,
.internal = nullptr
.drivers = es8388_drivers,
.symbols = es8388_module_symbols
};
}
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ft5x06_driver;
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(&ft5x06_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ft5x06_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ft5x06_drivers[] = {
&ft5x06_driver,
nullptr
};
Module ft5x06_module = {
.name = "ft5x06",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ft5x06_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ft6x36_driver;
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(&ft6x36_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ft6x36_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ft6x36_drivers[] = {
&ft6x36_driver,
nullptr
};
Module ft6x36_module = {
.name = "ft6x36",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ft6x36_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver gc9a01_driver;
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(&gc9a01_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&gc9a01_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const gc9a01_drivers[] = {
&gc9a01_driver,
nullptr
};
Module gc9a01_module = {
.name = "gc9a01",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = gc9a01_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver gt911_driver;
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(&gt911_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&gt911_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const gt911_drivers[] = {
&gt911_driver,
nullptr
};
Module gt911_module = {
.name = "gt911",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = gt911_drivers
};
} // extern "C"
+6 -19
View File
@@ -1,32 +1,19 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
extern Driver hx8357_driver;
static Driver* const hx8357_drivers[] = {
&hx8357_driver,
nullptr
};
extern "C" {
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(&hx8357_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&hx8357_driver) == ERROR_NONE);
return ERROR_NONE;
}
Module hx8357_module = {
.name = "hx8357",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = hx8357_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ili9341_driver;
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(&ili9341_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ili9341_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ili9341_drivers[] = {
&ili9341_driver,
nullptr
};
Module ili9341_module = {
.name = "ili9341",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ili9341_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ili9488_driver;
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(&ili9488_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ili9488_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ili9488_drivers[] = {
&ili9488_driver,
nullptr
};
Module ili9488_module = {
.name = "ili9488",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ili9488_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ili9881c_driver;
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(&ili9881c_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ili9881c_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ili9881c_drivers[] = {
&ili9881c_driver,
nullptr
};
Module ili9881c_module = {
.name = "ili9881c",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ili9881c_drivers
};
} // extern "C"
+6 -19
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,30 +7,18 @@ extern "C" {
extern Driver ina226_driver;
extern Driver ina226_power_supply_driver;
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(&ina226_driver) == ERROR_NONE);
check(driver_construct_add(&ina226_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ina226_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&ina226_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ina226_drivers[] = {
&ina226_driver,
&ina226_power_supply_driver,
nullptr
};
extern const ModuleSymbol ina226_module_symbols[];
Module ina226_module = {
.name = "ina226",
.start = start,
.stop = stop,
.drivers = ina226_drivers,
.symbols = ina226_module_symbols,
.internal = nullptr
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver jd9165_driver;
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(&jd9165_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&jd9165_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const jd9165_drivers[] = {
&jd9165_driver,
nullptr
};
Module jd9165_module = {
.name = "jd9165",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = jd9165_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver jd9853_driver;
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(&jd9853_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&jd9853_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const jd9853_drivers[] = {
&jd9853_driver,
nullptr
};
Module jd9853_module = {
.name = "jd9853",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = jd9853_drivers
};
} // extern "C"
+8 -24
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -10,32 +9,17 @@ extern Driver tdeck_keyboard_backlight_driver;
extern Driver tdeck_trackball_driver;
extern Driver tpager_encoder_driver;
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(&tdeck_keyboard_driver) == ERROR_NONE);
check(driver_construct_add(&tdeck_keyboard_backlight_driver) == ERROR_NONE);
check(driver_construct_add(&tdeck_trackball_driver) == ERROR_NONE);
check(driver_construct_add(&tpager_encoder_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&tdeck_keyboard_driver) == ERROR_NONE);
check(driver_remove_destruct(&tdeck_keyboard_backlight_driver) == ERROR_NONE);
check(driver_remove_destruct(&tdeck_trackball_driver) == ERROR_NONE);
check(driver_remove_destruct(&tpager_encoder_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const lilygo_drivers[] = {
&tdeck_keyboard_driver,
&tdeck_keyboard_backlight_driver,
&tdeck_trackball_driver,
&tpager_encoder_driver,
nullptr
};
Module lilygo_module = {
.name = "lilygo",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = lilygo_drivers
};
} // extern "C"
+7 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,30 +7,18 @@ extern "C" {
extern Driver m5pm1_driver;
extern Driver m5pm1_power_supply_driver;
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(&m5pm1_driver) == ERROR_NONE);
check(driver_construct_add(&m5pm1_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&m5pm1_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&m5pm1_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const m5pm1_drivers[] = {
&m5pm1_driver,
&m5pm1_power_supply_driver,
nullptr
};
extern const ModuleSymbol m5pm1_module_symbols[];
Module m5pm1_module = {
.name = "m5pm1",
.start = start,
.stop = stop,
.symbols = m5pm1_module_symbols,
.internal = nullptr
.drivers = m5pm1_drivers,
.symbols = m5pm1_module_symbols
};
} // extern "C"
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver cardputer_keyboard_driver;
extern Driver cardputer_adv_keyboard_driver;
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(&cardputer_keyboard_driver) == ERROR_NONE);
check(driver_construct_add(&cardputer_adv_keyboard_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&cardputer_keyboard_driver) == ERROR_NONE);
check(driver_remove_destruct(&cardputer_adv_keyboard_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const m5stack_drivers[] = {
&cardputer_keyboard_driver,
&cardputer_adv_keyboard_driver,
nullptr
};
Module m5stack_module = {
.name = "m5stack",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = m5stack_drivers
};
} // extern "C"
+5 -17
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,28 +6,17 @@ extern "C" {
extern Driver mpu6886_driver;
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(&mpu6886_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&mpu6886_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const mpu6886_drivers[] = {
&mpu6886_driver,
nullptr
};
extern const ModuleSymbol mpu6886_module_symbols[];
Module mpu6886_module = {
.name = "mpu6886",
.start = start,
.stop = stop,
.drivers = mpu6886_drivers,
.symbols = mpu6886_module_symbols,
.internal = nullptr
};
} // extern "C"
+5 -13
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,24 +6,17 @@ extern "C" {
extern Driver pdm_mic_driver;
static error_t start() {
check(driver_construct_add(&pdm_mic_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&pdm_mic_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const pdm_mic_drivers[] = {
&pdm_mic_driver,
nullptr
};
extern const ModuleSymbol pdm_mic_module_symbols[];
Module pdm_mic_module = {
.name = "pdm_mic",
.start = start,
.stop = stop,
.drivers = pdm_mic_drivers,
.symbols = pdm_mic_module_symbols,
.internal = nullptr
};
}
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver pi4ioe5v6408_driver;
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(&pi4ioe5v6408_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&pi4ioe5v6408_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const pi4ioe5v6408_drivers[] = {
&pi4ioe5v6408_driver,
nullptr
};
Module pi4ioe5v6408_module = {
.name = "pi4ioe5v6408",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = pi4ioe5v6408_drivers
};
}
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,22 +6,14 @@ extern "C" {
extern Driver py32ioexpander_driver;
static error_t start() {
check(driver_construct_add(&py32ioexpander_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&py32ioexpander_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const py32ioexpander_drivers[] = {
&py32ioexpander_driver,
nullptr
};
Module py32ioexpander_module = {
.name = "py32ioexpander",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = py32ioexpander_drivers
};
} // extern "C"
+5 -17
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,28 +6,17 @@ extern "C" {
extern Driver qmi8658_driver;
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(&qmi8658_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&qmi8658_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const qmi8658_drivers[] = {
&qmi8658_driver,
nullptr
};
extern const ModuleSymbol qmi8658_module_symbols[];
Module qmi8658_module = {
.name = "qmi8658",
.start = start,
.stop = stop,
.drivers = qmi8658_drivers,
.symbols = qmi8658_module_symbols,
.internal = nullptr
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver rgb_display_driver;
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(&rgb_display_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&rgb_display_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const rgbd_display_drivers[] = {
&rgb_display_driver,
nullptr
};
Module rgb_display_module = {
.name = "rgb_display",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = rgbd_display_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver rx8130ce_driver;
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(&rx8130ce_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&rx8130ce_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const rx8130ce_drivers[] = {
&rx8130ce_driver,
nullptr
};
Module rx8130ce_module = {
.name = "rx8130ce",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = rx8130ce_drivers
};
} // extern "C"
+5 -14
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,22 +6,14 @@ extern "C" {
extern Driver sc2356_driver;
static error_t start() {
check(driver_construct_add(&sc2356_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
check(driver_remove_destruct(&sc2356_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const sc2356_drivers[] = {
&sc2356_driver,
nullptr
};
Module sc2356_module = {
.name = "sc2356",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = sc2356_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver ssd1306_driver;
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(&ssd1306_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&ssd1306_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const ssd1306_drivers[] = {
&ssd1306_driver,
nullptr
};
Module ssd1306_module = {
.name = "ssd1306",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = ssd1306_drivers
};
} // extern "C"
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver st7123_driver;
extern Driver st7123_touch_driver;
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(&st7123_driver) == ERROR_NONE);
check(driver_construct_add(&st7123_touch_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7123_touch_driver) == ERROR_NONE);
check(driver_remove_destruct(&st7123_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7123_drivers[] = {
&st7123_driver,
&st7123_touch_driver,
nullptr
};
Module st7123_module = {
.name = "st7123",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7123_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver st7701_driver;
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(&st7701_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7701_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7701_drivers[] = {
&st7701_driver,
nullptr
};
Module st7701_module = {
.name = "st7701",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7701_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver st7735_driver;
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(&st7735_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7735_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7735_drivers[] = {
&st7735_driver,
nullptr
};
Module st7735_module = {
.name = "st7735",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7735_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver st7789_i8080_driver;
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(&st7789_i8080_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7789_i8080_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7789_i8080_drivers[] = {
&st7789_i8080_driver,
nullptr
};
Module st7789_i8080_module = {
.name = "st7789_i8080",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7789_i8080_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver st7789_driver;
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(&st7789_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7789_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7789_drivers[] = {
&st7789_driver,
nullptr
};
Module st7789_module = {
.name = "st7789",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7789_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver st7796_i8080_driver;
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(&st7796_i8080_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7796_i8080_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7796_i8080_drivers[] = {
&st7796_i8080_driver,
nullptr
};
Module st7796_i8080_module = {
.name = "st7796_i8080",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7796_i8080_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver st7796_driver;
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(&st7796_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&st7796_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const st7796_drivers[] = {
&st7796_driver,
nullptr
};
Module st7796_module = {
.name = "st7796",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = st7796_drivers
};
} // extern "C"
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver sy6970_driver;
extern Driver sy6970_power_supply_driver;
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(&sy6970_power_supply_driver) == ERROR_NONE);
check(driver_construct_add(&sy6970_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&sy6970_driver) == ERROR_NONE);
check(driver_remove_destruct(&sy6970_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const sy6970_drivers[] = {
&sy6970_driver,
&sy6970_power_supply_driver,
nullptr
};
Module sy6970_module = {
.name = "sy6970",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = sy6970_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver tca8418_driver;
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(&tca8418_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&tca8418_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const tca8418_drivers[] = {
&tca8418_driver,
nullptr
};
Module tca8418_module = {
.name = "tca8418",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = tca8418_drivers
};
} // extern "C"
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver tca9534_driver;
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(&tca9534_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&tca9534_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const tca9534_drivers[] = {
&tca9534_driver,
nullptr
};
Module tca9534_module = {
.name = "tca9534",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = tca9534_drivers
};
}
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver tca95xx_driver;
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(&tca95xx_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&tca95xx_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const tca95xx_drivers[] = {
&tca95xx_driver,
nullptr
};
Module tca95xx_16bit_module = {
.name = "tca95xx",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = tca95xx_drivers
};
}
+5 -18
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -7,26 +6,14 @@ extern "C" {
extern Driver xl9555_driver;
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(&xl9555_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&xl9555_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const xl9555_drivers[] = {
&xl9555_driver,
nullptr
};
Module xl9555_module = {
.name = "xl9555",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = xl9555_drivers
};
}
+6 -20
View File
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver xpt2046_driver;
extern Driver xpt2046_power_supply_driver;
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(&xpt2046_driver) == ERROR_NONE);
check(driver_construct_add(&xpt2046_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&xpt2046_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&xpt2046_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const xpt2046_drivers[] = {
&xpt2046_driver,
&xpt2046_power_supply_driver,
nullptr
};
Module xpt2046_module = {
.name = "xpt2046",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = xpt2046_drivers
};
} // extern "C"
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/check.h>
#include <tactility/driver.h>
#include <tactility/module.h>
@@ -8,28 +7,15 @@ extern "C" {
extern Driver xpt2046_softspi_driver;
extern Driver xpt2046_softspi_power_supply_driver;
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(&xpt2046_softspi_driver) == ERROR_NONE);
check(driver_construct_add(&xpt2046_softspi_power_supply_driver) == ERROR_NONE);
return ERROR_NONE;
}
static error_t stop() {
/* 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(&xpt2046_softspi_power_supply_driver) == ERROR_NONE);
check(driver_remove_destruct(&xpt2046_softspi_driver) == ERROR_NONE);
return ERROR_NONE;
}
static Driver* const xpt2046_softspi_drivers[] = {
&xpt2046_softspi_driver,
&xpt2046_softspi_power_supply_driver,
nullptr
};
Module xpt2046_softspi_module = {
.name = "xpt2046_softspi",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
.drivers = xpt2046_softspi_drivers
};
} // extern "C"