1 /*!
2     \file    gd32f4xx_tli.h
3     \brief   definitions for the TLI
4 
5     \version 2016-08-15, V1.0.0, firmware for GD32F4xx
6     \version 2018-12-12, V2.0.0, firmware for GD32F4xx
7     \version 2020-09-30, V2.1.0, firmware for GD32F4xx
8     \version 2022-03-09, V3.0.0, firmware for GD32F4xx
9 */
10 
11 /*
12     Copyright (c) 2022, GigaDevice Semiconductor Inc.
13 
14     Redistribution and use in source and binary forms, with or without modification,
15 are permitted provided that the following conditions are met:
16 
17     1. Redistributions of source code must retain the above copyright notice, this
18        list of conditions and the following disclaimer.
19     2. Redistributions in binary form must reproduce the above copyright notice,
20        this list of conditions and the following disclaimer in the documentation
21        and/or other materials provided with the distribution.
22     3. Neither the name of the copyright holder nor the names of its contributors
23        may be used to endorse or promote products derived from this software without
24        specific prior written permission.
25 
26     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35 OF SUCH DAMAGE.
36 */
37 
38 #ifndef GD32F4XX_TLI_H
39 #define GD32F4XX_TLI_H
40 
41 #include "gd32f4xx.h"
42 
43 /* TLI definitions */
44 #define TLI                               TLI_BASE                          /*!< TLI base address */
45 /* TLI layer definitions */
46 #define LAYER0                            TLI_BASE                          /*!< TLI layer0 base address */
47 #define LAYER1                            (TLI_BASE + 0x00000080U)          /*!< TLI layer1 base address */
48 
49 /* registers definitions */
50 #define TLI_SPSZ                          REG32(TLI + 0x00000008U)          /*!< TLI synchronous pulse size register */
51 #define TLI_BPSZ                          REG32(TLI + 0x0000000CU)          /*!< TLI back-porch size register */
52 #define TLI_ASZ                           REG32(TLI + 0x00000010U)          /*!< TLI active size register */
53 #define TLI_TSZ                           REG32(TLI + 0x00000014U)          /*!< TLI total size register */
54 #define TLI_CTL                           REG32(TLI + 0x00000018U)          /*!< TLI control register */
55 #define TLI_RL                            REG32(TLI + 0x00000024U)          /*!< TLI reload Layer register */
56 #define TLI_BGC                           REG32(TLI + 0x0000002CU)          /*!< TLI background color register */
57 #define TLI_INTEN                         REG32(TLI + 0x00000034U)          /*!< TLI interrupt enable register */
58 #define TLI_INTF                          REG32(TLI + 0x00000038U)          /*!< TLI interrupt flag register */
59 #define TLI_INTC                          REG32(TLI + 0x0000003CU)          /*!< TLI interrupt flag clear register */
60 #define TLI_LM                            REG32(TLI + 0x00000040U)          /*!< TLI line mark register */
61 #define TLI_CPPOS                         REG32(TLI + 0x00000044U)          /*!< TLI current pixel position register */
62 #define TLI_STAT                          REG32(TLI + 0x00000048U)          /*!< TLI status register */
63 #define TLI_LxCTL(layerx)                 REG32((layerx) + 0x00000084U)     /*!< TLI layer x control register */
64 #define TLI_LxHPOS(layerx)                REG32((layerx) + 0x00000088U)     /*!< TLI layer x horizontal position parameters register */
65 #define TLI_LxVPOS(layerx)                REG32((layerx) + 0x0000008CU)     /*!< TLI layer x vertical position parameters register */
66 #define TLI_LxCKEY(layerx)                REG32((layerx) + 0x00000090U)     /*!< TLI layer x color key register */
67 #define TLI_LxPPF(layerx)                 REG32((layerx) + 0x00000094U)     /*!< TLI layer x packeted pixel format register */
68 #define TLI_LxSA(layerx)                  REG32((layerx) + 0x00000098U)     /*!< TLI layer x specified alpha register */
69 #define TLI_LxDC(layerx)                  REG32((layerx) + 0x0000009CU)     /*!< TLI layer x default color register */
70 #define TLI_LxBLEND(layerx)               REG32((layerx) + 0x000000A0U)     /*!< TLI layer x blending register */
71 #define TLI_LxFBADDR(layerx)              REG32((layerx) + 0x000000ACU)     /*!< TLI layer x frame base address register */
72 #define TLI_LxFLLEN(layerx)               REG32((layerx) + 0x000000B0U)     /*!< TLI layer x frame line length register */
73 #define TLI_LxFTLN(layerx)                REG32((layerx) + 0x000000B4U)     /*!< TLI layer x frame total line number register */
74 #define TLI_LxLUT(layerx)                 REG32((layerx) + 0x000000C4U)     /*!< TLI layer x look up table register */
75 
76 /* bits definitions */
77 /* TLI_SPSZ */
78 #define TLI_SPSZ_VPSZ                     BITS(0,11)       /*!< size of the vertical synchronous pulse */
79 #define TLI_SPSZ_HPSZ                     BITS(16,27)      /*!< size of the horizontal synchronous pulse */
80 
81 /* TLI_BPSZ */
82 #define TLI_BPSZ_VBPSZ                    BITS(0,11)       /*!< size of the vertical back porch plus synchronous pulse */
83 #define TLI_BPSZ_HBPSZ                    BITS(16,27)      /*!< size of the horizontal back porch plus synchronous pulse */
84 
85 /* TLI_ASZ */
86 #define TLI_ASZ_VASZ                      BITS(0,11)       /*!< size of the vertical active area width plus back porch and synchronous pulse */
87 #define TLI_ASZ_HASZ                      BITS(16,27)      /*!< size of the horizontal active area width plus back porch and synchronous pulse */
88 
89 /* TLI_SPSZ */
90 #define TLI_TSZ_VTSZ                      BITS(0,11)       /*!< vertical total size of the display, including active area, back porch, synchronous pulse and front porch */
91 #define TLI_TSZ_HTSZ                      BITS(16,27)      /*!< horizontal total size of the display, including active area, back porch, synchronous pulse and front porch */
92 
93 /* TLI_CTL */
94 #define TLI_CTL_TLIEN                     BIT(0)           /*!< TLI enable bit */
95 #define TLI_CTL_BDB                       BITS(4,6)        /*!< blue channel dither bits number */
96 #define TLI_CTL_GDB                       BITS(8,10)       /*!< green channel dither bits number */
97 #define TLI_CTL_RDB                       BITS(12,14)      /*!< red channel dither bits number */
98 #define TLI_CTL_DFEN                      BIT(16)          /*!< dither function enable */
99 #define TLI_CTL_CLKPS                     BIT(28)          /*!< pixel clock polarity selection */
100 #define TLI_CTL_DEPS                      BIT(29)          /*!< data enable polarity selection */
101 #define TLI_CTL_VPPS                      BIT(30)          /*!< vertical pulse polarity selection */
102 #define TLI_CTL_HPPS                      BIT(31)          /*!< horizontal pulse polarity selection */
103 
104 /* TLI_RL */
105 #define TLI_RL_RQR                        BIT(0)           /*!< request reload */
106 #define TLI_RL_FBR                        BIT(1)           /*!< frame blank reload */
107 
108 /* TLI_BGC */
109 #define TLI_BGC_BVB                       BITS(0,7)        /*!< background value blue */
110 #define TLI_BGC_BVG                       BITS(8,15)       /*!< background value green */
111 #define TLI_BGC_BVR                       BITS(16,23)      /*!< background value red */
112 
113 /* TLI_INTEN */
114 #define TLI_INTEN_LMIE                    BIT(0)           /*!< line mark interrupt enable */
115 #define TLI_INTEN_FEIE                    BIT(1)           /*!< FIFO error interrupt enable */
116 #define TLI_INTEN_TEIE                    BIT(2)           /*!< transaction error interrupt enable */
117 #define TLI_INTEN_LCRIE                   BIT(3)           /*!< layer configuration reloaded interrupt enable */
118 
119 /* TLI_INTF */
120 #define TLI_INTF_LMF                      BIT(0)           /*!< line mark flag */
121 #define TLI_INTF_FEF                      BIT(1)           /*!< FIFO error flag */
122 #define TLI_INTF_TEF                      BIT(2)           /*!< transaction error flag */
123 #define TLI_INTF_LCRF                     BIT(3)           /*!< layer configuration reloaded flag */
124 
125 /* TLI_INTC */
126 #define TLI_INTC_LMC                      BIT(0)           /*!< line mark flag clear */
127 #define TLI_INTC_FEC                      BIT(1)           /*!< FIFO error flag clear */
128 #define TLI_INTC_TEC                      BIT(2)           /*!< transaction error flag clear */
129 #define TLI_INTC_LCRC                     BIT(3)           /*!< layer configuration reloaded flag clear */
130 
131 /* TLI_LM */
132 #define TLI_LM_LM                         BITS(0,10)       /*!< line mark value */
133 
134 /* TLI_CPPOS */
135 #define TLI_CPPOS_VPOS                    BITS(0,15)       /*!< vertical position */
136 #define TLI_CPPOS_HPOS                    BITS(16,31)      /*!< horizontal position */
137 
138 /* TLI_STAT */
139 #define TLI_STAT_VDE                      BIT(0)           /*!< current VDE status */
140 #define TLI_STAT_HDE                      BIT(1)           /*!< current HDE status */
141 #define TLI_STAT_VS                       BIT(2)           /*!< current VS status of the TLI */
142 #define TLI_STAT_HS                       BIT(3)           /*!< current HS status of the TLI  */
143 
144 /* TLI_LxCTL */
145 #define TLI_LxCTL_LEN                     BIT(0)           /*!< layer enable */
146 #define TLI_LxCTL_CKEYEN                  BIT(1)           /*!< color keying enable */
147 #define TLI_LxCTL_LUTEN                   BIT(4)           /*!< LUT enable */
148 
149 /* TLI_LxHPOS */
150 #define TLI_LxHPOS_WLP                    BITS(0,11)       /*!< window left position */
151 #define TLI_LxHPOS_WRP                    BITS(16,27)      /*!< window right position */
152 
153 /* TLI_LxVPOS */
154 #define TLI_LxVPOS_WTP                    BITS(0,11)       /*!< window top position */
155 #define TLI_LxVPOS_WBP                    BITS(16,27)      /*!< window bottom position */
156 
157 /* TLI_LxCKEY */
158 #define TLI_LxCKEY_CKEYB                  BITS(0,7)        /*!< color key blue */
159 #define TLI_LxCKEY_CKEYG                  BITS(8,15)       /*!< color key green */
160 #define TLI_LxCKEY_CKEYR                  BITS(16,23)      /*!< color key red */
161 
162 /* TLI_LxPPF */
163 #define TLI_LxPPF_PPF                     BITS(0,2)        /*!< packeted pixel format */
164 
165 /* TLI_LxSA */
166 #define TLI_LxSA_SA                       BITS(0,7)        /*!< specified alpha */
167 
168 /* TLI_LxDC */
169 #define TLI_LxDC_DCB                      BITS(0,7)        /*!< the default color blue */
170 #define TLI_LxDC_DCG                      BITS(8,15)       /*!< the default color green */
171 #define TLI_LxDC_DCR                      BITS(16,23)      /*!< the default color red */
172 #define TLI_LxDC_DCA                      BITS(24,31)      /*!< the default color alpha */
173 
174 /* TLI_LxBLEND */
175 #define TLI_LxBLEND_ACF2                  BITS(0,2)        /*!< alpha calculation factor 2 of blending method */
176 #define TLI_LxBLEND_ACF1                  BITS(8,10)       /*!< alpha calculation factor 1 of blending method */
177 
178 /* TLI_LxFBADDR */
179 #define TLI_LxFBADDR_FBADD                BITS(0,31)       /*!< frame buffer base address */
180 
181 /* TLI_LxFLLEN */
182 #define TLI_LxFLLEN_FLL                   BITS(0,13)       /*!< frame line length */
183 #define TLI_LxFLLEN_STDOFF                BITS(16,29)      /*!< frame buffer stride offset */
184 
185 /* TLI_LxFTLN */
186 #define TLI_LxFTLN_FTLN                   BITS(0,10)       /*!< frame total line number */
187 
188 /* TLI_LxLUT */
189 #define TLI_LxLUT_TB                      BITS(0,7)        /*!< blue channel of a LUT entry */
190 #define TLI_LxLUT_TG                      BITS(8,15)       /*!< green channel of a LUT entry */
191 #define TLI_LxLUT_TR                      BITS(16,23)      /*!< red channel of a LUT entry */
192 #define TLI_LxLUT_TADD                    BITS(24,31)      /*!< look up table write address */
193 
194 /* constants definitions */
195 /* TLI parameter struct definitions */
196 typedef struct {
197     uint16_t synpsz_vpsz;                     /*!< size of the vertical synchronous pulse */
198     uint16_t synpsz_hpsz;                     /*!< size of the horizontal synchronous pulse */
199     uint16_t backpsz_vbpsz;                   /*!< size of the vertical back porch plus synchronous pulse */
200     uint16_t backpsz_hbpsz;                   /*!< size of the horizontal back porch plus synchronous pulse */
201     uint32_t activesz_vasz;                   /*!< size of the vertical active area width plus back porch and synchronous pulse */
202     uint32_t activesz_hasz;                   /*!< size of the horizontal active area width plus back porch and synchronous pulse */
203     uint32_t totalsz_vtsz;                    /*!< vertical total size of the display */
204     uint32_t totalsz_htsz;                    /*!< horizontal total size of the display */
205     uint32_t backcolor_red;                   /*!< background value red */
206     uint32_t backcolor_green;                 /*!< background value green */
207     uint32_t backcolor_blue;                  /*!< background value blue */
208     uint32_t signalpolarity_hs;               /*!< horizontal pulse polarity selection */
209     uint32_t signalpolarity_vs;               /*!< vertical pulse polarity selection */
210     uint32_t signalpolarity_de;               /*!< data enable polarity selection */
211     uint32_t signalpolarity_pixelck;          /*!< pixel clock polarity selection */
212 } tli_parameter_struct;
213 
214 /* TLI layer parameter struct definitions */
215 typedef struct {
216     uint16_t layer_window_rightpos;           /*!< window right position */
217     uint16_t layer_window_leftpos;            /*!< window left position */
218     uint16_t layer_window_bottompos;          /*!< window bottom position */
219     uint16_t layer_window_toppos;             /*!< window top position */
220     uint32_t layer_ppf;                       /*!< packeted pixel format */
221     uint8_t  layer_sa;                        /*!< specified alpha */
222     uint8_t  layer_default_alpha;             /*!< the default color alpha */
223     uint8_t  layer_default_red;               /*!< the default color red */
224     uint8_t  layer_default_green;             /*!< the default color green */
225     uint8_t  layer_default_blue;              /*!< the default color blue */
226     uint32_t layer_acf1;                      /*!< alpha calculation factor 1 of blending method */
227     uint32_t layer_acf2;                      /*!< alpha calculation factor 2 of blending method */
228     uint32_t layer_frame_bufaddr;             /*!< frame buffer base address */
229     uint16_t layer_frame_buf_stride_offset;   /*!< frame buffer stride offset */
230     uint16_t layer_frame_line_length;         /*!< frame line length */
231     uint16_t layer_frame_total_line_number;   /*!< frame total line number */
232 } tli_layer_parameter_struct;
233 
234 /* TLI layer LUT parameter struct definitions */
235 typedef struct {
236     uint32_t layer_table_addr;                /*!< look up table write address */
237     uint8_t layer_lut_channel_red;            /*!< red channel of a LUT entry */
238     uint8_t layer_lut_channel_green;          /*!< green channel of a LUT entry */
239     uint8_t layer_lut_channel_blue;           /*!< blue channel of a LUT entry */
240 } tli_layer_lut_parameter_struct;
241 
242 /* packeted pixel format */
243 typedef enum {
244     LAYER_PPF_ARGB8888,                      /*!< layerx pixel format ARGB8888 */
245     LAYER_PPF_RGB888,                        /*!< layerx pixel format RGB888 */
246     LAYER_PPF_RGB565,                        /*!< layerx pixel format RGB565 */
247     LAYER_PPF_ARGB1555,                      /*!< layerx pixel format ARGB1555 */
248     LAYER_PPF_ARGB4444,                      /*!< layerx pixel format ARGB4444 */
249     LAYER_PPF_L8,                            /*!< layerx pixel format L8 */
250     LAYER_PPF_AL44,                          /*!< layerx pixel format AL44 */
251     LAYER_PPF_AL88                           /*!< layerx pixel format AL88 */
252 } tli_layer_ppf_enum;
253 
254 /* TLI flags */
255 #define TLI_FLAG_VDE                   TLI_STAT_VDE                /*!< current VDE status */
256 #define TLI_FLAG_HDE                   TLI_STAT_HDE                /*!< current HDE status */
257 #define TLI_FLAG_VS                    TLI_STAT_VS                 /*!< current VS status of the TLI */
258 #define TLI_FLAG_HS                    TLI_STAT_HS                 /*!< current HS status of the TLI */
259 #define TLI_FLAG_LM                    BIT(0) | BIT(31)            /*!< line mark interrupt flag */
260 #define TLI_FLAG_FE                    BIT(1) | BIT(31)            /*!< FIFO error interrupt flag */
261 #define TLI_FLAG_TE                    BIT(2) | BIT(31)            /*!< transaction error interrupt flag */
262 #define TLI_FLAG_LCR                   BIT(3) | BIT(31)            /*!< layer configuration reloaded interrupt flag */
263 
264 /* TLI interrupt enable or disable */
265 #define TLI_INT_LM                     BIT(0)                      /*!< line mark interrupt */
266 #define TLI_INT_FE                     BIT(1)                      /*!< FIFO error interrupt */
267 #define TLI_INT_TE                     BIT(2)                      /*!< transaction error interrupt */
268 #define TLI_INT_LCR                    BIT(3)                      /*!< layer configuration reloaded interrupt */
269 
270 /* TLI interrupt flag */
271 #define TLI_INT_FLAG_LM                BIT(0)                      /*!< line mark interrupt flag */
272 #define TLI_INT_FLAG_FE                BIT(1)                      /*!< FIFO error interrupt flag */
273 #define TLI_INT_FLAG_TE                BIT(2)                      /*!< transaction error interrupt flag */
274 #define TLI_INT_FLAG_LCR               BIT(3)                      /*!< layer configuration reloaded interrupt flag */
275 
276 /* layer reload configure */
277 #define TLI_FRAME_BLANK_RELOAD_EN     ((uint8_t)0x00U)             /*!< the layer configuration will be reloaded at frame blank */
278 #define TLI_REQUEST_RELOAD_EN         ((uint8_t)0x01U)             /*!< the layer configuration will be reloaded after this bit sets */
279 
280 /* dither function */
281 #define TLI_DITHER_DISABLE            ((uint8_t)0x00U)             /*!< dither function disable */
282 #define TLI_DITHER_ENABLE             ((uint8_t)0x01U)             /*!< dither function enable */
283 
284 /* horizontal pulse polarity selection */
285 #define TLI_HSYN_ACTLIVE_LOW          ((uint32_t)0x00000000U)      /*!< horizontal synchronous pulse active low */
286 #define TLI_HSYN_ACTLIVE_HIGHT        TLI_CTL_HPPS                 /*!< horizontal synchronous pulse active high */
287 
288 /* vertical pulse polarity selection */
289 #define TLI_VSYN_ACTLIVE_LOW          ((uint32_t)0x00000000U)      /*!< vertical synchronous pulse active low */
290 #define TLI_VSYN_ACTLIVE_HIGHT        TLI_CTL_VPPS                 /*!< vertical synchronous pulse active high */
291 
292 /* pixel clock polarity selection */
293 #define TLI_PIXEL_CLOCK_TLI           ((uint32_t)0x00000000U)      /*!< pixel clock is TLI clock */
294 #define TLI_PIXEL_CLOCK_INVERTEDTLI   TLI_CTL_CLKPS                /*!< pixel clock is inverted TLI clock */
295 
296 /* data enable polarity selection */
297 #define TLI_DE_ACTLIVE_LOW            ((uint32_t)0x00000000U)      /*!< data enable active low */
298 #define TLI_DE_ACTLIVE_HIGHT          TLI_CTL_DEPS                 /*!< data enable active high */
299 
300 /* alpha calculation factor 1 of blending method */
301 #define LxBLEND_ACF1(regval)          (BITS(8,10) & ((uint32_t)(regval)<<8))
302 #define LAYER_ACF1_SA                 LxBLEND_ACF1(4)              /*!< normalization specified alpha */
303 #define LAYER_ACF1_PASA               LxBLEND_ACF1(6)              /*!< normalization pixel alpha * normalization specified alpha */
304 
305 /* alpha calculation factor 2 of blending method */
306 #define LxBLEND_ACF2(regval)          (BITS(0,2) & ((uint32_t)(regval)))
307 #define LAYER_ACF2_SA                 LxBLEND_ACF2(5)              /*!< normalization specified alpha */
308 #define LAYER_ACF2_PASA               LxBLEND_ACF2(7)              /*!< normalization pixel alpha * normalization specified alpha */
309 
310 /* function declarations */
311 /* initialization functions, TLI enable or disable, TLI reload mode configuration */
312 /* deinitialize TLI registers */
313 void tli_deinit(void);
314 /* initialize the parameters of TLI parameter structure with the default values, it is suggested
315   that call this function after a tli_parameter_struct structure is defined */
316 void tli_struct_para_init(tli_parameter_struct *tli_struct);
317 /* initialize TLI */
318 void tli_init(tli_parameter_struct *tli_struct);
319 /* configure TLI dither function */
320 void tli_dither_config(uint8_t dither_stat);
321 /* enable TLI */
322 void tli_enable(void);
323 /* disable TLI */
324 void tli_disable(void);
325 /* configurate TLI reload mode */
326 void tli_reload_config(uint8_t reload_mod);
327 
328 /* TLI layer configuration functions */
329 /* initialize the parameters of TLI layer structure with the default values, it is suggested
330   that call this function after a tli_layer_parameter_struct structure is defined */
331 void tli_layer_struct_para_init(tli_layer_parameter_struct *layer_struct);
332 /* initialize TLI layer */
333 void tli_layer_init(uint32_t layerx, tli_layer_parameter_struct *layer_struct);
334 /* reconfigure window position */
335 void tli_layer_window_offset_modify(uint32_t layerx, uint16_t offset_x, uint16_t offset_y);
336 /* initialize the parameters of TLI layer LUT structure with the default values, it is suggested
337   that call this function after a tli_layer_lut_parameter_struct structure is defined */
338 void tli_lut_struct_para_init(tli_layer_lut_parameter_struct *lut_struct);
339 /* initialize TLI layer LUT */
340 void tli_lut_init(uint32_t layerx, tli_layer_lut_parameter_struct *lut_struct);
341 /* initialize TLI layer color key */
342 void tli_color_key_init(uint32_t layerx, uint8_t redkey, uint8_t greenkey, uint8_t bluekey);
343 /* enable TLI layer */
344 void tli_layer_enable(uint32_t layerx);
345 /* disable TLI layer */
346 void tli_layer_disable(uint32_t layerx);
347 /* enable TLI layer color keying */
348 void tli_color_key_enable(uint32_t layerx);
349 /* disable TLI layer color keying */
350 void tli_color_key_disable(uint32_t layerx);
351 /* enable TLI layer LUT */
352 void tli_lut_enable(uint32_t layerx);
353 /* disable TLI layer LUT */
354 void tli_lut_disable(uint32_t layerx);
355 
356 /* set line mark value */
357 void tli_line_mark_set(uint16_t line_num);
358 /* get current displayed position */
359 uint32_t tli_current_pos_get(void);
360 
361 /* flag and interrupt functions */
362 /* enable TLI interrupt */
363 void tli_interrupt_enable(uint32_t int_flag);
364 /* disable TLI interrupt */
365 void tli_interrupt_disable(uint32_t int_flag);
366 /* get TLI interrupt flag */
367 FlagStatus tli_interrupt_flag_get(uint32_t int_flag);
368 /* clear TLI interrupt flag */
369 void tli_interrupt_flag_clear(uint32_t int_flag);
370 /* get TLI flag or state in TLI_INTF register or TLI_STAT register */
371 FlagStatus tli_flag_get(uint32_t flag);
372 
373 #endif /* GD32F4XX_TLI_H */
374