libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
ltdc_common_f47.h
Go to the documentation of this file.
1/** @addtogroup ltdc_defines
2 *
3 * @version 1.0.0
4 *
5 * @author @htmlonly © @endhtmlonly 2014
6 * Oliver Meier <h2obrain@gmail.com>
7 *
8 * @date 5 December 2014
9 *
10 * This library supports the LCD TFT display controller (LTDC) in the STM32F4xx
11 * and STM32F7xx series of ARM Cortex Microcontrollers by ST Microelectronics.
12 *
13 * LGPL License Terms @ref lgpl_license
14 */
15/*
16 * This file is part of the libopencm3 project.
17 *
18 * Copyright (C) 2014 Oliver Meier <h2obrain@gmail.com>
19 *
20 * This library is free software: you can redistribute it and/or modify
21 * it under the terms of the GNU Lesser General Public License as published by
22 * the Free Software Foundation, either version 3 of the License, or
23 * (at your option) any later version.
24 *
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public License
31 * along with this library. If not, see <http://www.gnu.org/licenses/>.
32 */
33
34/**@{*/
35/** @cond */
36#ifndef LIBOPENCM3_STM32_COMMON_LTDC_COMMON_F47_H_
37/** @endcond */
38#define LIBOPENCM3_STM32_COMMON_LTDC_COMMON_F47_H_
39
40
41#include <stdint.h>
43
44/**
45 * LTDC
46 */
47
48
49#define LTDC_SSCR (MMIO32(LTDC_BASE + 0x08))
50#define LTDC_BPCR (MMIO32(LTDC_BASE + 0x0C))
51#define LTDC_AWCR (MMIO32(LTDC_BASE + 0x10))
52#define LTDC_TWCR (MMIO32(LTDC_BASE + 0x14))
53#define LTDC_GCR (MMIO32(LTDC_BASE + 0x18))
54#define LTDC_SRCR (MMIO32(LTDC_BASE + 0x24))
55#define LTDC_BCCR (MMIO32(LTDC_BASE + 0x2C))
56#define LTDC_IER (MMIO32(LTDC_BASE + 0x34))
57#define LTDC_ISR (MMIO32(LTDC_BASE + 0x38))
58#define LTDC_ICR (MMIO32(LTDC_BASE + 0x3C))
59#define LTDC_LIPCR (MMIO32(LTDC_BASE + 0x40))
60#define LTDC_CPSR (MMIO32(LTDC_BASE + 0x44))
61#define LTDC_CDSR (MMIO32(LTDC_BASE + 0x48))
62
63/* x == LTDC_LAYER_x */
64#define LTDC_LxCR(x) (MMIO32(LTDC_BASE + 0x84 + 0x80 * ((x) - 1)))
65#define LTDC_L1CR LTDC_LxCR(LTDC_LAYER_1)
66#define LTDC_L2CR LTDC_LxCR(LTDC_LAYER_2)
67
68#define LTDC_LxWHPCR(x) (MMIO32(LTDC_BASE + 0x88 + 0x80 * ((x) - 1)))
69#define LTDC_L1WHPCR LTDC_LxWHPCR(LTDC_LAYER_1)
70#define LTDC_L2WHPCR LTDC_LxWHPCR(LTDC_LAYER_2)
71
72#define LTDC_LxWVPCR(x) (MMIO32(LTDC_BASE + 0x8C + 0x80 * ((x) - 1)))
73#define LTDC_L1WVPCR LTDC_LxWVPCR(LTDC_LAYER_1)
74#define LTDC_L2WVPCR LTDC_LxWVPCR(LTDC_LAYER_2)
75
76#define LTDC_LxCKCR(x) (MMIO32(LTDC_BASE + 0x90 + 0x80 * ((x) - 1)))
77#define LTDC_L1CKCR LTDC_LxCKCR(LTDC_LAYER_1)
78#define LTDC_L2CKCR LTDC_LxCKCR(LTDC_LAYER_2)
79
80#define LTDC_LxPFCR(x) (MMIO32(LTDC_BASE + 0x94 + 0x80 * ((x) - 1)))
81#define LTDC_L1PFCR LTDC_LxPFCR(LTDC_LAYER_1)
82#define LTDC_L2PFCR LTDC_LxPFCR(LTDC_LAYER_2)
83
84#define LTDC_LxCACR(x) (MMIO32(LTDC_BASE + 0x98 + 0x80 * ((x) - 1)))
85#define LTDC_L1CACR LTDC_LxCACR(LTDC_LAYER_1)
86#define LTDC_L2CACR LTDC_LxCACR(LTDC_LAYER_2)
87
88#define LTDC_LxDCCR(x) (MMIO32(LTDC_BASE + 0x9C + 0x80 * ((x) - 1)))
89#define LTDC_L1DCCR LTDC_LxDCCR(LTDC_LAYER_1)
90#define LTDC_L2DCCR LTDC_LxDCCR(LTDC_LAYER_2)
91
92#define LTDC_LxBFCR(x) (MMIO32(LTDC_BASE + 0xA0 + 0x80 * ((x) - 1)))
93#define LTDC_L1BFCR LTDC_LxBFCR(LTDC_LAYER_1)
94#define LTDC_L2BFCR LTDC_LxBFCR(LTDC_LAYER_2)
95
96#define LTDC_LxCFBAR(x) (MMIO32(LTDC_BASE + 0xAC + 0x80 * ((x) - 1)))
97#define LTDC_L1CFBAR LTDC_LxCFBAR(LTDC_LAYER_1)
98#define LTDC_L2CFBAR LTDC_LxCFBAR(LTDC_LAYER_2)
99
100#define LTDC_LxCFBLR(x) (MMIO32(LTDC_BASE + 0xB0 + 0x80 * ((x) - 1)))
101#define LTDC_L1CFBLR LTDC_LxCFBLR(LTDC_LAYER_1)
102#define LTDC_L2CFBLR LTDC_LxCFBLR(LTDC_LAYER_2)
103
104#define LTDC_LxCFBLNR(x) (MMIO32(LTDC_BASE + 0xB4 + 0x80 * ((x) - 1)))
105#define LTDC_L1CFBLNR LTDC_LxCFBLNR(LTDC_LAYER_1)
106#define LTDC_L2CFBLNR LTDC_LxCFBLNR(LTDC_LAYER_2)
107
108#define LTDC_LxCLUTWR(x) (MMIO32(LTDC_BASE + 0xC4 + 0x80 * ((x) - 1)))
109#define LTDC_L1CLUTWR LTDC_LxCLUTWR(LTDC_LAYER_1)
110#define LTDC_L2CLUTWR LTDC_LxCLUTWR(LTDC_LAYER_2)
111
112/* LTDC layer base addresses (for API parameters) */
113/** @defgroup ltdc_layer_num LTDC Layer Number
114@ingroup STM32F4xx_ltdc_defines
115
116@{*/
117#define LTDC_LAYER_1 1
118#define LTDC_LAYER_2 2
119/**@}*/
120
121
122/* --- LTDC_SSCR values ---------------------------------------------------- */
123
124/* Horizontal Synchronization Width */
125#define LTDC_SSCR_HSW_SHIFT 16
126#define LTDC_SSCR_HSW_MASK 0xfff
127
128/* Vertical Synchronization Height */
129#define LTDC_SSCR_VSH_SHIFT 0
130#define LTDC_SSCR_VSH_MASK 0x7ff
131
132/* --- LTDC_BPCR values ---------------------------------------------------- */
133
134/* Accumulated Horizontal Back Porch */
135#define LTDC_BPCR_AHBP_SHIFT 16
136#define LTDC_BPCR_AHBP_MASK 0xfff
137
138/* Accumulated Vertical Back Porch */
139#define LTDC_BPCR_AVBP_SHIFT 0
140#define LTDC_BPCR_AVBP_MASK 0x7FF
141
142/* --- LTDC_AWCR values ---------------------------------------------------- */
143
144/* Accumulated Active Width */
145#define LTDC_AWCR_AAW_SHIFT 16
146#define LTDC_AWCR_AAW_MASK 0xfff
147
148/* Accumulated Active Height */
149#define LTDC_AWCR_AAH_SHIFT 0
150#define LTDC_AWCR_AAH_MASK 0x7ff
151
152/* --- LTDC_TWCR values ---------------------------------------------------- */
153
154/* Total Width */
155#define LTDC_TWCR_TOTALW_SHIFT 16
156#define LTDC_TWCR_TOTALW_MASK 0xfff
157
158/* Total Height */
159#define LTDC_TWCR_TOTALH_SHIFT 0
160#define LTDC_TWCR_TOTALH_MASK 0x7ff
161
162/* GCR - control register */
163#define LTDC_GCR_LTDC_ENABLE (1<<0)
164#define LTDC_GCR_DITHER_ENABLE (1<<16)
165
166#define LTDC_GCR_PCPOL_ACTIVE_LOW (0<<28)
167#define LTDC_GCR_PCPOL_ACTIVE_HIGH (1<<28)
168
169#define LTDC_GCR_DEPOL_ACTIVE_LOW (0<<29)
170#define LTDC_GCR_DEPOL_ACTIVE_HIGH (1<<29)
171
172#define LTDC_GCR_VSPOL_ACTIVE_LOW (0<<30)
173#define LTDC_GCR_VSPOL_ACTIVE_HIGH (1<<30)
174
175#define LTDC_GCR_HSPOL_ACTIVE_LOW (0<<31)
176#define LTDC_GCR_HSPOL_ACTIVE_HIGH (1<<31)
177
178/* GCR - register bit defines (no semantics) */
179#define LTDC_GCR_HSPOL (1 << 31)
180#define LTDC_GCR_VSPOL (1 << 30)
181#define LTDC_GCR_DEPOL (1 << 29)
182#define LTDC_GCR_PCPOL (1 << 28)
183#define LTDC_GCR_DITHER (1 << 16)
184#define LTDC_GCR_LTDCEN (1 << 0)
185
186/* --- LTDC_SRCR values ---------------------------------------------------- */
187
188/* Vertical Blanking Reload */
189#define LTDC_SRCR_VBR (1 << 1)
190
191/* Immediate Reload */
192#define LTDC_SRCR_IMR (1 << 0)
193
194/* LTDC_BCCR - reload control */
195#define LTDC_SRCR_RELOAD_IMR (1<<0)
196#define LTDC_SRCR_RELOAD_VBR (1<<1)
197
198/* --- LTDC_IER values ----------------------------------------------------- */
199
200/* Register Reload Interrupt Enable */
201#define LTDC_IER_RRIE (1 << 3)
202
203/* Transfer Error Interrupt Enable */
204#define LTDC_IER_TERRIE (1 << 2)
205
206/* FIFO Underrun Interrupt Enable */
207#define LTDC_IER_FUIE (1 << 1)
208
209/* Line Interrupt Enable */
210#define LTDC_IER_LIE (1 << 0)
211
212/* --- LTDC_ISR values ----------------------------------------------------- */
213
214/* Register Reload Interrupt Flag */
215#define LTDC_ISR_RRIF (1 << 3)
216
217/* Transfer Error Interrupt Flag */
218#define LTDC_ISR_TERRIF (1 << 2)
219
220/* FIFO Underrun Interrupt Flag */
221#define LTDC_ISR_FUIF (1 << 1)
222
223/* Line Interrupt Flag */
224#define LTDC_ISR_LIF (1 << 0)
225
226/* --- LTDC_ICR values ----------------------------------------------------- */
227
228/* Clears Register Reload Interrupt Flag */
229#define LTDC_ICR_CRRIF (1 << 3)
230
231/* Clears Transfer Error Interrupt Flag */
232#define LTDC_ICR_CTERRIF (1 << 2)
233
234/* Clears FIFO Underrun Interrupt Flag */
235#define LTDC_ICR_CFUIF (1 << 1)
236
237/* Clears Line Interrupt Flag */
238#define LTDC_ICR_CLIF (1 << 0)
239
240/* --- LTDC_LIPCR values --------------------------------------------------- */
241
242/* Line Interrupt Position */
243#define LTDC_LIPCR_LIPOS_SHIFT 0
244#define LTDC_LIPCR_LIPOS_MASK 0x7ff
245
246/* --- LTDC_CPSR values ---------------------------------------------------- */
247
248/* Current X Position */
249#define LTDC_CPSR_CXPOS_SHIFT 16
250#define LTDC_CPSR_CXPOS_MASK 0xffff
251
252/* Current Y Position */
253#define LTDC_CPSR_CYPOS_SHIFT 0
254#define LTDC_CPSR_CYPOS_MASK 0xffff
255
256/* LTDC_CDSR - display status register */
257#define LTDC_CDSR_VDES (1<<0)
258#define LTDC_CDSR_HDES (1<<1)
259#define LTDC_CDSR_VSYNCS (1<<2)
260#define LTDC_CDSR_HSYNCS (1<<3)
261
262/* LTDC_LxCR - layer control */
263#define LTDC_LxCR_LAYER_ENABLE (1<<0)
264#define LTDC_LxCR_COLKEY_ENABLE (1<<1)
265#define LTDC_LxCR_COLTAB_ENABLE (1<<4)
266
267/* --- LTDC_LxWHPCR values ------------------------------------------------- */
268
269/* Window Horizontal Stop Position */
270#define LTDC_LxWHPCR_WHSPPOS_SHIFT 16
271#define LTDC_LxWHPCR_WHSPPOS_MASK 0xfff
272
273/* Window Horizontal Start Position */
274#define LTDC_LxWHPCR_WHSTPOS_SHIFT 0
275#define LTDC_LxWHPCR_WHSTPOS_MASK 0xfff
276
277/* --- LTDC_LxWVPCR values ------------------------------------------------- */
278
279/* Window Vertical Stop Position */
280#define LTDC_LxWVPCR_WVSPPOS_SHIFT 16
281#define LTDC_LxWVPCR_WVSPPOS_MASK 0x7ff
282
283/* Window Vertical Start Position */
284#define LTDC_LxWVPCR_WVSTPOS_SHIFT 0
285#define LTDC_LxWVPCR_WVSTPOS_MASK 0x7ff
286
287/* --- LTDC_LxCKCR values -------------------------------------------------- */
288
289/* Color Key Red */
290#define LTDC_LxCKCR_CKRED_SHIFT 16
291#define LTDC_LxCKCR_CKRED_MASK 0xff
292
293/* Color Key Green */
294#define LTDC_LxCKCR_CKGREEN_SHIFT 16
295#define LTDC_LxCKCR_CKGREEN_MASK 0xff
296
297/* Color Key Blue */
298#define LTDC_LxCKCR_CKBLUE_SHIFT 16
299#define LTDC_LxCKCR_CKBLUE_MASK 0xff
300
301/* LTDC_LxPFCR - Pixel formats */
302#define LTDC_LxPFCR_ARGB8888 (0b000)
303#define LTDC_LxPFCR_RGB888 (0b001)
304#define LTDC_LxPFCR_RGB565 (0b010)
305#define LTDC_LxPFCR_ARGB1555 (0b011)
306#define LTDC_LxPFCR_ARGB4444 (0b100)
307#define LTDC_LxPFCR_L8 (0b101)
308#define LTDC_LxPFCR_AL44 (0b110)
309#define LTDC_LxPFCR_AL88 (0b111)
310
311/* --- LTDC_LxCACR values -------------------------------------------------- */
312
313/* Constant Alpha */
314#define LTDC_LxCACR_CONSTA_SHIFT 0
315#define LTDC_LxCACR_CONSTA_MASK 0xff
316
317/* --- LTDC_LxDCCR values -------------------------------------------------- */
318
319/* Default Color Alpha */
320#define LTDC_LxDCCR_DCALPHA_SHIFT 24
321#define LTDC_LxDCCR_DCALPHA_MASK 1
322
323/* Default Color Red */
324#define LTDC_LxDCCR_DCRED_SHIFT 16
325#define LTDC_LxDCCR_DCRED_MASK 1
326
327/* Default Color Green */
328#define LTDC_LxDCCR_DCGREEN_SHIFT 8
329#define LTDC_LxDCCR_DCGREEN_MASK 1
330
331/* Default Color Blue */
332#define LTDC_LxDCCR_DCBLUE_SHIFT 0
333#define LTDC_LxDCCR_DCBLUE_MASK 1
334
335/* LTDC_LxBFCR - Blending factors - BF1 */
336#define LTDC_LxBFCR_BF1_CONST_ALPHA (0b100)
337#define LTDC_LxBFCR_BF1_PIXEL_ALPHA_x_CONST_ALPHA (0b110)
338/* LTDC_LxBFCR - Blending factors - BF2 */
339#define LTDC_LxBFCR_BF2_CONST_ALPHA (0b101)
340#define LTDC_LxBFCR_BF2_PIXEL_ALPHA_x_CONST_ALPHA (0b111)
341
342/* --- LTDC_LxCFBAR values ------------------------------------------------- */
343
344/* Color Frame Buffer Start Address */
345#define LTDC_LxCFBAR_CFBAR_SHIFT 0
346#define LTDC_LxCFBAR_CFBAR_MASK 0xffffffff
347
348/* --- LTDC_LxCFBLR values ------------------------------------------------- */
349
350/* Color Frame Buffer Pitch */
351#define LTDC_LxCFBLR_CFBP_SHIFT 16
352#define LTDC_LxCFBLR_CFBP_MASK 0x1fff
353
354/* Color Frame Buffer Line Length */
355#define LTDC_LxCFBLR_CFBLL_SHIFT 0
356#define LTDC_LxCFBLR_CFBLL_MASK 0x1fff
357
358/* --- LTDC_LxCFBLNR values ------------------------------------------------ */
359
360/* Frame Buffer Line Number */
361#define LTDC_LxCFBLNR_CFBLNBR_SHIFT 0
362#define LTDC_LxCFBLNR_CFBLNBR_MASK 0x3ff
363
364/* --- LTDC_LxCLUTWR values ------------------------------------------------ */
365
366/* CLUT Address */
367#define LTDC_LxCLUTWR_CLUTADD_SHIFT 24
368#define LTDC_LxCLUTWR_CLUTADD_MASK 0xff
369
370/* Red */
371#define LTDC_LxCLUTWR_RED_SHIFT 16
372#define LTDC_LxCLUTWR_RED_MASK 0xff
373
374/* Green */
375#define LTDC_LxCLUTWR_GREEN_SHIFT 8
376#define LTDC_LxCLUTWR_GREEN_MASK 0xff
377
378/* Blue */
379#define LTDC_LxCLUTWR_BLUE_SHIFT 0
380#define LTDC_LxCLUTWR_BLUE_MASK 0xff
381
382/**
383 * simple helper macros
384 */
385
386/* global */
387static inline void ltdc_ctrl_enable(uint32_t ctrl_flags)
388{
389 LTDC_GCR |= ctrl_flags;
390}
391
392static inline void ltdc_ctrl_disable(uint32_t ctrl_flags)
393{
394 LTDC_GCR &= ~(ctrl_flags);
395}
396
397static inline void ltdc_reload(uint32_t reload_flags)
398{
399 LTDC_SRCR = reload_flags;
400}
401
402static inline void ltdc_set_background_color(uint8_t r, uint8_t g, uint8_t b)
403{
404 LTDC_BCCR = (((r)&255)<<16) |
405 (((g)&255)<<8) |
406 (((b)&255)<<0);
407}
408
409static inline void ltdc_get_current_position(uint16_t *x, uint16_t *y)
410{
411 uint32_t tmp = LTDC_CPSR;
412 *x = tmp >> 16;
413 *y = tmp &= 0xFFFF;
414}
415
416static inline uint16_t ltdc_get_current_position_x(void)
417{
418 return LTDC_CPSR >> 16;
419}
420
421static inline uint16_t ltdc_get_current_position_y(void)
422{
423 return LTDC_CPSR & 0xffff;
424}
425
426static inline uint32_t ltdc_get_display_status(uint32_t status_flags)
427{
428 return LTDC_CDSR & status_flags;
429}
430
431/* layers */
432static inline void ltdc_layer_ctrl_enable(uint32_t layer, uint32_t ctrl_flags)
433{
434 LTDC_LxCR(layer) |= ctrl_flags;
435}
436
437static inline void ltdc_layer_ctrl_disable(uint32_t layer, uint32_t ctrl_flags)
438{
439 LTDC_LxCR(layer) &= ~(ctrl_flags);
440}
441
442static inline void ltdc_set_color_key(uint32_t layer,
443 uint8_t r, uint8_t g, uint8_t b)
444{
445 LTDC_LxCKCR(layer) = ((((r)&255)<<16) |
446 (((g)&255)<<8) |
447 (((b)&255)<<0));
448}
449
450static inline void ltdc_set_pixel_format(uint32_t layer, uint32_t format)
451{
452 LTDC_LxPFCR(layer) = format;
453}
454
455static inline void ltdc_set_constant_alpha(uint32_t layer, uint8_t alpha)
456{
457 LTDC_LxCACR(layer) = ((alpha)&255);
458}
459
460static inline void ltdc_set_default_colors(uint32_t layer,
461 uint8_t a,
462 uint8_t r, uint8_t g, uint8_t b)
463{
464 LTDC_LxDCCR(layer) = ((((a)&255)<<24) |
465 (((r)&255)<<16) |
466 (((g)&255)<<8) |
467 (((b)&255)<<0));
468}
469
470static inline void ltdc_set_blending_factors(uint32_t layer,
471 uint8_t bf1, uint8_t bf2)
472{
473 LTDC_LxBFCR(layer) = ((bf1)<<8) | ((bf2)<<0);
474}
475
476static inline void ltdc_set_fbuffer_address(uint32_t layer, uint32_t address)
477{
478 LTDC_LxCFBAR(layer) = (uint32_t)address;
479}
480
481static inline uint32_t ltdc_get_fbuffer_address(uint32_t layer)
482{
483 return LTDC_LxCFBAR(layer);
484}
485
486static inline void ltdc_set_fb_line_length(uint32_t layer,
487 uint16_t len, uint16_t pitch)
488{
489 LTDC_LxCFBLR(layer) = ((((pitch)&0x1FFF)<<16) | (((len)&0x1FFF)<<0));
490}
491
492static inline void ltdc_set_fb_line_count(uint32_t layer, uint16_t linecount)
493{
494 LTDC_LxCFBLNR(layer) = (((linecount)&0x3FF)<<0);
495}
496
497/**
498 * more complicated helper functions
499 */
501 uint16_t sync_width, uint16_t sync_height,
502 uint16_t h_back_porch, uint16_t v_back_porch,
503 uint16_t active_width, uint16_t active_height,
504 uint16_t h_front_porch, uint16_t v_front_porch
505);
507 uint8_t layer_number,
508 uint16_t h_back_porch, uint16_t v_back_porch,
509 uint16_t h_sync, uint16_t v_sync,
510 uint16_t width, uint16_t height
511);
512
513
514
515/**
516 * Helper function to wait for SRCR reload to complete or so
517 */
518
519static inline bool LTDC_SRCR_IS_RELOADING(void)
520{
523}
524
525/**
526 * color conversion helper function
527 * (simulate the ltdc color conversion)
528 */
529
530static inline uint32_t ltdc_get_rgb888_from_rgb565(uint16_t rgb565)
531{
532 uint32_t rgb565_32 = (uint32_t)rgb565;
533 return ((((rgb565_32) & 0xF800) >> (11-8))/31)<<16
534 | ((((rgb565_32) & 0x07E0) << (8-5))/63)<<8
535 | ((((rgb565_32) & 0x001F) << (8-0))/31)<<0;
536}
537
538/** @cond */
539#endif /* LIBOPENCM3_STM32_COMMON_LTDC_COMMON_F47_H_ */
540/** @endcond */
541/**@}*/
542
#define LTDC_SRCR_RELOAD_IMR
#define LTDC_LxCFBAR(x)
static void ltdc_set_color_key(uint32_t layer, uint8_t r, uint8_t g, uint8_t b)
static void ltdc_set_constant_alpha(uint32_t layer, uint8_t alpha)
static void ltdc_set_fbuffer_address(uint32_t layer, uint32_t address)
#define LTDC_CPSR
static void ltdc_ctrl_disable(uint32_t ctrl_flags)
static void ltdc_set_default_colors(uint32_t layer, uint8_t a, uint8_t r, uint8_t g, uint8_t b)
#define LTDC_CDSR
static void ltdc_layer_ctrl_disable(uint32_t layer, uint32_t ctrl_flags)
static void ltdc_set_background_color(uint8_t r, uint8_t g, uint8_t b)
#define LTDC_LxDCCR(x)
static uint16_t ltdc_get_current_position_x(void)
static bool LTDC_SRCR_IS_RELOADING(void)
Helper function to wait for SRCR reload to complete or so.
#define LTDC_LxCACR(x)
static uint32_t ltdc_get_display_status(uint32_t status_flags)
static void ltdc_reload(uint32_t reload_flags)
static void ltdc_set_fb_line_count(uint32_t layer, uint16_t linecount)
static void ltdc_set_pixel_format(uint32_t layer, uint32_t format)
#define LTDC_GCR
void ltdc_set_tft_sync_timings(uint16_t sync_width, uint16_t sync_height, uint16_t h_back_porch, uint16_t v_back_porch, uint16_t active_width, uint16_t active_height, uint16_t h_front_porch, uint16_t v_front_porch)
more complicated helper functions
#define LTDC_LxCKCR(x)
#define LTDC_LxCFBLR(x)
static uint32_t ltdc_get_fbuffer_address(uint32_t layer)
#define LTDC_LxCR(x)
#define LTDC_LxBFCR(x)
#define LTDC_LxCFBLNR(x)
static void ltdc_layer_ctrl_enable(uint32_t layer, uint32_t ctrl_flags)
static void ltdc_ctrl_enable(uint32_t ctrl_flags)
simple helper macros
static uint32_t ltdc_get_rgb888_from_rgb565(uint16_t rgb565)
color conversion helper function (simulate the ltdc color conversion)
#define LTDC_LxPFCR(x)
void ltdc_setup_windowing(uint8_t layer_number, uint16_t h_back_porch, uint16_t v_back_porch, uint16_t h_sync, uint16_t v_sync, uint16_t width, uint16_t height)
LTDC Windowing Setup.
#define LTDC_SRCR_RELOAD_VBR
#define LTDC_BCCR
static void ltdc_set_fb_line_length(uint32_t layer, uint16_t len, uint16_t pitch)
static void ltdc_set_blending_factors(uint32_t layer, uint8_t bf1, uint8_t bf2)
static uint16_t ltdc_get_current_position_y(void)
static void ltdc_get_current_position(uint16_t *x, uint16_t *y)
#define LTDC_SRCR