1 /** 2 * @file lv_gpu_stm32_dma2d.h 3 * 4 */ 5 6 #ifndef LV_GPU_STM32_DMA2D_H 7 #define LV_GPU_STM32_DMA2D_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #include "../../misc/lv_color.h" 14 #include "../../hal/lv_hal_disp.h" 15 #include "../sw/lv_draw_sw.h" 16 17 #if LV_USE_GPU_STM32_DMA2D 18 19 /********************* 20 * INCLUDES 21 *********************/ 22 #include LV_GPU_DMA2D_CMSIS_INCLUDE 23 24 /********************* 25 * DEFINES 26 *********************/ 27 #if defined(LV_STM32_DMA2D_TEST) 28 // removes "static" modifier for some internal methods in order to test them 29 #define LV_STM32_DMA2D_STATIC 30 #else 31 #define LV_STM32_DMA2D_STATIC static 32 #endif 33 34 #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) 35 #define LV_STM32_DMA2D_USE_M7_CACHE 36 #endif 37 38 /********************** 39 * TYPEDEFS 40 **********************/ 41 enum dma2d_color_format { 42 ARGB8888 = 0x0, 43 RGB888 = 0x01, 44 RGB565 = 0x02, 45 ARGB1555 = 0x03, 46 ARGB4444 = 0x04, 47 A8 = 0x09, 48 UNSUPPORTED = 0xff, 49 }; 50 typedef enum dma2d_color_format dma2d_color_format_t; 51 typedef lv_draw_sw_ctx_t lv_draw_stm32_dma2d_ctx_t; 52 struct _lv_disp_drv_t; 53 54 /********************** 55 * GLOBAL PROTOTYPES 56 **********************/ 57 void lv_draw_stm32_dma2d_init(void); 58 void lv_draw_stm32_dma2d_ctx_init(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); 59 void lv_draw_stm32_dma2d_ctx_deinit(struct _lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx); 60 void _lv_draw_stm32_dma2d_copy_buffer(const lv_color_t * dest_buf, lv_coord_t dest_stride, 61 const lv_area_t * draw_area, const lv_color_t * src_buf, lv_coord_t src_stride, const lv_point_t * src_offset); 62 63 #if defined (LV_STM32_DMA2D_USE_M7_CACHE) 64 void _lv_gpu_stm32_dma2d_invalidate_cache(uint32_t address, lv_coord_t offset, 65 lv_coord_t width, lv_coord_t height, uint8_t pixel_size); 66 void _lv_gpu_stm32_dma2d_clean_cache(uint32_t address, lv_coord_t offset, lv_coord_t width, 67 lv_coord_t height, uint8_t pixel_size); 68 #endif 69 70 71 /********************** 72 * MACROS 73 **********************/ 74 75 #endif /*LV_USE_GPU_STM32_DMA2D*/ 76 77 #ifdef __cplusplus 78 } /*extern "C"*/ 79 #endif 80 81 #endif /*LV_GPU_STM32_DMA2D_H*/ 82