TMPM4G(1) Group Peripheral Driver User Manual  V1.0.0.0
txz_fuart_include.h
Go to the documentation of this file.
1 
13 /*------------------------------------------------------------------------------*/
14 /* Define to prevent recursive inclusion */
15 /*------------------------------------------------------------------------------*/
16 #ifndef __FUART_INCLUDE_H
17 #define __FUART_INCLUDE_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*------------------------------------------------------------------------------*/
24 /* Includes */
25 /*------------------------------------------------------------------------------*/
26 #include "txz_driver_def.h"
27 
37 /*------------------------------------------------------------------------------*/
38 /* Macro Definition */
39 /*------------------------------------------------------------------------------*/
50 #define FUART_NULL ((void *)0) /* End of group FUART_NullPointer */
54 
60 #define FUART_PARAM_OK ((int32_t)1)
61 #define FUART_PARAM_NG ((int32_t)0) /* End of group FUART_ParameterResult */
65 
71 /* DR */
72 #define FUARTxDR_DR_8BIT_MASK ((uint32_t)0x000000FF) /* End of group FUARTxDR */
76 
82 #define FUARTxCR_CTSEN_MASK ((uint32_t)0x00008000)
83 #define FUARTxCR_RTSEN_MASK ((uint32_t)0x00004000)
84 #define FUARTxCR_RXE_MASK ((uint32_t)0x00000200)
85 #define FUARTxCR_TXE_MASK ((uint32_t)0x00000100)
86 #define FUARTxCR_UARTEN_MSK ((uint32_t)0x00000001)
88 #define FUARTxCR_CTSEN_DISABLE ((uint32_t)0x00000000)
89 #define FUARTxCR_RTSEN_DISABLE ((uint32_t)0x00000000)
90 #define FUARTxCR_RXE_DISABLE ((uint32_t)0x00000000)
91 #define FUARTxCR_TXE_DISABLE ((uint32_t)0x00000000)
92 #define FUARTxCR_UARTEN_DISABLE ((uint32_t)0x00000000)
94 #define FUARTxCR_CTSEN_ENABLE ((uint32_t)0x00008000)
95 #define FUARTxCR_RTSEN_ENABLE ((uint32_t)0x00004000)
96 #define FUARTxCR_RXE_ENABLE ((uint32_t)0x00000200)
97 #define FUARTxCR_TXE_ENABLE ((uint32_t)0x00000100)
98 #define FUARTxCR_UARTEN_ENABLE ((uint32_t)0x00000001) /* End of group FUARTxRSR */
102 
108 #define FUARTxRSR_OE_MASK ((uint32_t)0x00000008)
109 #define FUARTxRSR_BE_MASK ((uint32_t)0x00000004)
110 #define FUARTxRSR_PE_MASK ((uint32_t)0x00000002)
111 #define FUARTxRSR_FE_MASK ((uint32_t)0x00000001)
113 #define FUARTxRSR_OE_ERR ((uint32_t)0x00000008)
114 #define FUARTxRSR_BE_ERR ((uint32_t)0x00000004)
115 #define FUARTxRSR_PE_ERR ((uint32_t)0x00000002)
116 #define FUARTxRSR_FE_ERR ((uint32_t)0x00000001) /* End of group FUARTxRSR */
120 
126 /* ECR */
127 #define FUARTxECR_OE_MASK ((uint32_t)0x00000008)
128 #define FUARTxECR_BE_MASK ((uint32_t)0x00000004)
129 #define FUARTxECR_PE_MASK ((uint32_t)0x00000002)
130 #define FUARTxECR_FE_MASK ((uint32_t)0x00000001)
132 #define FUARTxECR_OE_CLR ((uint32_t)0x00000008)
133 #define FUARTxECR_BE_CLR ((uint32_t)0x00000004)
134 #define FUARTxECR_PE_CLR ((uint32_t)0x00000002)
135 #define FUARTxECR_FE_CLR ((uint32_t)0x00000001) /* End of group FUARTxECR */
140 
146 #define FUARTxLCR_H_BRK_MASK ((uint32_t)0x00000001)
148 #define FUARTxLCR_H_BRK_SEND ((uint32_t)0x00000001)
149 #define FUARTxLCR_H_BRK_STOP ((uint32_t)0x00000000) /* End of group FUARTxLCR_H */
153 
159 #define FUARTxRIS_OERIS_MASK ((uint32_t)0x00000400)
160 #define FUARTxRIS_BERIS_MASK ((uint32_t)0x00000200)
161 #define FUARTxRIS_PERIS_MASK ((uint32_t)0x00000100)
162 #define FUARTxRIS_FERIS_MASK ((uint32_t)0x00000080)
163 #define FUARTxRIS_RTRIS_MASK ((uint32_t)0x00000040)
164 #define FUARTxRIS_TXRIS_MASK ((uint32_t)0x00000020)
165 #define FUARTxRIS_RXRIS_MASK ((uint32_t)0x00000010)
167 #define FUARTxRIS_OERIS_REQ ((uint32_t)0x00000400)
168 #define FUARTxRIS_BERIS_REQ ((uint32_t)0x00000200)
169 #define FUARTxRIS_PERIS_REQ ((uint32_t)0x00000100)
170 #define FUARTxRIS_FERIS_REQ ((uint32_t)0x00000080)
171 #define FUARTxRIS_RTRIS_REQ ((uint32_t)0x00000040)
172 #define FUARTxRIS_TXRIS_REQ ((uint32_t)0x00000020)
173 #define FUARTxRIS_RXRIS_REQ ((uint32_t)0x00000010) /* End of group FUARTxRIS */
178 
184 #define FUARTxMIS_OEMIS_MASK ((uint32_t)0x00000400)
185 #define FUARTxMIS_BEMIS_MASK ((uint32_t)0x00000200)
186 #define FUARTxMIS_PEMIS_MASK ((uint32_t)0x00000100)
187 #define FUARTxMIS_FEMIS_MASK ((uint32_t)0x00000080)
188 #define FUARTxMIS_RTMIS_MASK ((uint32_t)0x00000040)
189 #define FUARTxMIS_TXMIS_MASK ((uint32_t)0x00000020)
190 #define FUARTxMIS_RXMIS_MASK ((uint32_t)0x00000010)
192 #define FUARTxMIS_OEMIS_REQ ((uint32_t)0x00000400)
193 #define FUARTxMIS_BEMIS_REQ ((uint32_t)0x00000200)
194 #define FUARTxMIS_PEMIS_REQ ((uint32_t)0x00000100)
195 #define FUARTxMIS_FEMIS_REQ ((uint32_t)0x00000080)
196 #define FUARTxMIS_RTMIS_REQ ((uint32_t)0x00000040)
197 #define FUARTxMIS_TXMIS_REQ ((uint32_t)0x00000020)
198 #define FUARTxMIS_RXMIS_REQ ((uint32_t)0x00000010) /* End of group FUARTxMIS */
203 
209 #define FUARTxICR_OEIC_MASK ((uint32_t)0x00000400)
210 #define FUARTxICR_BEIC_MASK ((uint32_t)0x00000200)
211 #define FUARTxICR_PEIC_MASK ((uint32_t)0x00000100)
212 #define FUARTxICR_FEIC_MASK ((uint32_t)0x00000080)
213 #define FUARTxICR_RTIC_MASK ((uint32_t)0x00000040)
214 #define FUARTxICR_TXIC_MASK ((uint32_t)0x00000020)
215 #define FUARTxICR_RXIC_MASK ((uint32_t)0x00000010)
217 #define FUARTxICR_OEIC_CLR ((uint32_t)0x00000400)
218 #define FUARTxICR_BEIC_CLR ((uint32_t)0x00000200)
219 #define FUARTxICR_PEIC_CLR ((uint32_t)0x00000100)
220 #define FUARTxICR_FEIC_CLR ((uint32_t)0x00000080)
221 #define FUARTxICR_RTIC_CLR ((uint32_t)0x00000040)
222 #define FUARTxICR_TXIC_CLR ((uint32_t)0x00000020)
223 #define FUARTxICR_RXIC_CLR ((uint32_t)0x00000010) /* End of group FUARTxICR */
228 
234 #define FUARTxDMACR_RXDMAE_MASK ((uint32_t)0x00000001)
235 #define FUARTxDMACR_TXDMAE_MASK ((uint32_t)0x00000002)
237 #define FUARTxDMACR_RXDMAE_ENABLE ((uint32_t)0x00000001)
238 #define FUARTxDMACR_TXDMAE_ENABLE ((uint32_t)0x00000002)
240 #define FUARTxDMACR_RXDMAE_DISABLE ((uint32_t)0x00000000)
241 #define FUARTxDMACR_TXDMAE_DISABLE ((uint32_t)0x00000000) /* End of group FUARTxDMACR */
245 
246  /* End of group FUART_Private_define */
250 
251 
252 /*------------------------------------------------------------------------------*/
253 /* Enumerated Type Definition */
254 /*------------------------------------------------------------------------------*/
260 /* no define */
261  /* End of group FUART_Private_define */
265 
266 
267 /*------------------------------------------------------------------------------*/
268 /* Structure Definition */
269 /*------------------------------------------------------------------------------*/
275 /* no define */
276  /* End of group FUART_Private_typedef */
280 
281 /*------------------------------------------------------------------------------*/
282 /* Inline Functions */
283 /*------------------------------------------------------------------------------*/
288 __STATIC_INLINE void disable_FUARTxCR_TXE(TSB_FURT_TypeDef *p_instance);
289 __STATIC_INLINE void enable_FUARTxCR_TXE(TSB_FURT_TypeDef *p_instance);
290 __STATIC_INLINE void disable_FUARTxCR_RXE(TSB_FURT_TypeDef *p_instance);
291 __STATIC_INLINE void enable_FUARTxCR_RXE(TSB_FURT_TypeDef *p_instance);
292 /*--------------------------------------------------*/
299 /*--------------------------------------------------*/
300 __STATIC_INLINE void disable_FUARTxCR_TXE(TSB_FURT_TypeDef *p_instance)
301 {
302 #ifdef DEBUG
303  if ((uint32_t)p_instance >= (uint32_t)PERI_BASE)
304  {
305  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,8))) = 0;
306  }
307 #else
308  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,8))) = 0;
309 #endif
310 }
311 
312 /*--------------------------------------------------*/
319 /*--------------------------------------------------*/
320 __STATIC_INLINE void enable_FUARTxCR_TXE(TSB_FURT_TypeDef *p_instance)
321 {
322 #ifdef DEBUG
323  if ((uint32_t)p_instance >= (uint32_t)PERI_BASE)
324  {
325  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,8))) = 1;
326  }
327 #else
328  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,8))) = 1;
329 #endif
330 }
331 
332 /*--------------------------------------------------*/
339 /*--------------------------------------------------*/
340 __STATIC_INLINE void disable_FUARTxCR_RXE(TSB_FURT_TypeDef *p_instance)
341 {
342 #ifdef DEBUG
343  if ((uint32_t)p_instance >= (uint32_t)PERI_BASE)
344  {
345  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,9))) = 0;
346  }
347 #else
348  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,9))) = 0;
349 #endif
350 }
351 
352 /*--------------------------------------------------*/
359 /*--------------------------------------------------*/
360 __STATIC_INLINE void enable_FUARTxCR_RXE(TSB_FURT_TypeDef *p_instance)
361 {
362 #ifdef DEBUG
363  if ((uint32_t)p_instance >= (uint32_t)PERI_BASE)
364  {
365  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,9))) = 1;
366  }
367 #else
368  (*((__IO uint32_t *)BITBAND_PERI(&p_instance->CR,9))) = 1;
369 #endif
370 }
371 
372  /* End of group FUART_Private_functions */
376  /* End of group FUART */
380  /* End of group Periph_Driver */
384 
385 #ifdef __cplusplus
386 }
387 #endif /* __cplusplus */
388 #endif /* __UART_EX_H */
389 
390 
__STATIC_INLINE void disable_FUARTxCR_RXE(TSB_FURT_TypeDef *p_instance)
Disable FUARTxCR RXE.
Definition: txz_fuart_include.h:340
__STATIC_INLINE void disable_FUARTxCR_TXE(TSB_FURT_TypeDef *p_instance)
Disable FUARTxCR TXE.
Definition: txz_fuart_include.h:300
__STATIC_INLINE void enable_FUARTxCR_RXE(TSB_FURT_TypeDef *p_instance)
Enable FUARTxCR RXE.
Definition: txz_fuart_include.h:360
All common macro and definition for TXZ peripheral drivers.
__STATIC_INLINE void enable_FUARTxCR_TXE(TSB_FURT_TypeDef *p_instance)
Enable FUARTxCR TXE.
Definition: txz_fuart_include.h:320