File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -413,13 +413,22 @@ IRAM_ATTR static void lcd_spi_pre_trans_cb(spi_transaction_t *trans)
413413 if (spi_panel_io -> dc_gpio_num >= 0 ) { // set D/C line level if necessary
414414 // use ll function to speed up
415415 gpio_ll_set_level (& GPIO , spi_panel_io -> dc_gpio_num , lcd_trans -> flags .dc_gpio_level );
416+
417+ // ensure the D/C output is enabled
418+ gpio_ll_output_enable (& GPIO , spi_panel_io -> dc_gpio_num );
416419 }
417420}
418421
419422static void lcd_spi_post_trans_color_cb (spi_transaction_t * trans )
420423{
421424 esp_lcd_panel_io_spi_t * spi_panel_io = trans -> user ;
422425 lcd_spi_trans_descriptor_t * lcd_trans = __containerof (trans , lcd_spi_trans_descriptor_t , base );
426+
427+ // disable the D/C output as we no longer need it
428+ if (spi_panel_io -> dc_gpio_num >= 0 ) {
429+ gpio_ll_output_disable (& GPIO , spi_panel_io -> dc_gpio_num );
430+ }
431+
423432 if (lcd_trans -> flags .en_trans_done_cb ) {
424433 if (spi_panel_io -> on_color_trans_done ) {
425434 spi_panel_io -> on_color_trans_done (& spi_panel_io -> base , NULL , spi_panel_io -> user_ctx );
You can’t perform that action at this time.
0 commit comments