Skip to content

Commit 4d5a7c9

Browse files
committed
Merge branch 'fix/move_spi_lcd_cb_fun_to_iram_v5.3' into 'release/v5.3'
feat(spi_lcd): move callback function to iram (v5.3) See merge request espressif/esp-idf!36740
2 parents 1de6022 + f6bbf60 commit 4d5a7c9

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"
@@ -400,12 +401,13 @@ static esp_err_t panel_io_spi_tx_color(esp_lcd_panel_io_t *io, int lcd_cmd, cons
400401
return ret;
401402
}
402403

403-
static void lcd_spi_pre_trans_cb(spi_transaction_t *trans)
404+
IRAM_ATTR static void lcd_spi_pre_trans_cb(spi_transaction_t *trans)
404405
{
405406
esp_lcd_panel_io_spi_t *spi_panel_io = trans->user;
406407
lcd_spi_trans_descriptor_t *lcd_trans = __containerof(trans, lcd_spi_trans_descriptor_t, base);
407408
if (spi_panel_io->dc_gpio_num >= 0) { // set D/C line level if necessary
408-
gpio_set_level(spi_panel_io->dc_gpio_num, lcd_trans->flags.dc_gpio_level);
409+
// use ll function to speed up
410+
gpio_ll_set_level(&GPIO, spi_panel_io->dc_gpio_num, lcd_trans->flags.dc_gpio_level);
409411
}
410412
}
411413

0 commit comments

Comments
 (0)