Skip to content

Commit d79e743

Browse files
committed
Merge branch 'fix/move_spi_lcd_cb_fun_to_iram_v5.4' into 'release/v5.4'
feat(spi_lcd): move callback function to iram (v5.4) See merge request espressif/esp-idf!36739
2 parents 724f762 + a05a125 commit d79e743

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/esp_lcd/spi/esp_lcd_panel_io_spi.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -17,6 +17,7 @@
1717
#include "esp_lcd_panel_io.h"
1818
#include "driver/spi_master.h"
1919
#include "driver/gpio.h"
20+
#include "hal/gpio_ll.h"
2021
#include "esp_log.h"
2122
#include "esp_check.h"
2223
#include "esp_lcd_common.h"
@@ -404,12 +405,13 @@ static esp_err_t panel_io_spi_tx_color(esp_lcd_panel_io_t *io, int lcd_cmd, cons
404405
return ret;
405406
}
406407

407-
static void lcd_spi_pre_trans_cb(spi_transaction_t *trans)
408+
IRAM_ATTR static void lcd_spi_pre_trans_cb(spi_transaction_t *trans)
408409
{
409410
esp_lcd_panel_io_spi_t *spi_panel_io = trans->user;
410411
lcd_spi_trans_descriptor_t *lcd_trans = __containerof(trans, lcd_spi_trans_descriptor_t, base);
411412
if (spi_panel_io->dc_gpio_num >= 0) { // set D/C line level if necessary
412-
gpio_set_level(spi_panel_io->dc_gpio_num, lcd_trans->flags.dc_gpio_level);
413+
// use ll function to speed up
414+
gpio_ll_set_level(&GPIO, spi_panel_io->dc_gpio_num, lcd_trans->flags.dc_gpio_level);
413415
}
414416
}
415417

0 commit comments

Comments
 (0)