Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/display/lcd/esp_lcd_sh8601/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.0"
version: "1.0.1"
description: ESP LCD SH8601(SPI & QSPI)
url: https://github.com/espressif/esp-iot-solution/tree/master/components/display/lcd/esp_lcd_sh8601
repository: https://github.com/espressif/esp-iot-solution.git
Expand Down
16 changes: 12 additions & 4 deletions components/display/lcd/esp_lcd_sh8601/include/esp_lcd_sh8601.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include <stdint.h>

#include "esp_idf_version.h"
#include "esp_lcd_panel_vendor.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -76,6 +76,7 @@ esp_err_t esp_lcd_new_panel_sh8601(const esp_lcd_panel_io_handle_t io, const esp
.data2_io_num = d2, \
.data3_io_num = d3, \
.max_transfer_sz = max_trans_sz, \
.flags = SPICOMMON_BUSFLAG_MASTER | SPICOMMON_BUSFLAG_QUAD, \
}

/**
Expand Down Expand Up @@ -105,11 +106,18 @@ esp_err_t esp_lcd_new_panel_sh8601(const esp_lcd_panel_io_handle_t io, const esp
.user_ctx = cb_ctx, \
.lcd_cmd_bits = 32, \
.lcd_param_bits = 8, \
.flags = { \
.quad_mode = true, \
}, \
/* Only set flags.quad_mode for ESP-IDF < v6.0.0 */ \
_IF_IDF_LESS_THAN_6(.flags = { .quad_mode = true },) \
}

#ifndef _IF_IDF_LESS_THAN_6
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
#define _IF_IDF_LESS_THAN_6(...) __VA_ARGS__
#else
#define _IF_IDF_LESS_THAN_6(...)
#endif
#endif

#ifdef __cplusplus
}
#endif