Device migrations, driver migrations and more (#575)
This commit is contained in:
committed by
GitHub
parent
2d768ef3a1
commit
2fbc44466a
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <drivers/st7123.h>
|
||||
|
||||
// The devicetree compiler derives the expected config typedef name from the compatible
|
||||
// string's suffix (e.g. "sitronix,st7123" -> st7123_config_dt), not from the node name or
|
||||
// driver name, so the tag here must match that exactly.
|
||||
DEFINE_DEVICETREE(st7123, struct St7123Config)
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <drivers/st7123_touch.h>
|
||||
|
||||
// The devicetree compiler derives the expected config typedef name from the compatible
|
||||
// string's suffix, with hyphens replaced by underscores (e.g. "sitronix,st7123-touch" ->
|
||||
// st7123_touch_config_dt), not from the node name or driver name, so the tag here must match
|
||||
// that exactly.
|
||||
DEFINE_DEVICETREE(st7123_touch, struct St7123TouchConfig)
|
||||
@@ -0,0 +1,69 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
|
||||
struct St7123Config {
|
||||
uint16_t horizontal_resolution;
|
||||
uint16_t vertical_resolution;
|
||||
uint8_t bits_per_pixel;
|
||||
bool bgr_order;
|
||||
bool invert_color;
|
||||
bool mirror_x;
|
||||
bool mirror_y;
|
||||
|
||||
// Reset pin for the panel. GPIO_PIN_SPEC_NONE falls back to a software reset sent over the
|
||||
// DBI command interface (see esp_lcd_st7123's panel_st7123_reset()).
|
||||
struct GpioPinSpec pin_reset;
|
||||
bool reset_active_high;
|
||||
|
||||
// LDO channel powering the MIPI DSI PHY - the PHY has no power of its own until this is
|
||||
// acquired, so it must happen before the DSI bus is created. Both fields are int32_t (not
|
||||
// uint32_t) to exactly match esp_ldo_channel_config_t's plain `int` fields - assigning a
|
||||
// uint32_t into that struct's brace-init would be a narrowing conversion (-Werror=narrowing).
|
||||
int32_t ldo_channel;
|
||||
int32_t ldo_voltage_mv;
|
||||
|
||||
uint8_t dsi_bus_id;
|
||||
// Number of MIPI DSI data lanes. 0 falls back to the maximum available.
|
||||
uint8_t num_data_lanes;
|
||||
uint32_t lane_bit_rate_mbps;
|
||||
|
||||
uint32_t dpi_clock_freq_mhz;
|
||||
uint32_t hsync_pulse_width;
|
||||
uint32_t hsync_back_porch;
|
||||
uint32_t hsync_front_porch;
|
||||
uint32_t vsync_pulse_width;
|
||||
uint32_t vsync_back_porch;
|
||||
uint32_t vsync_front_porch;
|
||||
// Number of screen-sized frame buffers the driver allocates (0 or 1 = single-buffered).
|
||||
uint8_t num_fbs;
|
||||
bool use_dma2d;
|
||||
bool disable_lp;
|
||||
|
||||
// See the 'allow-tearing' binding property.
|
||||
bool allow_tearing;
|
||||
|
||||
// Custom vendor init sequence, flattened as bytes: a run of
|
||||
// [cmd, data_len, delay_ms, data_len bytes of data...] entries. NULL/0 falls back to the
|
||||
// ST7123 component's own built-in default sequence (see vendor_specific_init_default in
|
||||
// esp_lcd_st7123.c) - not guaranteed to match any particular panel's actual bring-up
|
||||
// requirements.
|
||||
const uint8_t* init_sequence;
|
||||
uint32_t init_sequence_length;
|
||||
|
||||
// Optional reference to this display's backlight device, NULL if none.
|
||||
struct Device* backlight;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <tactility/drivers/gpio.h>
|
||||
|
||||
struct St7123TouchConfig {
|
||||
// Devicetree address hint. esp_lcd_touch_st7123 always talks to the controller's one fixed
|
||||
// address (0x55 - see ESP_LCD_TOUCH_IO_I2C_ST7123_ADDRESS), so this isn't actually used to
|
||||
// probe the bus - it just documents the wiring like any other i2c-device node.
|
||||
uint8_t address;
|
||||
uint16_t x_max;
|
||||
uint16_t y_max;
|
||||
bool swap_xy;
|
||||
bool mirror_x;
|
||||
bool mirror_y;
|
||||
// Reset is wired through the board's IO expander rather than a direct SoC GPIO on every
|
||||
// known user of this driver so far, hence GPIO_PIN_SPEC_NONE by default - but exposed here
|
||||
// for parity with the other touch drivers (e.g. gt911-module) in case a board wires it directly.
|
||||
struct GpioPinSpec pin_reset;
|
||||
struct GpioPinSpec pin_interrupt;
|
||||
bool reset_active_high;
|
||||
bool interrupt_active_high;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/module.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern struct Module st7123_module;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user