display-dma2d  1.0.6
display-dma2d
drawing_dma2d.h
Go to the documentation of this file.
1 /*
2  * C
3  *
4  * Copyright 2019-2020 MicroEJ Corp. All rights reserved.
5  * This library is provided in source code for use, modification and test, subject to license terms.
6  * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
7  */
8 
9 #ifndef DRAWING_DMA2D_H
10 #define DRAWING_DMA2D_H
11 
34 #ifdef __cplusplus
35  extern "C" {
36 #endif
37 
38 /* Includes ------------------------------------------------------------------*/
39 
40 #include <stdint.h>
41 #include "LLUI_DISPLAY_IMPL.h"
42 
43 #ifdef STM32F4XX
44 #include "stm32f4xx_hal.h"
45 #endif
46 
47 #ifdef STM32F7XX
48 #include "stm32f7xx_hal.h"
49 #endif
50 
51 #include "sni.h"
52 
53 /* Structs -------------------------------------------------------------------*/
54 
55 /*
56  * @brief Feature "memcpy" data. Function "DRAWING_DMA2D_configure_memcpy()" fills
57  * it with given arguments. In a second time, this structure must be given to
58  * "DRAWING_DMA2D_start_memcpy()".
59  */
60 typedef struct
61 {
62  uint8_t* src_address;
63  uint8_t* dest_address;
64  uint16_t width;
65  uint16_t height;
67 
68 /* API -----------------------------------------------------------------------*/
69 
70 /*
71  * @brief Initializes this library.
72  *
73  * @param[in] binary_semaphore_handle a binary semaphore. It must initialized in such
74  * case the semaphore must first be 'given' before it can be 'taken'.
75  */
76 void DRAWING_DMA2D_initialize(void* binary_semaphore_handle);
77 
78 /*
79  * @brief STM32 HAL DMA2D implementation. DMA2D IRQ handler must call this function.
80  * This function calls STM32 HAL DMA2D "HAL_DMA2D_IRQHandler()" function. Then it
81  * calls the LLUI_DISPLAY "LLUI_DISPLAY_notifyAsynchronousDrawingEnd" or "LLUI_DISPLAY_flushDone"
82  * callbacks to notify the graphical engine about current status.
83  */
84 void DRAWING_DMA2D_IRQHandler(void);
85 
86 /*
87  * @brief Configures the copy from frame buffer to back buffer just after a flush.
88  *
89  * @param[in] srcAddr the address of the buffer to copy.
90  * @param[in] destAddr the address of the destination buffer.
91  * @param[in] xmin the top-left X coordinate of rectangle to copy.
92  * @param[in] ymin the top-left Y coordinate of rectangle to copy.
93  * @param[in] xmax the bottom-right X coordinate of rectangle to copy.
94  * @param[in] ymax the bottom-right Y coordinate of rectangle to copy.
95  * @param[in] stride the buffer row stride in pixels (usually equals to buffer width)
96  * @param[in] memcpy_data the internal representation of memcpy to perform.
97  */
98 void DRAWING_DMA2D_configure_memcpy(uint8_t* srcAddr, uint8_t* destAddr, uint32_t xmin, uint32_t ymin, uint32_t xmax, uint32_t ymax, uint32_t stride, DRAWING_DMA2D_memcpy* memcpy_data);
99 
100 /*
101  * @brief Starts the copy previously configured by a call to "DRAWING_DMA2D_configure_memcpy()".
102  *
103  * @param[in] memcpy_data the internal representation of memcpy to perform.
104  */
105 void DRAWING_DMA2D_start_memcpy(DRAWING_DMA2D_memcpy* memcyp_data);
106 
107 /* EOF -----------------------------------------------------------------------*/
108 
109 #ifdef __cplusplus
110  }
111 #endif
112 
113 #endif // DRAWING_DMA2D_H
114