|
19 | 19 | #include "esp_lcd_panel_ops.h"
|
20 | 20 | #include "esp_lcd_panel_interface.h"
|
21 | 21 | #include "esp_lcd_panel_rgb.h"
|
| 22 | + #include "esp_private/gdma.h" |
| 23 | + #include "esp_private/gdma_link.h" |
22 | 24 |
|
23 | 25 | #include "freertos/FreeRTOS.h"
|
24 | 26 | #include "freertos/task.h"
|
|
31 | 33 | #include "py/obj.h"
|
32 | 34 | #include "py/objarray.h"
|
33 | 35 |
|
| 36 | + |
| 37 | + #if CONFIG_IDF_TARGET_ESP32S3 |
| 38 | + #define RGB_LCD_BUS_NEEDS_SEPARATE_RESTART_LINK 1 |
| 39 | + #endif |
| 40 | + |
34 | 41 | typedef struct {
|
35 | 42 | esp_lcd_panel_t base; // Base class of generic lcd panel
|
36 | 43 | int panel_id; // LCD panel ID
|
|
39 | 46 | size_t fb_bits_per_pixel; // Frame buffer color depth, in bpp
|
40 | 47 | size_t num_fbs; // Number of frame buffers
|
41 | 48 | size_t output_bits_per_pixel; // Color depth seen from the output data line. Default to fb_bits_per_pixel, but can be changed by YUV-RGB conversion
|
42 |
| - size_t sram_trans_align; // Alignment for framebuffer that allocated in SRAM |
43 |
| - size_t psram_trans_align; // Alignment for framebuffer that allocated in PSRAM |
| 49 | + size_t dma_burst_size; // DMA transfer burst size |
44 | 50 | int disp_gpio_num; // Display control GPIO, which is used to perform action like "disp_off"
|
45 | 51 | intr_handle_t intr; // LCD peripheral interrupt handle
|
46 | 52 | esp_pm_lock_handle_t pm_lock; // Power management lock
|
47 | 53 | size_t num_dma_nodes; // Number of DMA descriptors that used to carry the frame buffer
|
| 54 | + gdma_channel_handle_t dma_chan; // DMA channel handle |
| 55 | + gdma_link_list_handle_t dma_fb_links[RGB_LCD_PANEL_MAX_FB_NUM]; // DMA link lists for multiple frame buffers |
| 56 | + gdma_link_list_handle_t dma_bb_link; // DMA link list for bounce buffer |
| 57 | + #if RGB_LCD_BUS_NEEDS_SEPARATE_RESTART_LINK |
| 58 | + gdma_link_list_handle_t dma_restart_link; // DMA link list for restarting the DMA |
| 59 | + #endif |
48 | 60 | uint8_t *fbs[3]; // Frame buffers
|
| 61 | + uint8_t *bounce_buffer[2]; // Pointer to the bounce buffers |
| 62 | + size_t fb_size; // Size of frame buffer, in bytes |
| 63 | + size_t bb_size; // Size of the bounce buffer, in bytes. If not-zero, the driver uses two bounce buffers allocated from internal memory |
49 | 64 | uint8_t cur_fb_index; // Current frame buffer index
|
50 |
| - uint8_t bb_fb_index; // Current frame buffer index which used by bounce buffer |
51 | 65 | } rgb_panel_t;
|
52 | 66 |
|
53 | 67 | typedef struct _rgb_bus_lock_t {
|
|
0 commit comments