Mercurial > public > ostc4
comparison Common/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_ltdc.h @ 128:c78bcbd5deda FlipDisplay
Added current STM32 standandard libraries in version independend folder structure
author | Ideenmodellierer |
---|---|
date | Sun, 17 Feb 2019 21:12:22 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
127:1369f8660eaa | 128:c78bcbd5deda |
---|---|
1 /** | |
2 ****************************************************************************** | |
3 * @file stm32f4xx_hal_ltdc.h | |
4 * @author MCD Application Team | |
5 * @brief Header file of LTDC HAL module. | |
6 ****************************************************************************** | |
7 * @attention | |
8 * | |
9 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> | |
10 * | |
11 * Redistribution and use in source and binary forms, with or without modification, | |
12 * are permitted provided that the following conditions are met: | |
13 * 1. Redistributions of source code must retain the above copyright notice, | |
14 * this list of conditions and the following disclaimer. | |
15 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
16 * this list of conditions and the following disclaimer in the documentation | |
17 * and/or other materials provided with the distribution. | |
18 * 3. Neither the name of STMicroelectronics nor the names of its contributors | |
19 * may be used to endorse or promote products derived from this software | |
20 * without specific prior written permission. | |
21 * | |
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
32 * | |
33 ****************************************************************************** | |
34 */ | |
35 | |
36 /* Define to prevent recursive inclusion -------------------------------------*/ | |
37 #ifndef __STM32F4xx_HAL_LTDC_H | |
38 #define __STM32F4xx_HAL_LTDC_H | |
39 | |
40 #ifdef __cplusplus | |
41 extern "C" { | |
42 #endif | |
43 | |
44 #if defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx) | |
45 /* Includes ------------------------------------------------------------------*/ | |
46 #include "stm32f4xx_hal_def.h" | |
47 | |
48 /** @addtogroup STM32F4xx_HAL_Driver | |
49 * @{ | |
50 */ | |
51 | |
52 /** @defgroup LTDC LTDC | |
53 * @brief LTDC HAL module driver | |
54 * @{ | |
55 */ | |
56 | |
57 /* Exported types ------------------------------------------------------------*/ | |
58 /** @defgroup LTDC_Exported_Types LTDC Exported Types | |
59 * @{ | |
60 */ | |
61 #define MAX_LAYER 2U | |
62 | |
63 /** | |
64 * @brief LTDC color structure definition | |
65 */ | |
66 typedef struct | |
67 { | |
68 uint8_t Blue; /*!< Configures the blue value. | |
69 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */ | |
70 | |
71 uint8_t Green; /*!< Configures the green value. | |
72 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */ | |
73 | |
74 uint8_t Red; /*!< Configures the red value. | |
75 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */ | |
76 | |
77 uint8_t Reserved; /*!< Reserved 0xFF */ | |
78 } LTDC_ColorTypeDef; | |
79 | |
80 /** | |
81 * @brief LTDC Init structure definition | |
82 */ | |
83 typedef struct | |
84 { | |
85 uint32_t HSPolarity; /*!< configures the horizontal synchronization polarity. | |
86 This parameter can be one value of @ref LTDC_HS_POLARITY */ | |
87 | |
88 uint32_t VSPolarity; /*!< configures the vertical synchronization polarity. | |
89 This parameter can be one value of @ref LTDC_VS_POLARITY */ | |
90 | |
91 uint32_t DEPolarity; /*!< configures the data enable polarity. | |
92 This parameter can be one of value of @ref LTDC_DE_POLARITY */ | |
93 | |
94 uint32_t PCPolarity; /*!< configures the pixel clock polarity. | |
95 This parameter can be one of value of @ref LTDC_PC_POLARITY */ | |
96 | |
97 uint32_t HorizontalSync; /*!< configures the number of Horizontal synchronization width. | |
98 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ | |
99 | |
100 uint32_t VerticalSync; /*!< configures the number of Vertical synchronization height. | |
101 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */ | |
102 | |
103 uint32_t AccumulatedHBP; /*!< configures the accumulated horizontal back porch width. | |
104 This parameter must be a number between Min_Data = LTDC_HorizontalSync and Max_Data = 0xFFF. */ | |
105 | |
106 uint32_t AccumulatedVBP; /*!< configures the accumulated vertical back porch height. | |
107 This parameter must be a number between Min_Data = LTDC_VerticalSync and Max_Data = 0x7FF. */ | |
108 | |
109 uint32_t AccumulatedActiveW; /*!< configures the accumulated active width. | |
110 This parameter must be a number between Min_Data = LTDC_AccumulatedHBP and Max_Data = 0xFFF. */ | |
111 | |
112 uint32_t AccumulatedActiveH; /*!< configures the accumulated active height. | |
113 This parameter must be a number between Min_Data = LTDC_AccumulatedVBP and Max_Data = 0x7FF. */ | |
114 | |
115 uint32_t TotalWidth; /*!< configures the total width. | |
116 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveW and Max_Data = 0xFFF. */ | |
117 | |
118 uint32_t TotalHeigh; /*!< configures the total height. | |
119 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveH and Max_Data = 0x7FF. */ | |
120 | |
121 LTDC_ColorTypeDef Backcolor; /*!< Configures the background color. */ | |
122 } LTDC_InitTypeDef; | |
123 | |
124 /** | |
125 * @brief LTDC Layer structure definition | |
126 */ | |
127 typedef struct | |
128 { | |
129 uint32_t WindowX0; /*!< Configures the Window Horizontal Start Position. | |
130 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ | |
131 | |
132 uint32_t WindowX1; /*!< Configures the Window Horizontal Stop Position. | |
133 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ | |
134 | |
135 uint32_t WindowY0; /*!< Configures the Window vertical Start Position. | |
136 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */ | |
137 | |
138 uint32_t WindowY1; /*!< Configures the Window vertical Stop Position. | |
139 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x7FF. */ | |
140 | |
141 uint32_t PixelFormat; /*!< Specifies the pixel format. | |
142 This parameter can be one of value of @ref LTDC_Pixelformat */ | |
143 | |
144 uint32_t Alpha; /*!< Specifies the constant alpha used for blending. | |
145 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */ | |
146 | |
147 uint32_t Alpha0; /*!< Configures the default alpha value. | |
148 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */ | |
149 | |
150 uint32_t BlendingFactor1; /*!< Select the blending factor 1. | |
151 This parameter can be one of value of @ref LTDC_BlendingFactor1 */ | |
152 | |
153 uint32_t BlendingFactor2; /*!< Select the blending factor 2. | |
154 This parameter can be one of value of @ref LTDC_BlendingFactor2 */ | |
155 | |
156 uint32_t FBStartAdress; /*!< Configures the color frame buffer address */ | |
157 | |
158 uint32_t ImageWidth; /*!< Configures the color frame buffer line length. | |
159 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x1FFF. */ | |
160 | |
161 uint32_t ImageHeight; /*!< Specifies the number of line in frame buffer. | |
162 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */ | |
163 | |
164 LTDC_ColorTypeDef Backcolor; /*!< Configures the layer background color. */ | |
165 } LTDC_LayerCfgTypeDef; | |
166 | |
167 /** | |
168 * @brief HAL LTDC State structures definition | |
169 */ | |
170 typedef enum | |
171 { | |
172 HAL_LTDC_STATE_RESET = 0x00U, /*!< LTDC not yet initialized or disabled */ | |
173 HAL_LTDC_STATE_READY = 0x01U, /*!< LTDC initialized and ready for use */ | |
174 HAL_LTDC_STATE_BUSY = 0x02U, /*!< LTDC internal process is ongoing */ | |
175 HAL_LTDC_STATE_TIMEOUT = 0x03U, /*!< LTDC Timeout state */ | |
176 HAL_LTDC_STATE_ERROR = 0x04U /*!< LTDC state error */ | |
177 }HAL_LTDC_StateTypeDef; | |
178 | |
179 /** | |
180 * @brief LTDC handle Structure definition | |
181 */ | |
182 typedef struct | |
183 { | |
184 LTDC_TypeDef *Instance; /*!< LTDC Register base address */ | |
185 | |
186 LTDC_InitTypeDef Init; /*!< LTDC parameters */ | |
187 | |
188 LTDC_LayerCfgTypeDef LayerCfg[MAX_LAYER]; /*!< LTDC Layers parameters */ | |
189 | |
190 HAL_LockTypeDef Lock; /*!< LTDC Lock */ | |
191 | |
192 __IO HAL_LTDC_StateTypeDef State; /*!< LTDC state */ | |
193 | |
194 __IO uint32_t ErrorCode; /*!< LTDC Error code */ | |
195 | |
196 } LTDC_HandleTypeDef; | |
197 /** | |
198 * @} | |
199 */ | |
200 | |
201 /* Exported constants --------------------------------------------------------*/ | |
202 /** @defgroup LTDC_Exported_Constants LTDC Exported Constants | |
203 * @{ | |
204 */ | |
205 | |
206 /** @defgroup LTDC_Error_Code LTDC Error Code | |
207 * @{ | |
208 */ | |
209 #define HAL_LTDC_ERROR_NONE 0x00000000U /*!< LTDC No error */ | |
210 #define HAL_LTDC_ERROR_TE 0x00000001U /*!< LTDC Transfer error */ | |
211 #define HAL_LTDC_ERROR_FU 0x00000002U /*!< LTDC FIFO Underrun */ | |
212 #define HAL_LTDC_ERROR_TIMEOUT 0x00000020U /*!< LTDC Timeout error */ | |
213 /** | |
214 * @} | |
215 */ | |
216 | |
217 /** @defgroup LTDC_Layer LTDC Layer | |
218 * @{ | |
219 */ | |
220 #define LTDC_LAYER_1 0x00000000U /*!< LTDC Layer 1 */ | |
221 #define LTDC_LAYER_2 0x00000001U /*!< LTDC Layer 2 */ | |
222 /** | |
223 * @} | |
224 */ | |
225 | |
226 /** @defgroup LTDC_HS_POLARITY LTDC HS POLARITY | |
227 * @{ | |
228 */ | |
229 #define LTDC_HSPOLARITY_AL 0x00000000U /*!< Horizontal Synchronization is active low. */ | |
230 #define LTDC_HSPOLARITY_AH LTDC_GCR_HSPOL /*!< Horizontal Synchronization is active high. */ | |
231 /** | |
232 * @} | |
233 */ | |
234 | |
235 /** @defgroup LTDC_VS_POLARITY LTDC VS POLARITY | |
236 * @{ | |
237 */ | |
238 #define LTDC_VSPOLARITY_AL 0x00000000U /*!< Vertical Synchronization is active low. */ | |
239 #define LTDC_VSPOLARITY_AH LTDC_GCR_VSPOL /*!< Vertical Synchronization is active high. */ | |
240 /** | |
241 * @} | |
242 */ | |
243 | |
244 /** @defgroup LTDC_DE_POLARITY LTDC DE POLARITY | |
245 * @{ | |
246 */ | |
247 #define LTDC_DEPOLARITY_AL 0x00000000U /*!< Data Enable, is active low. */ | |
248 #define LTDC_DEPOLARITY_AH LTDC_GCR_DEPOL /*!< Data Enable, is active high. */ | |
249 /** | |
250 * @} | |
251 */ | |
252 | |
253 /** @defgroup LTDC_PC_POLARITY LTDC PC POLARITY | |
254 * @{ | |
255 */ | |
256 #define LTDC_PCPOLARITY_IPC 0x00000000U /*!< input pixel clock. */ | |
257 #define LTDC_PCPOLARITY_IIPC LTDC_GCR_PCPOL /*!< inverted input pixel clock. */ | |
258 /** | |
259 * @} | |
260 */ | |
261 | |
262 /** @defgroup LTDC_SYNC LTDC SYNC | |
263 * @{ | |
264 */ | |
265 #define LTDC_HORIZONTALSYNC (LTDC_SSCR_HSW >> 16U) /*!< Horizontal synchronization width. */ | |
266 #define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization height. */ | |
267 /** | |
268 * @} | |
269 */ | |
270 | |
271 /** @defgroup LTDC_BACK_COLOR LTDC BACK COLOR | |
272 * @{ | |
273 */ | |
274 #define LTDC_COLOR 0x000000FFU /*!< Color mask */ | |
275 /** | |
276 * @} | |
277 */ | |
278 | |
279 /** @defgroup LTDC_BlendingFactor1 LTDC Blending Factor1 | |
280 * @{ | |
281 */ | |
282 #define LTDC_BLENDING_FACTOR1_CA 0x00000400U /*!< Blending factor : Cte Alpha */ | |
283 #define LTDC_BLENDING_FACTOR1_PAxCA 0x00000600U /*!< Blending factor : Cte Alpha x Pixel Alpha*/ | |
284 /** | |
285 * @} | |
286 */ | |
287 | |
288 /** @defgroup LTDC_BlendingFactor2 LTDC Blending Factor2 | |
289 * @{ | |
290 */ | |
291 #define LTDC_BLENDING_FACTOR2_CA 0x00000005U /*!< Blending factor : Cte Alpha */ | |
292 #define LTDC_BLENDING_FACTOR2_PAxCA 0x00000007U /*!< Blending factor : Cte Alpha x Pixel Alpha*/ | |
293 /** | |
294 * @} | |
295 */ | |
296 | |
297 /** @defgroup LTDC_Pixelformat LTDC Pixel format | |
298 * @{ | |
299 */ | |
300 #define LTDC_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */ | |
301 #define LTDC_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */ | |
302 #define LTDC_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */ | |
303 #define LTDC_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */ | |
304 #define LTDC_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */ | |
305 #define LTDC_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */ | |
306 #define LTDC_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */ | |
307 #define LTDC_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */ | |
308 /** | |
309 * @} | |
310 */ | |
311 | |
312 /** @defgroup LTDC_Alpha LTDC Alpha | |
313 * @{ | |
314 */ | |
315 #define LTDC_ALPHA LTDC_LxCACR_CONSTA /*!< LTDC Constant Alpha mask */ | |
316 /** | |
317 * @} | |
318 */ | |
319 | |
320 /** @defgroup LTDC_LAYER_Config LTDC LAYER Config | |
321 * @{ | |
322 */ | |
323 #define LTDC_STOPPOSITION (LTDC_LxWHPCR_WHSPPOS >> 16U) /*!< LTDC Layer stop position */ | |
324 #define LTDC_STARTPOSITION LTDC_LxWHPCR_WHSTPOS /*!< LTDC Layer start position */ | |
325 | |
326 #define LTDC_COLOR_FRAME_BUFFER LTDC_LxCFBLR_CFBLL /*!< LTDC Layer Line length */ | |
327 #define LTDC_LINE_NUMBER LTDC_LxCFBLNR_CFBLNBR /*!< LTDC Layer Line number */ | |
328 /** | |
329 * @} | |
330 */ | |
331 | |
332 /** @defgroup LTDC_Interrupts LTDC Interrupts | |
333 * @{ | |
334 */ | |
335 #define LTDC_IT_LI LTDC_IER_LIE /*!< LTDC Line Interrupt */ | |
336 #define LTDC_IT_FU LTDC_IER_FUIE /*!< LTDC FIFO Underrun Interrupt */ | |
337 #define LTDC_IT_TE LTDC_IER_TERRIE /*!< LTDC Transfer Error Interrupt */ | |
338 #define LTDC_IT_RR LTDC_IER_RRIE /*!< LTDC Register Reload Interrupt */ | |
339 /** | |
340 * @} | |
341 */ | |
342 | |
343 /** @defgroup LTDC_Flags LTDC Flags | |
344 * @{ | |
345 */ | |
346 #define LTDC_FLAG_LI LTDC_ISR_LIF /*!< LTDC Line Interrupt Flag */ | |
347 #define LTDC_FLAG_FU LTDC_ISR_FUIF /*!< LTDC FIFO Underrun interrupt Flag */ | |
348 #define LTDC_FLAG_TE LTDC_ISR_TERRIF /*!< LTDC Transfer Error interrupt Flag */ | |
349 #define LTDC_FLAG_RR LTDC_ISR_RRIF /*!< LTDC Register Reload interrupt Flag */ | |
350 /** | |
351 * @} | |
352 */ | |
353 | |
354 /** @defgroup LTDC_Reload_Type LTDC Reload Type | |
355 * @{ | |
356 */ | |
357 #define LTDC_RELOAD_IMMEDIATE LTDC_SRCR_IMR /*!< Immediate Reload */ | |
358 #define LTDC_RELOAD_VERTICAL_BLANKING LTDC_SRCR_VBR /*!< Vertical Blanking Reload */ | |
359 /** | |
360 * @} | |
361 */ | |
362 | |
363 /** | |
364 * @} | |
365 */ | |
366 | |
367 /* Exported macro ------------------------------------------------------------*/ | |
368 /** @defgroup LTDC_Exported_Macros LTDC Exported Macros | |
369 * @{ | |
370 */ | |
371 | |
372 /** @brief Reset LTDC handle state. | |
373 * @param __HANDLE__ LTDC handle | |
374 * @retval None | |
375 */ | |
376 #define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LTDC_STATE_RESET) | |
377 | |
378 /** | |
379 * @brief Enable the LTDC. | |
380 * @param __HANDLE__ LTDC handle | |
381 * @retval None. | |
382 */ | |
383 #define __HAL_LTDC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR |= LTDC_GCR_LTDCEN) | |
384 | |
385 /** | |
386 * @brief Disable the LTDC. | |
387 * @param __HANDLE__ LTDC handle | |
388 * @retval None. | |
389 */ | |
390 #define __HAL_LTDC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR &= ~(LTDC_GCR_LTDCEN)) | |
391 | |
392 /** | |
393 * @brief Enable the LTDC Layer. | |
394 * @param __HANDLE__ LTDC handle | |
395 * @param __LAYER__ Specify the layer to be enabled. | |
396 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1). | |
397 * @retval None. | |
398 */ | |
399 #define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN) | |
400 | |
401 /** | |
402 * @brief Disable the LTDC Layer. | |
403 * @param __HANDLE__ LTDC handle | |
404 * @param __LAYER__ Specify the layer to be disabled. | |
405 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1). | |
406 * @retval None. | |
407 */ | |
408 #define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN) | |
409 | |
410 /** | |
411 * @brief Reload immediately all LTDC Layers. | |
412 * @param __HANDLE__ LTDC handle | |
413 * @retval None. | |
414 */ | |
415 #define __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_IMR) | |
416 | |
417 /** | |
418 * @brief Reload during vertical blanking period all LTDC Layers. | |
419 * @param __HANDLE__ LTDC handle | |
420 * @retval None. | |
421 */ | |
422 #define __HAL_LTDC_VERTICAL_BLANKING_RELOAD_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_VBR) | |
423 | |
424 /* Interrupt & Flag management */ | |
425 /** | |
426 * @brief Get the LTDC pending flags. | |
427 * @param __HANDLE__ LTDC handle | |
428 * @param __FLAG__ Get the specified flag. | |
429 * This parameter can be any combination of the following values: | |
430 * @arg LTDC_FLAG_LI: Line Interrupt flag | |
431 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag | |
432 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag | |
433 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag | |
434 * @retval The state of FLAG (SET or RESET). | |
435 */ | |
436 #define __HAL_LTDC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__)) | |
437 | |
438 /** | |
439 * @brief Clears the LTDC pending flags. | |
440 * @param __HANDLE__ LTDC handle | |
441 * @param __FLAG__ Specify the flag to clear. | |
442 * This parameter can be any combination of the following values: | |
443 * @arg LTDC_FLAG_LI: Line Interrupt flag | |
444 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag | |
445 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag | |
446 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag | |
447 * @retval None | |
448 */ | |
449 #define __HAL_LTDC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__)) | |
450 | |
451 /** | |
452 * @brief Enables the specified LTDC interrupts. | |
453 * @param __HANDLE__ LTDC handle | |
454 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be enabled. | |
455 * This parameter can be any combination of the following values: | |
456 * @arg LTDC_IT_LI: Line Interrupt flag | |
457 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag | |
458 * @arg LTDC_IT_TE: Transfer Error interrupt flag | |
459 * @arg LTDC_IT_RR: Register Reload Interrupt Flag | |
460 * @retval None | |
461 */ | |
462 #define __HAL_LTDC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__)) | |
463 | |
464 /** | |
465 * @brief Disables the specified LTDC interrupts. | |
466 * @param __HANDLE__ LTDC handle | |
467 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be disabled. | |
468 * This parameter can be any combination of the following values: | |
469 * @arg LTDC_IT_LI: Line Interrupt flag | |
470 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag | |
471 * @arg LTDC_IT_TE: Transfer Error interrupt flag | |
472 * @arg LTDC_IT_RR: Register Reload Interrupt Flag | |
473 * @retval None | |
474 */ | |
475 #define __HAL_LTDC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__)) | |
476 | |
477 /** | |
478 * @brief Check whether the specified LTDC interrupt has occurred or not. | |
479 * @param __HANDLE__ LTDC handle | |
480 * @param __INTERRUPT__ Specify the LTDC interrupt source to check. | |
481 * This parameter can be one of the following values: | |
482 * @arg LTDC_IT_LI: Line Interrupt flag | |
483 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag | |
484 * @arg LTDC_IT_TE: Transfer Error interrupt flag | |
485 * @arg LTDC_IT_RR: Register Reload Interrupt Flag | |
486 * @retval The state of INTERRUPT (SET or RESET). | |
487 */ | |
488 #define __HAL_LTDC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__)) | |
489 /** | |
490 * @} | |
491 */ | |
492 | |
493 /* Include LTDC HAL Extension module */ | |
494 #include "stm32f4xx_hal_ltdc_ex.h" | |
495 | |
496 /* Exported functions --------------------------------------------------------*/ | |
497 /** @addtogroup LTDC_Exported_Functions | |
498 * @{ | |
499 */ | |
500 /** @addtogroup LTDC_Exported_Functions_Group1 | |
501 * @{ | |
502 */ | |
503 /* Initialization and de-initialization functions *****************************/ | |
504 HAL_StatusTypeDef HAL_LTDC_Init(LTDC_HandleTypeDef *hltdc); | |
505 HAL_StatusTypeDef HAL_LTDC_DeInit(LTDC_HandleTypeDef *hltdc); | |
506 void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc); | |
507 void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc); | |
508 void HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef *hltdc); | |
509 void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef *hltdc); | |
510 void HAL_LTDC_ReloadEventCallback(LTDC_HandleTypeDef *hltdc); | |
511 /** | |
512 * @} | |
513 */ | |
514 | |
515 /** @addtogroup LTDC_Exported_Functions_Group2 | |
516 * @{ | |
517 */ | |
518 /* IO operation functions *****************************************************/ | |
519 void HAL_LTDC_IRQHandler(LTDC_HandleTypeDef *hltdc); | |
520 /** | |
521 * @} | |
522 */ | |
523 | |
524 /** @addtogroup LTDC_Exported_Functions_Group3 | |
525 * @{ | |
526 */ | |
527 /* Peripheral Control functions ***********************************************/ | |
528 HAL_StatusTypeDef HAL_LTDC_ConfigLayer(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx); | |
529 HAL_StatusTypeDef HAL_LTDC_SetWindowSize(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx); | |
530 HAL_StatusTypeDef HAL_LTDC_SetWindowPosition(LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx); | |
531 HAL_StatusTypeDef HAL_LTDC_SetPixelFormat(LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx); | |
532 HAL_StatusTypeDef HAL_LTDC_SetAlpha(LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx); | |
533 HAL_StatusTypeDef HAL_LTDC_SetAddress(LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx); | |
534 HAL_StatusTypeDef HAL_LTDC_SetPitch(LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx); | |
535 HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx); | |
536 HAL_StatusTypeDef HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef *hltdc, uint32_t *pCLUT, uint32_t CLUTSize, uint32_t LayerIdx); | |
537 HAL_StatusTypeDef HAL_LTDC_EnableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
538 HAL_StatusTypeDef HAL_LTDC_DisableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
539 HAL_StatusTypeDef HAL_LTDC_EnableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
540 HAL_StatusTypeDef HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
541 HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef *hltdc, uint32_t Line); | |
542 HAL_StatusTypeDef HAL_LTDC_EnableDither(LTDC_HandleTypeDef *hltdc); | |
543 HAL_StatusTypeDef HAL_LTDC_DisableDither(LTDC_HandleTypeDef *hltdc); | |
544 HAL_StatusTypeDef HAL_LTDC_Reload(LTDC_HandleTypeDef *hltdc, uint32_t ReloadType); | |
545 HAL_StatusTypeDef HAL_LTDC_ConfigLayer_NoReload(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx); | |
546 HAL_StatusTypeDef HAL_LTDC_SetWindowSize_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx); | |
547 HAL_StatusTypeDef HAL_LTDC_SetWindowPosition_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx); | |
548 HAL_StatusTypeDef HAL_LTDC_SetPixelFormat_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx); | |
549 HAL_StatusTypeDef HAL_LTDC_SetAlpha_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx); | |
550 HAL_StatusTypeDef HAL_LTDC_SetAddress_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx); | |
551 HAL_StatusTypeDef HAL_LTDC_SetPitch_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx); | |
552 HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx); | |
553 HAL_StatusTypeDef HAL_LTDC_EnableColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
554 HAL_StatusTypeDef HAL_LTDC_DisableColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
555 HAL_StatusTypeDef HAL_LTDC_EnableCLUT_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
556 HAL_StatusTypeDef HAL_LTDC_DisableCLUT_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx); | |
557 | |
558 /** | |
559 * @} | |
560 */ | |
561 | |
562 /** @addtogroup LTDC_Exported_Functions_Group4 | |
563 * @{ | |
564 */ | |
565 /* Peripheral State functions *************************************************/ | |
566 HAL_LTDC_StateTypeDef HAL_LTDC_GetState(LTDC_HandleTypeDef *hltdc); | |
567 uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef *hltdc); | |
568 /** | |
569 * @} | |
570 */ | |
571 | |
572 /** | |
573 * @} | |
574 */ | |
575 | |
576 /* Private types -------------------------------------------------------------*/ | |
577 /* Private variables ---------------------------------------------------------*/ | |
578 /* Private constants ---------------------------------------------------------*/ | |
579 /* Private macros ------------------------------------------------------------*/ | |
580 /** @defgroup LTDC_Private_Macros LTDC Private Macros | |
581 * @{ | |
582 */ | |
583 #define LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)((uint32_t)(((uint32_t)((__HANDLE__)->Instance)) + 0x84U + (0x80U*(__LAYER__))))) | |
584 #define IS_LTDC_LAYER(__LAYER__) ((__LAYER__) < MAX_LAYER) | |
585 #define IS_LTDC_HSPOL(__HSPOL__) (((__HSPOL__) == LTDC_HSPOLARITY_AL) || ((__HSPOL__) == LTDC_HSPOLARITY_AH)) | |
586 #define IS_LTDC_VSPOL(__VSPOL__) (((__VSPOL__) == LTDC_VSPOLARITY_AL) || ((__VSPOL__) == LTDC_VSPOLARITY_AH)) | |
587 #define IS_LTDC_DEPOL(__DEPOL__) (((__DEPOL__) == LTDC_DEPOLARITY_AL) || ((__DEPOL__) == LTDC_DEPOLARITY_AH)) | |
588 #define IS_LTDC_PCPOL(__PCPOL__) (((__PCPOL__) == LTDC_PCPOLARITY_IPC) || ((__PCPOL__) == LTDC_PCPOLARITY_IIPC)) | |
589 #define IS_LTDC_HSYNC(__HSYNC__) ((__HSYNC__) <= LTDC_HORIZONTALSYNC) | |
590 #define IS_LTDC_VSYNC(__VSYNC__) ((__VSYNC__) <= LTDC_VERTICALSYNC) | |
591 #define IS_LTDC_AHBP(__AHBP__) ((__AHBP__) <= LTDC_HORIZONTALSYNC) | |
592 #define IS_LTDC_AVBP(__AVBP__) ((__AVBP__) <= LTDC_VERTICALSYNC) | |
593 #define IS_LTDC_AAW(__AAW__) ((__AAW__) <= LTDC_HORIZONTALSYNC) | |
594 #define IS_LTDC_AAH(__AAH__) ((__AAH__) <= LTDC_VERTICALSYNC) | |
595 #define IS_LTDC_TOTALW(__TOTALW__) ((__TOTALW__) <= LTDC_HORIZONTALSYNC) | |
596 #define IS_LTDC_TOTALH(__TOTALH__) ((__TOTALH__) <= LTDC_VERTICALSYNC) | |
597 #define IS_LTDC_BLUEVALUE(__BBLUE__) ((__BBLUE__) <= LTDC_COLOR) | |
598 #define IS_LTDC_GREENVALUE(__BGREEN__) ((__BGREEN__) <= LTDC_COLOR) | |
599 #define IS_LTDC_REDVALUE(__BRED__) ((__BRED__) <= LTDC_COLOR) | |
600 #define IS_LTDC_BLENDING_FACTOR1(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_CA) || \ | |
601 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_PAxCA)) | |
602 #define IS_LTDC_BLENDING_FACTOR2(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_CA) || \ | |
603 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_PAxCA)) | |
604 #define IS_LTDC_PIXEL_FORMAT(__PIXEL_FORMAT__) (((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB8888) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB888) || \ | |
605 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB565) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB1555) || \ | |
606 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB4444) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_L8) || \ | |
607 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL44) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL88)) | |
608 #define IS_LTDC_ALPHA(__ALPHA__) ((__ALPHA__) <= LTDC_ALPHA) | |
609 #define IS_LTDC_HCONFIGST(__HCONFIGST__) ((__HCONFIGST__) <= LTDC_STARTPOSITION) | |
610 #define IS_LTDC_HCONFIGSP(__HCONFIGSP__) ((__HCONFIGSP__) <= LTDC_STOPPOSITION) | |
611 #define IS_LTDC_VCONFIGST(__VCONFIGST__) ((__VCONFIGST__) <= LTDC_STARTPOSITION) | |
612 #define IS_LTDC_VCONFIGSP(__VCONFIGSP__) ((__VCONFIGSP__) <= LTDC_STOPPOSITION) | |
613 #define IS_LTDC_CFBP(__CFBP__) ((__CFBP__) <= LTDC_COLOR_FRAME_BUFFER) | |
614 #define IS_LTDC_CFBLL(__CFBLL__) ((__CFBLL__) <= LTDC_COLOR_FRAME_BUFFER) | |
615 #define IS_LTDC_CFBLNBR(__CFBLNBR__) ((__CFBLNBR__) <= LTDC_LINE_NUMBER) | |
616 #define IS_LTDC_LIPOS(__LIPOS__) ((__LIPOS__) <= 0x7FFU) | |
617 #define IS_LTDC_RELOAD(__RELOADTYPE__) (((__RELOADTYPE__) == LTDC_RELOAD_IMMEDIATE) || ((__RELOADTYPE__) == LTDC_SRCR_VBR)) | |
618 /** | |
619 * @} | |
620 */ | |
621 | |
622 /* Private functions ---------------------------------------------------------*/ | |
623 /** @defgroup LTDC_Private_Functions LTDC Private Functions | |
624 * @{ | |
625 */ | |
626 | |
627 /** | |
628 * @} | |
629 */ | |
630 | |
631 /** | |
632 * @} | |
633 */ | |
634 | |
635 /** | |
636 * @} | |
637 */ | |
638 | |
639 #endif /* STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ | |
640 | |
641 #ifdef __cplusplus | |
642 } | |
643 #endif | |
644 | |
645 #endif /* __STM32F4xx_HAL_LTDC_H */ | |
646 | |
647 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |