mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 05:04:33 +02:00
spi_lcd: support CS active high
Closes https://github.com/espressif/esp-idf/issues/9881
This commit is contained in:
@@ -117,6 +117,7 @@ typedef struct {
|
|||||||
unsigned int dc_low_on_data: 1; /*!< If this flag is enabled, DC line = 0 means transfer data, DC line = 1 means transfer command; vice versa */
|
unsigned int dc_low_on_data: 1; /*!< If this flag is enabled, DC line = 0 means transfer data, DC line = 1 means transfer command; vice versa */
|
||||||
unsigned int octal_mode: 1; /*!< transmit with octal mode (8 data lines), this mode is used to simulate Intel 8080 timing */
|
unsigned int octal_mode: 1; /*!< transmit with octal mode (8 data lines), this mode is used to simulate Intel 8080 timing */
|
||||||
unsigned int lsb_first: 1; /*!< transmit LSB bit first */
|
unsigned int lsb_first: 1; /*!< transmit LSB bit first */
|
||||||
|
unsigned int cs_high_active: 1; /*!< CS line is high active */
|
||||||
} flags; /*!< Extra flags to fine-tune the SPI device */
|
} flags; /*!< Extra flags to fine-tune the SPI device */
|
||||||
} esp_lcd_panel_io_spi_config_t;
|
} esp_lcd_panel_io_spi_config_t;
|
||||||
|
|
||||||
|
@@ -73,7 +73,9 @@ esp_err_t esp_lcd_new_panel_io_spi(esp_lcd_spi_bus_handle_t bus, const esp_lcd_p
|
|||||||
ESP_GOTO_ON_FALSE(spi_panel_io, ESP_ERR_NO_MEM, err, TAG, "no mem for spi panel io");
|
ESP_GOTO_ON_FALSE(spi_panel_io, ESP_ERR_NO_MEM, err, TAG, "no mem for spi panel io");
|
||||||
|
|
||||||
spi_device_interface_config_t devcfg = {
|
spi_device_interface_config_t devcfg = {
|
||||||
.flags = SPI_DEVICE_HALFDUPLEX | (io_config->flags.lsb_first ? SPI_DEVICE_TXBIT_LSBFIRST : 0),
|
.flags = SPI_DEVICE_HALFDUPLEX |
|
||||||
|
(io_config->flags.lsb_first ? SPI_DEVICE_TXBIT_LSBFIRST : 0) |
|
||||||
|
(io_config->flags.cs_high_active ? SPI_DEVICE_POSITIVE_CS : 0),
|
||||||
.clock_speed_hz = io_config->pclk_hz,
|
.clock_speed_hz = io_config->pclk_hz,
|
||||||
.mode = io_config->spi_mode,
|
.mode = io_config->spi_mode,
|
||||||
.spics_io_num = io_config->cs_gpio_num,
|
.spics_io_num = io_config->cs_gpio_num,
|
||||||
|
Reference in New Issue
Block a user