New kernel drivers and device migrations (#563)
This commit is contained in:
committed by
GitHub
parent
955416dac8
commit
8af6204ba1
@@ -53,6 +53,12 @@ properties:
|
||||
type: int
|
||||
default: 10
|
||||
description: Size of the internal SPI transaction queue
|
||||
gamma-curve:
|
||||
type: int
|
||||
default: 1
|
||||
min: 0
|
||||
max: 3
|
||||
description: Gamma curve preset index [0,3], sent via the MIPI DCS GAMSET (0x26) command at bring-up
|
||||
pin-dc:
|
||||
type: phandles
|
||||
required: true
|
||||
@@ -67,5 +73,5 @@ properties:
|
||||
description: Whether the reset pin is active high
|
||||
backlight:
|
||||
type: phandle
|
||||
default: NULL
|
||||
default: "NULL"
|
||||
description: Optional reference to this display's backlight device
|
||||
|
||||
@@ -24,6 +24,8 @@ struct Ili9341Config {
|
||||
uint32_t bits_per_pixel;
|
||||
uint32_t pixel_clock_hz;
|
||||
uint8_t transaction_queue_depth;
|
||||
// Gamma curve preset index [0,3], sent via the MIPI DCS GAMSET (0x26) command at bring-up.
|
||||
uint8_t gamma_curve;
|
||||
struct GpioPinSpec pin_dc;
|
||||
struct GpioPinSpec pin_reset;
|
||||
bool reset_active_high;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <esp_err.h>
|
||||
#include <esp_lcd_io_spi.h>
|
||||
#include <esp_lcd_panel_commands.h>
|
||||
#include <esp_lcd_panel_io.h>
|
||||
#include <esp_lcd_panel_ops.h>
|
||||
#include <esp_lcd_ili9341.h>
|
||||
@@ -25,6 +26,11 @@
|
||||
|
||||
#define GET_CONFIG(device) (static_cast<const Ili9341Config*>((device)->config))
|
||||
|
||||
// Maps gamma-curve devicetree index [0,3] to the MIPI DCS GAMSET (0x26) parameter value. Mirrors
|
||||
// the deprecated HAL's EspLcdSpiDisplay::setGammaCurve() (Drivers/EspLcdCompat) - note the
|
||||
// non-linear mapping, not index+1.
|
||||
static const uint8_t GAMMA_CURVE_VALUES[4] = { 0x01, 0x04, 0x02, 0x08 };
|
||||
|
||||
struct Ili9341Internal {
|
||||
esp_lcd_panel_io_handle_t io_handle;
|
||||
esp_lcd_panel_handle_t panel_handle;
|
||||
@@ -140,6 +146,7 @@ static error_t start(Device* device) {
|
||||
ok = ok && (!config->swap_xy || esp_lcd_panel_swap_xy(internal->panel_handle, true) == ESP_OK);
|
||||
ok = ok && ((!config->mirror_x && !config->mirror_y) || esp_lcd_panel_mirror(internal->panel_handle, config->mirror_x, config->mirror_y) == ESP_OK);
|
||||
ok = ok && (!config->invert_color || esp_lcd_panel_invert_color(internal->panel_handle, true) == ESP_OK);
|
||||
ok = ok && (config->gamma_curve >= 4 || esp_lcd_panel_io_tx_param(internal->io_handle, LCD_CMD_GAMSET, &GAMMA_CURVE_VALUES[config->gamma_curve], 1) == ESP_OK);
|
||||
ok = ok && esp_lcd_panel_disp_on_off(internal->panel_handle, true) == ESP_OK;
|
||||
|
||||
if (!ok) {
|
||||
|
||||
Reference in New Issue
Block a user