Lpuart_Uart_Ip_VS_0_PBcfg.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : FLEXIO
  5. * Dependencies :
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. /**
  25. * @file
  26. * @defgroup lpuart_uart_ip Lpuart UART IPL
  27. * @addtogroup lpuart_uart_ip Lpuart UART IPL
  28. * @{
  29. */
  30. #ifdef __cplusplus
  31. extern "C"{
  32. #endif
  33. /*==================================================================================================
  34. * INCLUDE FILES
  35. * 1) system and project includes
  36. * 2) needed interfaces from external units
  37. * 3) internal and external interfaces from this unit
  38. ==================================================================================================*/
  39. #include "Lpuart_Uart_Ip_Types.h"
  40. #include "Lpuart_Uart_Ip_Cfg.h"
  41. #include "StandardTypes.h"
  42. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  43. #include "Dma_Ip.h"
  44. #endif
  45. /*==================================================================================================
  46. * SOURCE FILE VERSION INFORMATION
  47. ==================================================================================================*/
  48. #define LPUART_UART_IP_PBCFG_VS_0_VENDOR_ID_C 43
  49. #define LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C 4
  50. #define LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C 4
  51. #define LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_REVISION_VERSION_C 0
  52. #define LPUART_UART_IP_PBCFG_VS_0_SW_MAJOR_VERSION_C 1
  53. #define LPUART_UART_IP_PBCFG_VS_0_SW_MINOR_VERSION_C 0
  54. #define LPUART_UART_IP_PBCFG_VS_0_SW_PATCH_VERSION_C 0
  55. /*==================================================================================================
  56. * FILE VERSION CHECKS
  57. ==================================================================================================*/
  58. /* Checks against Lpuart_Uart_Ip_Types.h */
  59. #if (LPUART_UART_IP_PBCFG_VS_0_VENDOR_ID_C != LPUART_UART_IP_TYPES_VENDOR_ID)
  60. #error "Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Types.h have different vendor ids"
  61. #endif
  62. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != LPUART_UART_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  63. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != LPUART_UART_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
  64. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_REVISION_VERSION_C != LPUART_UART_IP_TYPES_AR_RELEASE_REVISION_VERSION))
  65. #error "AUTOSAR Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Types.h are different"
  66. #endif
  67. #if ((LPUART_UART_IP_PBCFG_VS_0_SW_MAJOR_VERSION_C != LPUART_UART_IP_TYPES_SW_MAJOR_VERSION) || \
  68. (LPUART_UART_IP_PBCFG_VS_0_SW_MINOR_VERSION_C != LPUART_UART_IP_TYPES_SW_MINOR_VERSION) || \
  69. (LPUART_UART_IP_PBCFG_VS_0_SW_PATCH_VERSION_C != LPUART_UART_IP_TYPES_SW_PATCH_VERSION) \
  70. )
  71. #error "Software Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Types.h are different"
  72. #endif
  73. /* Checks against Lpuart_Uart_Ip_Cfg.h */
  74. #if (LPUART_UART_IP_PBCFG_VS_0_VENDOR_ID_C != LPUART_UART_IP_CFG_VENDOR_ID)
  75. #error "Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Cfg.h have different vendor ids"
  76. #endif
  77. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != LPUART_UART_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  78. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != LPUART_UART_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  79. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_REVISION_VERSION_C != LPUART_UART_IP_CFG_AR_RELEASE_REVISION_VERSION))
  80. #error "AUTOSAR Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Cfg.h are different"
  81. #endif
  82. #if ((LPUART_UART_IP_PBCFG_VS_0_SW_MAJOR_VERSION_C != LPUART_UART_IP_CFG_SW_MAJOR_VERSION) || \
  83. (LPUART_UART_IP_PBCFG_VS_0_SW_MINOR_VERSION_C != LPUART_UART_IP_CFG_SW_MINOR_VERSION) || \
  84. (LPUART_UART_IP_PBCFG_VS_0_SW_PATCH_VERSION_C != LPUART_UART_IP_CFG_SW_PATCH_VERSION) \
  85. )
  86. #error "Software Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Cfg.h are different"
  87. #endif
  88. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  89. /* Check if current file and StandardTypes.h header file are of the same Autosar version */
  90. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != STD_AR_RELEASE_MAJOR_VERSION) || \
  91. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != STD_AR_RELEASE_MINOR_VERSION))
  92. #error "AutoSar Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and StandardTypes.h are different"
  93. #endif
  94. /* Checks against Dma_Ip.h */
  95. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  96. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != DMA_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  97. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != DMA_IP_AR_RELEASE_MINOR_VERSION_H))
  98. #error "AutoSar Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Dma_Ip.h are different"
  99. #endif
  100. #endif
  101. #endif
  102. /*==================================================================================================
  103. * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  104. ==================================================================================================*/
  105. /*==================================================================================================
  106. * LOCAL MACROS
  107. ==================================================================================================*/
  108. /*==================================================================================================
  109. * GLOBAL FUNCTIONS
  110. ==================================================================================================*/
  111. /*==================================================================================================
  112. * STATE STRUCTURE DECLARATIONS
  113. ==================================================================================================*/
  114. /*==================================================================================================
  115. * LOCAL CONSTANTS
  116. ==================================================================================================*/
  117. /*==================================================================================================
  118. * LOCAL VARIABLES
  119. ==================================================================================================*/
  120. /*==================================================================================================
  121. * GLOBAL VARIABLES
  122. ==================================================================================================*/
  123. #define UART_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
  124. #include "Uart_MemMap.h"
  125. extern Lpuart_Uart_Ip_StateStructureType Lpuart_Uart_Ip_apStateStructure[3U];
  126. #define UART_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
  127. #include "Uart_MemMap.h"
  128. #define UART_START_SEC_CONFIG_DATA_UNSPECIFIED
  129. #include "Uart_MemMap.h"
  130. /**
  131. * @brief Hardware configuration for Uart Hardware - Configuration:
  132. *
  133. * @api
  134. */
  135. const Lpuart_Uart_Ip_UserConfigType Lpuart_Uart_Ip_xHwConfigPB_0_VS_0 =
  136. {
  137. /*!< Baud rate in hertz */
  138. 9603U,
  139. /* Baud clock divisor*/
  140. 98U,
  141. /* Over sampling ratio*/
  142. 17U,
  143. /* Parity type */
  144. LPUART_UART_IP_PARITY_DISABLED,
  145. /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
  146. LPUART_UART_IP_ONE_STOP_BIT,
  147. /* Number of bits per transmitted/received word */
  148. LPUART_UART_IP_8_BITS_PER_CHAR,
  149. /* Type of UART transfer (interrupt/dma based) */
  150. LPUART_UART_IP_USING_DMA,
  151. /* Callback to invoke for Uart event.*/
  152. (Lpuart_Uart_Ip_CallbackType)Uart_Ipw_LpuartCallback,
  153. /* User callback parameter pointer.*/
  154. NULL_PTR,
  155. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  156. /* DMA channel number for DMA-based rx. */
  157. DMA_LOGIC_CH_UART0_RX,
  158. /* DMA channel number for DMA-based tx. */
  159. DMA_LOGIC_CH_UART0_TX,
  160. #endif
  161. /* Runtime state structure refference */
  162. &Lpuart_Uart_Ip_apStateStructure[0]
  163. };
  164. /**
  165. * @brief Hardware configuration for Uart Hardware - Configuration:
  166. *
  167. * @api
  168. */
  169. const Lpuart_Uart_Ip_UserConfigType Lpuart_Uart_Ip_xHwConfigPB_1_VS_0 =
  170. {
  171. /*!< Baud rate in hertz */
  172. 115942U,
  173. /* Baud clock divisor*/
  174. 6U,
  175. /* Over sampling ratio*/
  176. 23U,
  177. /* Parity type */
  178. LPUART_UART_IP_PARITY_DISABLED,
  179. /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
  180. LPUART_UART_IP_ONE_STOP_BIT,
  181. /* Number of bits per transmitted/received word */
  182. LPUART_UART_IP_8_BITS_PER_CHAR,
  183. /* Type of UART transfer (interrupt/dma based) */
  184. LPUART_UART_IP_USING_DMA,
  185. /* Callback to invoke for Uart event.*/
  186. (Lpuart_Uart_Ip_CallbackType)Uart_Ipw_LpuartCallback,
  187. /* User callback parameter pointer.*/
  188. NULL_PTR,
  189. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  190. /* DMA channel number for DMA-based rx. */
  191. DMA_LOGIC_CH_UART1_RX,
  192. /* DMA channel number for DMA-based tx. */
  193. DMA_LOGIC_CH_UART1_TX,
  194. #endif
  195. /* Runtime state structure refference */
  196. &Lpuart_Uart_Ip_apStateStructure[1]
  197. };
  198. /**
  199. * @brief Hardware configuration for Uart Hardware - Configuration:
  200. *
  201. * @api
  202. */
  203. const Lpuart_Uart_Ip_UserConfigType Lpuart_Uart_Ip_xHwConfigPB_2_VS_0 =
  204. {
  205. /*!< Baud rate in hertz */
  206. 9603U,
  207. /* Baud clock divisor*/
  208. 98U,
  209. /* Over sampling ratio*/
  210. 17U,
  211. /* Parity type */
  212. LPUART_UART_IP_PARITY_DISABLED,
  213. /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
  214. LPUART_UART_IP_ONE_STOP_BIT,
  215. /* Number of bits per transmitted/received word */
  216. LPUART_UART_IP_8_BITS_PER_CHAR,
  217. /* Type of UART transfer (interrupt/dma based) */
  218. LPUART_UART_IP_USING_DMA,
  219. /* Callback to invoke for Uart event.*/
  220. (Lpuart_Uart_Ip_CallbackType)Uart_Ipw_LpuartCallback,
  221. /* User callback parameter pointer.*/
  222. NULL_PTR,
  223. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  224. /* DMA channel number for DMA-based rx. */
  225. DMA_LOGIC_CH_UART2_RX,
  226. /* DMA channel number for DMA-based tx. */
  227. DMA_LOGIC_CH_UART2_TX,
  228. #endif
  229. /* Runtime state structure refference */
  230. &Lpuart_Uart_Ip_apStateStructure[2]
  231. };
  232. #define UART_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  233. #include "Uart_MemMap.h"
  234. /*==================================================================================================
  235. * LOCAL FUNCTION PROTOTYPES
  236. ==================================================================================================*/
  237. /*==================================================================================================
  238. * LOCAL FUNCTIONS
  239. ==================================================================================================*/
  240. /*==================================================================================================
  241. * GLOBAL FUNCTIONS
  242. ==================================================================================================*/
  243. #ifdef __cplusplus
  244. }
  245. /** @} */
  246. #endif