Browse Source

Preventing out-of-range warning with STM32LTDC flag definitions

Joel Bodenmann 3 years ago
parent
commit
9570235ffc
1 changed files with 138 additions and 138 deletions
  1. 138 138
      drivers/gdisp/STM32LTDC/stm32_ltdc.h

+ 138 - 138
drivers/gdisp/STM32LTDC/stm32_ltdc.h

@@ -1,138 +1,138 @@
1
-/*
2
- * This file is subject to the terms of the GFX License. If a copy of
3
- * the license was not distributed with this file, you can obtain one at:
4
- *
5
- *              http://ugfx.org/license.html
6
- */
7
-
8
-#ifndef STM32_LTDC_H
9
-#define STM32_LTDC_H
10
-
11
-// LTDC enable flags
12
-#define LTDC_EF_ENABLE          (1 <<  0)   /**< LTDC enabled.*/
13
-#define LTDC_EF_DITHER          (1 << 16)   /**< Dithering enabled.*/
14
-#define LTDC_EF_PIXCLK_INVERT   (1 << 28)   /**< Inverted pixel clock.*/
15
-#define LTDC_EF_DATAEN_HIGH     (1 << 29)   /**< Active-high data enable.*/
16
-#define LTDC_EF_VSYNC_HIGH      (1 << 30)   /**< Active-high vsync.*/
17
-#define LTDC_EF_HSYNC_HIGH      (1 << 31)   /**< Active-high hsync.*/
18
-
19
-#define LTDC_EF_MASK			(LTDC_EF_ENABLE | LTDC_EF_DITHER | LTDC_EF_PIXCLK_INVERT | LTDC_EF_DATAEN_HIGH | LTDC_EF_VSYNC_HIGH | LTDC_EF_HSYNC_HIGH)
20
-
21
-// LTDC layer enable flags
22
-#define LTDC_LEF_ENABLE         (1 << 0)    /**< Layer enabled*/
23
-#define LTDC_LEF_KEYING         (1 << 1)    /**< Color keying enabled.*/
24
-#define LTDC_LEF_PALETTE        (1 << 4)    /**< Palette enabled.*/
25
-
26
-#define LTDC_LEF_MASK			(LTDC_LEF_ENABLE | LTDC_LEF_KEYING | LTDC_LEF_PALETTE)
27
-
28
-// LTDC pixel formats
29
-#define LTDC_FMT_ARGB8888       0           /**< ARGB-8888 format.*/
30
-#define LTDC_FMT_RGB888         1           /**< RGB-888 format.*/
31
-#define LTDC_FMT_RGB565         2           /**< RGB-565 format.*/
32
-#define LTDC_FMT_ARGB1555       3           /**< ARGB-1555 format.*/
33
-#define LTDC_FMT_ARGB4444       4           /**< ARGB-4444 format.*/
34
-#define LTDC_FMT_L8             5           /**< L-8 format.*/
35
-#define LTDC_FMT_AL44           6           /**< AL-44 format.*/
36
-#define LTDC_FMT_AL88           7           /**< AL-88 format.*/
37
-
38
-// LTDC pixel format aliased raw masks
39
-#define LTDC_XMASK_ARGB8888     0xFFFFFFFF  /**< ARGB-8888 aliased mask.*/
40
-#define LTDC_XMASK_RGB888       0x00FFFFFF  /**< RGB-888 aliased mask.*/
41
-#define LTDC_XMASK_RGB565       0x00F8FCF8  /**< RGB-565 aliased mask.*/
42
-#define LTDC_XMASK_ARGB1555     0x80F8F8F8  /**< ARGB-1555 aliased mask.*/
43
-#define LTDC_XMASK_ARGB4444     0xF0F0F0F0  /**< ARGB-4444 aliased mask.*/
44
-#define LTDC_XMASK_L8           0x000000FF  /**< L-8 aliased mask.*/
45
-#define LTDC_XMASK_AL44         0xF00000F0  /**< AL-44 aliased mask.*/
46
-#define LTDC_XMASK_AL88         0xFF0000FF  /**< AL-88 aliased mask.*/
47
-
48
-// LTDC blending factors
49
-#define LTDC_BLEND_FIX1_FIX2    0x0405      /**<      cnst1; 1 -      cnst2 */
50
-#define LTDC_BLEND_FIX1_MOD2    0x0407      /**<      cnst1; 1 - a2 * cnst2 */
51
-#define LTDC_BLEND_MOD1_FIX2    0x0605      /**< a1 * cnst1; 1 -      cnst2 */
52
-#define LTDC_BLEND_MOD1_MOD2    0x0607      /**< a1 * cnst1; 1 - a2 * cnst2 */
53
-
54
-// LTDC parameter bounds
55
-#define LTDC_MIN_SCREEN_WIDTH           1
56
-#define LTDC_MIN_SCREEN_HEIGHT          1
57
-#define LTDC_MAX_SCREEN_WIDTH           800
58
-#define LTDC_MAX_SCREEN_HEIGHT          600
59
-
60
-#define LTDC_MIN_HSYNC_WIDTH            1
61
-#define LTDC_MIN_VSYNC_HEIGHT           1
62
-#define LTDC_MAX_HSYNC_WIDTH            (1 << 12)
63
-#define LTDC_MAX_VSYNC_HEIGHT           (1 << 11)
64
-
65
-#define LTDC_MIN_HBP_WIDTH              0
66
-#define LTDC_MIN_VBP_HEIGHT             0
67
-#define LTDC_MAX_HBP_WIDTH              (1 << 12)
68
-#define LTDC_MAX_VBP_HEIGHT             (1 << 11)
69
-
70
-#define LTDC_MIN_ACC_HBP_WIDTH          1
71
-#define LTDC_MIN_ACC_VBP_HEIGHT         1
72
-#define LTDC_MAX_ACC_HBP_WIDTH          (1 << 12)
73
-#define LTDC_MAX_ACC_VBP_HEIGHT         (1 << 11)
74
-
75
-#define LTDC_MIN_HFP_WIDTH              0
76
-#define LTDC_MIN_VFP_HEIGHT             0
77
-#define LTDC_MAX_HFP_WIDTH              (1 << 12)
78
-#define LTDC_MAX_VFP_HEIGHT             (1 << 11)
79
-
80
-#define LTDC_MIN_ACTIVE_WIDTH           0
81
-#define LTDC_MIN_ACTIVE_HEIGHT          0
82
-#define LTDC_MAX_ACTIVE_WIDTH           (1 << 12)
83
-#define LTDC_MAX_ACTIVE_HEIGHT          (1 << 11)
84
-
85
-#define LTDC_MIN_ACC_ACTIVE_WIDTH       1
86
-#define LTDC_MIN_ACC_ACTIVE_HEIGHT      1
87
-#define LTDC_MAX_ACC_ACTIVE_WIDTH       (1 << 12)
88
-#define LTDC_MAX_ACC_ACTIVE_HEIGHT      (1 << 11)
89
-
90
-#define LTDC_MIN_ACC_TOTAL_WIDTH        1
91
-#define LTDC_MIN_ACC_TOTAL_HEIGHT       1
92
-#define LTDC_MAX_ACC_TOTAL_WIDTH        (1 << 12)
93
-#define LTDC_MAX_ACC_TOTAL_HEIGHT       (1 << 11)
94
-
95
-#define LTDC_MIN_LINE_INTERRUPT_POS     0
96
-#define LTDC_MAX_LINE_INTERRUPT_POS     ((1 << 11) - 1)
97
-
98
-#define LTDC_MIN_WINDOW_HSTART          0
99
-#define LTDC_MIN_WINDOW_HSTART          0
100
-#define LTDC_MAX_WINDOW_HSTOP           ((1 << 12) - 1)
101
-#define LTDC_MAX_WINDOW_HSTOP           ((1 << 12) - 1)
102
-
103
-#define LTDC_MIN_WINDOW_VSTART          0
104
-#define LTDC_MIN_WINDOW_VSTART          0
105
-#define LTDC_MAX_WINDOW_VSTOP           ((1 << 11) - 1)
106
-#define LTDC_MAX_WINDOW_VSTOP           ((1 << 11) - 1)
107
-
108
-#define LTDC_MIN_FRAME_WIDTH_BYTES      0
109
-#define LTDC_MIN_FRAME_HEIGHT_LINES     0
110
-#define LTDC_MIN_FRAME_PITCH_BYTES      0
111
-#define LTDC_MAX_FRAME_WIDTH_BYTES      ((1 << 13) - 1 - 3)
112
-#define LTDC_MAX_FRAME_HEIGHT_LINES     ((1 << 11) - 1)
113
-#define LTDC_MAX_FRAME_PITCH_BYTES      ((1 << 13) - 1)
114
-
115
-#define LTDC_MIN_PIXFMT_ID              0
116
-#define LTDC_MAX_PIXFMT_ID              7
117
-
118
-#define LTDC_MAX_PALETTE_LENGTH         256
119
-
120
-// LTDC basic ARGB-8888 colors.
121
-#define LTDC_COLOR_BLACK        0xFF000000
122
-#define LTDC_COLOR_MAROON       0xFF800000
123
-#define LTDC_COLOR_GREEN        0xFF008000
124
-#define LTDC_COLOR_OLIVE        0xFF808000
125
-#define LTDC_COLOR_NAVY         0xFF000080
126
-#define LTDC_COLOR_PURPLE       0xFF800080
127
-#define LTDC_COLOR_TEAL         0xFF008080
128
-#define LTDC_COLOR_SILVER       0xFFC0C0C0
129
-#define LTDC_COLOR_GRAY         0xFF808080
130
-#define LTDC_COLOR_RED          0xFFFF0000
131
-#define LTDC_COLOR_LIME         0xFF00FF00
132
-#define LTDC_COLOR_YELLOW       0xFFFFFF00
133
-#define LTDC_COLOR_BLUE         0xFF0000FF
134
-#define LTDC_COLOR_FUCHSIA      0xFFFF00FF
135
-#define LTDC_COLOR_AQUA         0xFF00FFFF
136
-#define LTDC_COLOR_WHITE        0xFFFFFFFF
137
-
138
-#endif /* STM32_LTDC_H */
1
+/*
2
+ * This file is subject to the terms of the GFX License. If a copy of
3
+ * the license was not distributed with this file, you can obtain one at:
4
+ *
5
+ *              http://ugfx.org/license.html
6
+ */
7
+
8
+#ifndef STM32_LTDC_H
9
+#define STM32_LTDC_H
10
+
11
+// LTDC enable flags
12
+#define LTDC_EF_ENABLE          (1U <<  0)   /**< LTDC enabled.*/
13
+#define LTDC_EF_DITHER          (1U << 16)   /**< Dithering enabled.*/
14
+#define LTDC_EF_PIXCLK_INVERT   (1U << 28)   /**< Inverted pixel clock.*/
15
+#define LTDC_EF_DATAEN_HIGH     (1U << 29)   /**< Active-high data enable.*/
16
+#define LTDC_EF_VSYNC_HIGH      (1U << 30)   /**< Active-high vsync.*/
17
+#define LTDC_EF_HSYNC_HIGH      (1U << 31)   /**< Active-high hsync.*/
18
+
19
+#define LTDC_EF_MASK			(LTDC_EF_ENABLE | LTDC_EF_DITHER | LTDC_EF_PIXCLK_INVERT | LTDC_EF_DATAEN_HIGH | LTDC_EF_VSYNC_HIGH | LTDC_EF_HSYNC_HIGH)
20
+
21
+// LTDC layer enable flags
22
+#define LTDC_LEF_ENABLE         (1U << 0)    /**< Layer enabled*/
23
+#define LTDC_LEF_KEYING         (1U << 1)    /**< Color keying enabled.*/
24
+#define LTDC_LEF_PALETTE        (1U << 4)    /**< Palette enabled.*/
25
+
26
+#define LTDC_LEF_MASK			(LTDC_LEF_ENABLE | LTDC_LEF_KEYING | LTDC_LEF_PALETTE)
27
+
28
+// LTDC pixel formats
29
+#define LTDC_FMT_ARGB8888       0           /**< ARGB-8888 format.*/
30
+#define LTDC_FMT_RGB888         1           /**< RGB-888 format.*/
31
+#define LTDC_FMT_RGB565         2           /**< RGB-565 format.*/
32
+#define LTDC_FMT_ARGB1555       3           /**< ARGB-1555 format.*/
33
+#define LTDC_FMT_ARGB4444       4           /**< ARGB-4444 format.*/
34
+#define LTDC_FMT_L8             5           /**< L-8 format.*/
35
+#define LTDC_FMT_AL44           6           /**< AL-44 format.*/
36
+#define LTDC_FMT_AL88           7           /**< AL-88 format.*/
37
+
38
+// LTDC pixel format aliased raw masks
39
+#define LTDC_XMASK_ARGB8888     0xFFFFFFFF  /**< ARGB-8888 aliased mask.*/
40
+#define LTDC_XMASK_RGB888       0x00FFFFFF  /**< RGB-888 aliased mask.*/
41
+#define LTDC_XMASK_RGB565       0x00F8FCF8  /**< RGB-565 aliased mask.*/
42
+#define LTDC_XMASK_ARGB1555     0x80F8F8F8  /**< ARGB-1555 aliased mask.*/
43
+#define LTDC_XMASK_ARGB4444     0xF0F0F0F0  /**< ARGB-4444 aliased mask.*/
44
+#define LTDC_XMASK_L8           0x000000FF  /**< L-8 aliased mask.*/
45
+#define LTDC_XMASK_AL44         0xF00000F0  /**< AL-44 aliased mask.*/
46
+#define LTDC_XMASK_AL88         0xFF0000FF  /**< AL-88 aliased mask.*/
47
+
48
+// LTDC blending factors
49
+#define LTDC_BLEND_FIX1_FIX2    0x0405      /**<      cnst1; 1 -      cnst2 */
50
+#define LTDC_BLEND_FIX1_MOD2    0x0407      /**<      cnst1; 1 - a2 * cnst2 */
51
+#define LTDC_BLEND_MOD1_FIX2    0x0605      /**< a1 * cnst1; 1 -      cnst2 */
52
+#define LTDC_BLEND_MOD1_MOD2    0x0607      /**< a1 * cnst1; 1 - a2 * cnst2 */
53
+
54
+// LTDC parameter bounds
55
+#define LTDC_MIN_SCREEN_WIDTH           1
56
+#define LTDC_MIN_SCREEN_HEIGHT          1
57
+#define LTDC_MAX_SCREEN_WIDTH           800
58
+#define LTDC_MAX_SCREEN_HEIGHT          600
59
+
60
+#define LTDC_MIN_HSYNC_WIDTH            1
61
+#define LTDC_MIN_VSYNC_HEIGHT           1
62
+#define LTDC_MAX_HSYNC_WIDTH            (1U << 12)
63
+#define LTDC_MAX_VSYNC_HEIGHT           (1U << 11)
64
+
65
+#define LTDC_MIN_HBP_WIDTH              0
66
+#define LTDC_MIN_VBP_HEIGHT             0
67
+#define LTDC_MAX_HBP_WIDTH              (1U << 12)
68
+#define LTDC_MAX_VBP_HEIGHT             (1U << 11)
69
+
70
+#define LTDC_MIN_ACC_HBP_WIDTH          1
71
+#define LTDC_MIN_ACC_VBP_HEIGHT         1
72
+#define LTDC_MAX_ACC_HBP_WIDTH          (1U << 12)
73
+#define LTDC_MAX_ACC_VBP_HEIGHT         (1U << 11)
74
+
75
+#define LTDC_MIN_HFP_WIDTH              0
76
+#define LTDC_MIN_VFP_HEIGHT             0
77
+#define LTDC_MAX_HFP_WIDTH              (1U << 12)
78
+#define LTDC_MAX_VFP_HEIGHT             (1U << 11)
79
+
80
+#define LTDC_MIN_ACTIVE_WIDTH           0
81
+#define LTDC_MIN_ACTIVE_HEIGHT          0
82
+#define LTDC_MAX_ACTIVE_WIDTH           (1U << 12)
83
+#define LTDC_MAX_ACTIVE_HEIGHT          (1U << 11)
84
+
85
+#define LTDC_MIN_ACC_ACTIVE_WIDTH       1
86
+#define LTDC_MIN_ACC_ACTIVE_HEIGHT      1
87
+#define LTDC_MAX_ACC_ACTIVE_WIDTH       (1U << 12)
88
+#define LTDC_MAX_ACC_ACTIVE_HEIGHT      (1U << 11)
89
+
90
+#define LTDC_MIN_ACC_TOTAL_WIDTH        1
91
+#define LTDC_MIN_ACC_TOTAL_HEIGHT       1
92
+#define LTDC_MAX_ACC_TOTAL_WIDTH        (1U << 12)
93
+#define LTDC_MAX_ACC_TOTAL_HEIGHT       (1U << 11)
94
+
95
+#define LTDC_MIN_LINE_INTERRUPT_POS     0
96
+#define LTDC_MAX_LINE_INTERRUPT_POS     ((1U << 11) - 1)
97
+
98
+#define LTDC_MIN_WINDOW_HSTART          0
99
+#define LTDC_MIN_WINDOW_HSTART          0
100
+#define LTDC_MAX_WINDOW_HSTOP           ((1U << 12) - 1)
101
+#define LTDC_MAX_WINDOW_HSTOP           ((1U << 12) - 1)
102
+
103
+#define LTDC_MIN_WINDOW_VSTART          0
104
+#define LTDC_MIN_WINDOW_VSTART          0
105
+#define LTDC_MAX_WINDOW_VSTOP           ((1U << 11) - 1)
106
+#define LTDC_MAX_WINDOW_VSTOP           ((1U << 11) - 1)
107
+
108
+#define LTDC_MIN_FRAME_WIDTH_BYTES      0
109
+#define LTDC_MIN_FRAME_HEIGHT_LINES     0
110
+#define LTDC_MIN_FRAME_PITCH_BYTES      0
111
+#define LTDC_MAX_FRAME_WIDTH_BYTES      ((1U << 13) - 1 - 3)
112
+#define LTDC_MAX_FRAME_HEIGHT_LINES     ((1U << 11) - 1)
113
+#define LTDC_MAX_FRAME_PITCH_BYTES      ((1U << 13) - 1)
114
+
115
+#define LTDC_MIN_PIXFMT_ID              0
116
+#define LTDC_MAX_PIXFMT_ID              7
117
+
118
+#define LTDC_MAX_PALETTE_LENGTH         256
119
+
120
+// LTDC basic ARGB-8888 colors.
121
+#define LTDC_COLOR_BLACK        0xFF000000
122
+#define LTDC_COLOR_MAROON       0xFF800000
123
+#define LTDC_COLOR_GREEN        0xFF008000
124
+#define LTDC_COLOR_OLIVE        0xFF808000
125
+#define LTDC_COLOR_NAVY         0xFF000080
126
+#define LTDC_COLOR_PURPLE       0xFF800080
127
+#define LTDC_COLOR_TEAL         0xFF008080
128
+#define LTDC_COLOR_SILVER       0xFFC0C0C0
129
+#define LTDC_COLOR_GRAY         0xFF808080
130
+#define LTDC_COLOR_RED          0xFFFF0000
131
+#define LTDC_COLOR_LIME         0xFF00FF00
132
+#define LTDC_COLOR_YELLOW       0xFFFFFF00
133
+#define LTDC_COLOR_BLUE         0xFF0000FF
134
+#define LTDC_COLOR_FUCHSIA      0xFFFF00FF
135
+#define LTDC_COLOR_AQUA         0xFF00FFFF
136
+#define LTDC_COLOR_WHITE        0xFFFFFFFF
137
+
138
+#endif /* STM32_LTDC_H */