New kernel drivers and device migrations (#563)
This commit is contained in:
committed by
GitHub
parent
955416dac8
commit
8af6204ba1
@@ -6,7 +6,7 @@ idf_component_register(
|
||||
SRCS ${SOURCES}
|
||||
INCLUDE_DIRS "include/"
|
||||
PRIV_INCLUDE_DIRS "private/"
|
||||
REQUIRES TactilityKernel driver esp_adc esp_driver_i2c vfs fatfs esp_wifi esp_netif esp_event
|
||||
REQUIRES TactilityKernel driver esp_adc esp_driver_i2c esp_lcd vfs fatfs esp_wifi esp_netif esp_event
|
||||
)
|
||||
|
||||
if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
description: >
|
||||
Simple GPIO-driven on/off backlight, for panels whose backlight is a single digital
|
||||
enable pin rather than a PWM-dimmable one. Brightness is treated as boolean: any
|
||||
value greater than 0 turns the backlight on, 0 turns it off.
|
||||
|
||||
compatible: "espressif,esp32-gpio-backlight"
|
||||
|
||||
properties:
|
||||
pin-backlight:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Backlight enable output pin
|
||||
default-on:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Whether the backlight is turned on by set_brightness_default()
|
||||
@@ -0,0 +1,64 @@
|
||||
description: ESP32 i8080 (8080-series parallel) LCD bus controller
|
||||
|
||||
include: ["i8080-controller.yaml"]
|
||||
|
||||
compatible: "espressif,esp32-i8080"
|
||||
|
||||
properties:
|
||||
pin-dc:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data/Command GPIO pin
|
||||
pin-wr:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Write-strobe GPIO pin
|
||||
pin-rd:
|
||||
type: phandles
|
||||
default: GPIO_PIN_SPEC_NONE
|
||||
description: Read-strobe GPIO pin. Optional - driven high once and left alone if provided, since this bus only ever writes.
|
||||
pin-d0:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 0 GPIO pin
|
||||
pin-d1:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 1 GPIO pin
|
||||
pin-d2:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 2 GPIO pin
|
||||
pin-d3:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 3 GPIO pin
|
||||
pin-d4:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 4 GPIO pin
|
||||
pin-d5:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 5 GPIO pin
|
||||
pin-d6:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 6 GPIO pin
|
||||
pin-d7:
|
||||
type: phandles
|
||||
required: true
|
||||
description: Data bus bit 7 GPIO pin
|
||||
max-transfer-bytes:
|
||||
type: int
|
||||
required: true
|
||||
description: |
|
||||
Maximum size in bytes of a single transfer over this bus. Sized for the attached
|
||||
panel's buffer (e.g. horizontal-resolution * vertical-resolution / N * bytes-per-pixel
|
||||
for an N-th sized partial buffer) - there is no bus-level default since it's entirely
|
||||
dependent on what's attached.
|
||||
cs-gpios:
|
||||
type: phandle-array
|
||||
element-type: "struct GpioPinSpec"
|
||||
default: "{ }"
|
||||
description: Null-terminated array of chip select GPIO pin specs for peripherals on this bus
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_gpio_backlight.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICETREE(esp32_gpio_backlight, struct Esp32GpioBacklightConfig)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_i8080.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICETREE(esp32_i8080, struct Esp32I8080Config)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/drivers/backlight.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Esp32GpioBacklightConfig {
|
||||
struct GpioPinSpec pin_backlight;
|
||||
bool default_on;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <soc/soc_caps.h>
|
||||
#if SOC_LCD_I80_SUPPORTED
|
||||
|
||||
#include <tactility/drivers/i8080_controller.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
|
||||
#include <esp_lcd_io_i80.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Esp32I8080Config {
|
||||
struct GpioPinSpec pin_dc;
|
||||
struct GpioPinSpec pin_wr;
|
||||
struct GpioPinSpec pin_rd;
|
||||
struct GpioPinSpec pin_d0;
|
||||
struct GpioPinSpec pin_d1;
|
||||
struct GpioPinSpec pin_d2;
|
||||
struct GpioPinSpec pin_d3;
|
||||
struct GpioPinSpec pin_d4;
|
||||
struct GpioPinSpec pin_d5;
|
||||
struct GpioPinSpec pin_d6;
|
||||
struct GpioPinSpec pin_d7;
|
||||
int max_transfer_bytes;
|
||||
/** Array of chip select GPIO pin specs */
|
||||
struct GpioPinSpec* cs_gpios;
|
||||
/** The item count of cs_gpios */
|
||||
uint8_t cs_gpios_count;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get the CS pin spec for a child device on this i8080 bus.
|
||||
* Uses the child device's address as index into the parent's cs_gpios array.
|
||||
* @param[in] child_device a child device of an i8080 controller
|
||||
* @param[out] out_pin the GPIO pin spec for the CS pin
|
||||
* @retval ERROR_NONE on success
|
||||
* @retval ERROR_INVALID_STATE if the parent is not an i8080 controller
|
||||
* @retval ERROR_OUT_OF_RANGE if the device address exceeds the cs_gpios array
|
||||
*/
|
||||
error_t esp32_i8080_get_cs_pin(struct Device* child_device, struct GpioPinSpec* out_pin);
|
||||
|
||||
/**
|
||||
* @brief Get the i80 bus handle for a child device's i8080 controller parent.
|
||||
* Only valid after the controller device has started.
|
||||
* @param[in] child_device a child device of an i8080 controller
|
||||
* @param[out] out_handle the bus handle
|
||||
* @retval ERROR_NONE on success
|
||||
* @retval ERROR_INVALID_STATE if the parent is not an i8080 controller, or hasn't started
|
||||
*/
|
||||
error_t esp32_i8080_get_bus_handle(struct Device* child_device, esp_lcd_i80_bus_handle_t* out_handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SOC_LCD_I80_SUPPORTED
|
||||
@@ -0,0 +1,119 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <tactility/drivers/esp32_gpio_backlight.h>
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/backlight.h>
|
||||
#include <tactility/drivers/gpio_controller.h>
|
||||
#include <tactility/drivers/gpio_descriptor.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#define TAG "Esp32GpioBacklight"
|
||||
#define GET_CONFIG(device) (static_cast<const Esp32GpioBacklightConfig*>((device)->config))
|
||||
|
||||
struct Esp32GpioBacklightInternal {
|
||||
GpioDescriptor* descriptor;
|
||||
uint8_t brightness;
|
||||
};
|
||||
|
||||
// region Driver lifecycle
|
||||
|
||||
static error_t start(Device* device) {
|
||||
const auto* config = GET_CONFIG(device);
|
||||
|
||||
auto* descriptor = gpio_descriptor_acquire(config->pin_backlight.gpio_controller, config->pin_backlight.pin, GPIO_OWNER_GPIO);
|
||||
if (descriptor == nullptr) {
|
||||
LOG_E(TAG, "Failed to acquire GPIO descriptor");
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
|
||||
if (gpio_descriptor_set_flags(descriptor, config->pin_backlight.flags | GPIO_FLAG_DIRECTION_OUTPUT) != ERROR_NONE) {
|
||||
LOG_E(TAG, "Failed to configure backlight pin as output");
|
||||
gpio_descriptor_release(descriptor);
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
|
||||
auto* internal = static_cast<Esp32GpioBacklightInternal*>(malloc(sizeof(Esp32GpioBacklightInternal)));
|
||||
if (internal == nullptr) {
|
||||
gpio_descriptor_release(descriptor);
|
||||
return ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
internal->descriptor = descriptor;
|
||||
internal->brightness = 0;
|
||||
|
||||
device_set_driver_data(device, internal);
|
||||
|
||||
backlight_set_brightness_default(device); // Allowed to fail, we don't care about the result
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop(Device* device) {
|
||||
backlight_set_brightness(device, 0); // Allowed to fail, we don't care about the result
|
||||
|
||||
auto* internal = static_cast<Esp32GpioBacklightInternal*>(device_get_driver_data(device));
|
||||
gpio_descriptor_release(internal->descriptor);
|
||||
free(internal);
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region BacklightApi
|
||||
|
||||
static error_t esp32_gpio_backlight_set_brightness(Device* device, uint8_t brightness) {
|
||||
auto* internal = static_cast<Esp32GpioBacklightInternal*>(device_get_driver_data(device));
|
||||
|
||||
error_t error = gpio_descriptor_set_level(internal->descriptor, brightness > 0);
|
||||
if (error != ERROR_NONE) {
|
||||
LOG_E(TAG, "Failed to set backlight level");
|
||||
return error;
|
||||
}
|
||||
|
||||
internal->brightness = brightness;
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t esp32_gpio_backlight_set_brightness_default(Device* device) {
|
||||
return esp32_gpio_backlight_set_brightness(device, GET_CONFIG(device)->default_on ? 1 : 0);
|
||||
}
|
||||
|
||||
static error_t esp32_gpio_backlight_get_brightness(Device* device, uint8_t* out_brightness) {
|
||||
auto* internal = static_cast<Esp32GpioBacklightInternal*>(device_get_driver_data(device));
|
||||
*out_brightness = internal->brightness;
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static uint8_t esp32_gpio_backlight_get_min_brightness(Device*) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t esp32_gpio_backlight_get_max_brightness(Device*) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
static const BacklightApi esp32_gpio_backlight_api = {
|
||||
.set_brightness = esp32_gpio_backlight_set_brightness,
|
||||
.set_brightness_default = esp32_gpio_backlight_set_brightness_default,
|
||||
.get_brightness = esp32_gpio_backlight_get_brightness,
|
||||
.get_min_brightness = esp32_gpio_backlight_get_min_brightness,
|
||||
.get_max_brightness = esp32_gpio_backlight_get_max_brightness,
|
||||
};
|
||||
|
||||
extern Module platform_esp32_module;
|
||||
|
||||
Driver esp32_gpio_backlight_driver = {
|
||||
.name = "esp32_gpio_backlight",
|
||||
.compatible = (const char*[]) { "espressif,esp32-gpio-backlight", nullptr },
|
||||
.start_device = start,
|
||||
.stop_device = stop,
|
||||
.api = &esp32_gpio_backlight_api,
|
||||
.device_type = &BACKLIGHT_TYPE,
|
||||
.owner = &platform_esp32_module,
|
||||
.internal = nullptr
|
||||
};
|
||||
@@ -0,0 +1,192 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <soc/soc_caps.h>
|
||||
#if SOC_LCD_I80_SUPPORTED
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/esp32_i8080.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include "tactility/drivers/gpio_descriptor.h"
|
||||
#include <tactility/drivers/esp32_gpio_helpers.h>
|
||||
#include <tactility/drivers/gpio_controller.h>
|
||||
|
||||
#include <esp_lcd_panel_io.h>
|
||||
|
||||
#include <new>
|
||||
#include <vector>
|
||||
|
||||
#define TAG "esp32_i8080"
|
||||
|
||||
#define GET_CONFIG(device) ((const struct Esp32I8080Config*)device->config)
|
||||
#define GET_DATA(device) ((struct Esp32I8080Internal*)device_get_driver_data(device))
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct Esp32I8080Internal {
|
||||
esp_lcd_i80_bus_handle_t bus_handle = nullptr;
|
||||
|
||||
GpioDescriptor* dc_descriptor = nullptr;
|
||||
GpioDescriptor* wr_descriptor = nullptr;
|
||||
GpioDescriptor* rd_descriptor = nullptr;
|
||||
GpioDescriptor* d0_descriptor = nullptr;
|
||||
GpioDescriptor* d1_descriptor = nullptr;
|
||||
GpioDescriptor* d2_descriptor = nullptr;
|
||||
GpioDescriptor* d3_descriptor = nullptr;
|
||||
GpioDescriptor* d4_descriptor = nullptr;
|
||||
GpioDescriptor* d5_descriptor = nullptr;
|
||||
GpioDescriptor* d6_descriptor = nullptr;
|
||||
GpioDescriptor* d7_descriptor = nullptr;
|
||||
|
||||
std::vector<GpioDescriptor*> cs_descriptors;
|
||||
|
||||
void cleanup_pins() {
|
||||
release_pin(&dc_descriptor);
|
||||
release_pin(&wr_descriptor);
|
||||
release_pin(&rd_descriptor);
|
||||
release_pin(&d0_descriptor);
|
||||
release_pin(&d1_descriptor);
|
||||
release_pin(&d2_descriptor);
|
||||
release_pin(&d3_descriptor);
|
||||
release_pin(&d4_descriptor);
|
||||
release_pin(&d5_descriptor);
|
||||
release_pin(&d6_descriptor);
|
||||
release_pin(&d7_descriptor);
|
||||
for (auto*& desc : cs_descriptors) {
|
||||
release_pin(&desc);
|
||||
}
|
||||
cs_descriptors.clear();
|
||||
}
|
||||
};
|
||||
|
||||
static error_t start(Device* device) {
|
||||
LOG_I(TAG, "start %s", device->name);
|
||||
auto* data = new (std::nothrow) Esp32I8080Internal();
|
||||
if (data == nullptr) return ERROR_OUT_OF_MEMORY;
|
||||
|
||||
device_set_driver_data(device, data);
|
||||
|
||||
const auto* config = GET_CONFIG(device);
|
||||
|
||||
bool pins_ok =
|
||||
acquire_pin_or_set_null(config->pin_dc, &data->dc_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_wr, &data->wr_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_rd, &data->rd_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d0, &data->d0_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d1, &data->d1_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d2, &data->d2_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d3, &data->d3_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d4, &data->d4_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d5, &data->d5_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d6, &data->d6_descriptor) &&
|
||||
acquire_pin_or_set_null(config->pin_d7, &data->d7_descriptor);
|
||||
|
||||
if (!pins_ok) {
|
||||
LOG_E(TAG, "Failed to acquire required i8080 pins");
|
||||
data->cleanup_pins();
|
||||
device_set_driver_data(device, nullptr);
|
||||
delete data;
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
|
||||
// RD is never toggled by the i80 LCD peripheral (write-only bus); drive it high once so the
|
||||
// panel doesn't see spurious read strobes.
|
||||
if (data->rd_descriptor != nullptr) {
|
||||
gpio_descriptor_set_flags(data->rd_descriptor, GPIO_FLAG_DIRECTION_OUTPUT);
|
||||
gpio_descriptor_set_level(data->rd_descriptor, true);
|
||||
}
|
||||
|
||||
esp_lcd_i80_bus_config_t bus_cfg = {
|
||||
.dc_gpio_num = get_native_pin(data->dc_descriptor),
|
||||
.wr_gpio_num = get_native_pin(data->wr_descriptor),
|
||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
||||
.data_gpio_nums = {
|
||||
get_native_pin(data->d0_descriptor),
|
||||
get_native_pin(data->d1_descriptor),
|
||||
get_native_pin(data->d2_descriptor),
|
||||
get_native_pin(data->d3_descriptor),
|
||||
get_native_pin(data->d4_descriptor),
|
||||
get_native_pin(data->d5_descriptor),
|
||||
get_native_pin(data->d6_descriptor),
|
||||
get_native_pin(data->d7_descriptor),
|
||||
},
|
||||
.bus_width = 8,
|
||||
.max_transfer_bytes = static_cast<size_t>(config->max_transfer_bytes),
|
||||
.psram_trans_align = 64,
|
||||
.sram_trans_align = 4
|
||||
};
|
||||
|
||||
esp_err_t ret = esp_lcd_new_i80_bus(&bus_cfg, &data->bus_handle);
|
||||
if (ret != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to create I80 bus: %s", esp_err_to_name(ret));
|
||||
data->cleanup_pins();
|
||||
device_set_driver_data(device, nullptr);
|
||||
delete data;
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
|
||||
// Acquire and deselect all CS pins (drive high)
|
||||
for (uint8_t i = 0; i < config->cs_gpios_count; i++) {
|
||||
const GpioPinSpec* cs = &config->cs_gpios[i];
|
||||
if (cs->gpio_controller == nullptr) continue;
|
||||
GpioDescriptor* desc = gpio_descriptor_acquire(cs->gpio_controller, cs->pin, GPIO_OWNER_GPIO);
|
||||
if (desc != nullptr) {
|
||||
gpio_descriptor_set_flags(desc, GPIO_FLAG_DIRECTION_OUTPUT);
|
||||
gpio_descriptor_set_level(desc, true);
|
||||
data->cs_descriptors.push_back(desc);
|
||||
} else {
|
||||
LOG_E(TAG, "Failed to acquire CS pin %u", i);
|
||||
}
|
||||
}
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop(Device* device) {
|
||||
LOG_I(TAG, "stop %s", device->name);
|
||||
auto* data = GET_DATA(device);
|
||||
|
||||
if (data->bus_handle != nullptr) {
|
||||
esp_lcd_del_i80_bus(data->bus_handle);
|
||||
}
|
||||
|
||||
data->cleanup_pins();
|
||||
device_set_driver_data(device, nullptr);
|
||||
delete data;
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
error_t esp32_i8080_get_cs_pin(Device* child_device, GpioPinSpec* out_pin) {
|
||||
auto* parent = device_get_parent(child_device);
|
||||
if (parent == nullptr || device_get_type(parent) != &I8080_CONTROLLER_TYPE) return ERROR_INVALID_STATE;
|
||||
const auto* config = GET_CONFIG(parent);
|
||||
int32_t index = child_device->address;
|
||||
if (index < 0 || index >= config->cs_gpios_count) return ERROR_OUT_OF_RANGE;
|
||||
*out_pin = config->cs_gpios[index];
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
error_t esp32_i8080_get_bus_handle(Device* child_device, esp_lcd_i80_bus_handle_t* out_handle) {
|
||||
auto* parent = device_get_parent(child_device);
|
||||
if (parent == nullptr || device_get_type(parent) != &I8080_CONTROLLER_TYPE) return ERROR_INVALID_STATE;
|
||||
auto* data = GET_DATA(parent);
|
||||
if (data == nullptr || data->bus_handle == nullptr) return ERROR_INVALID_STATE;
|
||||
*out_handle = data->bus_handle;
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
extern struct Module platform_esp32_module;
|
||||
|
||||
Driver esp32_i8080_driver = {
|
||||
.name = "esp32_i8080",
|
||||
.compatible = (const char*[]) { "espressif,esp32-i8080", nullptr },
|
||||
.start_device = start,
|
||||
.stop_device = stop,
|
||||
.api = nullptr,
|
||||
.device_type = &I8080_CONTROLLER_TYPE,
|
||||
.owner = &platform_esp32_module,
|
||||
.internal = nullptr
|
||||
};
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#endif // SOC_LCD_I80_SUPPORTED
|
||||
@@ -16,6 +16,10 @@ extern Driver esp32_gpio_driver;
|
||||
extern Driver esp32_i2c_driver;
|
||||
extern Driver esp32_i2c_master_driver;
|
||||
extern Driver esp32_i2s_driver;
|
||||
#if SOC_LCD_I80_SUPPORTED
|
||||
extern Driver esp32_i8080_driver;
|
||||
#endif
|
||||
extern Driver esp32_gpio_backlight_driver;
|
||||
extern Driver esp32_ledc_backlight_driver;
|
||||
#if SOC_SDMMC_HOST_SUPPORTED
|
||||
extern Driver esp32_sdmmc_driver;
|
||||
@@ -49,6 +53,10 @@ static error_t start() {
|
||||
check(driver_construct_add(&esp32_i2c_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&esp32_i2c_master_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&esp32_i2s_driver) == ERROR_NONE);
|
||||
#if SOC_LCD_I80_SUPPORTED
|
||||
check(driver_construct_add(&esp32_i8080_driver) == ERROR_NONE);
|
||||
#endif
|
||||
check(driver_construct_add(&esp32_gpio_backlight_driver) == ERROR_NONE);
|
||||
check(driver_construct_add(&esp32_ledc_backlight_driver) == ERROR_NONE);
|
||||
#if SOC_SDMMC_HOST_SUPPORTED
|
||||
check(driver_construct_add(&esp32_sdmmc_driver) == ERROR_NONE);
|
||||
@@ -100,7 +108,11 @@ static error_t stop() {
|
||||
check(driver_remove_destruct(&esp32_i2c_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&esp32_i2c_master_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&esp32_i2s_driver) == ERROR_NONE);
|
||||
#if SOC_LCD_I80_SUPPORTED
|
||||
check(driver_remove_destruct(&esp32_i8080_driver) == ERROR_NONE);
|
||||
#endif
|
||||
check(driver_remove_destruct(&esp32_ledc_backlight_driver) == ERROR_NONE);
|
||||
check(driver_remove_destruct(&esp32_gpio_backlight_driver) == ERROR_NONE);
|
||||
#if SOC_SDMMC_HOST_SUPPORTED
|
||||
check(driver_remove_destruct(&esp32_sdmmc_driver) == ERROR_NONE);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user