Lpuart_Uart_Ip_VS_0_PBcfg.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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. #include "USER_CONFIG.h"
  46. /*==================================================================================================
  47. * SOURCE FILE VERSION INFORMATION
  48. ==================================================================================================*/
  49. #define LPUART_UART_IP_PBCFG_VS_0_VENDOR_ID_C 43
  50. #define LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C 4
  51. #define LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C 4
  52. #define LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_REVISION_VERSION_C 0
  53. #define LPUART_UART_IP_PBCFG_VS_0_SW_MAJOR_VERSION_C 1
  54. #define LPUART_UART_IP_PBCFG_VS_0_SW_MINOR_VERSION_C 0
  55. #define LPUART_UART_IP_PBCFG_VS_0_SW_PATCH_VERSION_C 0
  56. /*==================================================================================================
  57. * FILE VERSION CHECKS
  58. ==================================================================================================*/
  59. /* Checks against Lpuart_Uart_Ip_Types.h */
  60. #if (LPUART_UART_IP_PBCFG_VS_0_VENDOR_ID_C != LPUART_UART_IP_TYPES_VENDOR_ID)
  61. #error "Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Types.h have different vendor ids"
  62. #endif
  63. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != LPUART_UART_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  64. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != LPUART_UART_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
  65. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_REVISION_VERSION_C != LPUART_UART_IP_TYPES_AR_RELEASE_REVISION_VERSION))
  66. #error "AUTOSAR Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Types.h are different"
  67. #endif
  68. #if ((LPUART_UART_IP_PBCFG_VS_0_SW_MAJOR_VERSION_C != LPUART_UART_IP_TYPES_SW_MAJOR_VERSION) || \
  69. (LPUART_UART_IP_PBCFG_VS_0_SW_MINOR_VERSION_C != LPUART_UART_IP_TYPES_SW_MINOR_VERSION) || \
  70. (LPUART_UART_IP_PBCFG_VS_0_SW_PATCH_VERSION_C != LPUART_UART_IP_TYPES_SW_PATCH_VERSION) \
  71. )
  72. #error "Software Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Types.h are different"
  73. #endif
  74. /* Checks against Lpuart_Uart_Ip_Cfg.h */
  75. #if (LPUART_UART_IP_PBCFG_VS_0_VENDOR_ID_C != LPUART_UART_IP_CFG_VENDOR_ID)
  76. #error "Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Cfg.h have different vendor ids"
  77. #endif
  78. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != LPUART_UART_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
  79. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != LPUART_UART_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
  80. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_REVISION_VERSION_C != LPUART_UART_IP_CFG_AR_RELEASE_REVISION_VERSION))
  81. #error "AUTOSAR Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Cfg.h are different"
  82. #endif
  83. #if ((LPUART_UART_IP_PBCFG_VS_0_SW_MAJOR_VERSION_C != LPUART_UART_IP_CFG_SW_MAJOR_VERSION) || \
  84. (LPUART_UART_IP_PBCFG_VS_0_SW_MINOR_VERSION_C != LPUART_UART_IP_CFG_SW_MINOR_VERSION) || \
  85. (LPUART_UART_IP_PBCFG_VS_0_SW_PATCH_VERSION_C != LPUART_UART_IP_CFG_SW_PATCH_VERSION) \
  86. )
  87. #error "Software Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Lpuart_Uart_Ip_Cfg.h are different"
  88. #endif
  89. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  90. /* Check if current file and StandardTypes.h header file are of the same Autosar version */
  91. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != STD_AR_RELEASE_MAJOR_VERSION) || \
  92. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != STD_AR_RELEASE_MINOR_VERSION))
  93. #error "AutoSar Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and StandardTypes.h are different"
  94. #endif
  95. /* Checks against Dma_Ip.h */
  96. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  97. #if ((LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MAJOR_VERSION_C != DMA_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  98. (LPUART_UART_IP_PBCFG_VS_0_AR_RELEASE_MINOR_VERSION_C != DMA_IP_AR_RELEASE_MINOR_VERSION_H))
  99. #error "AutoSar Version Numbers of Lpuart_Uart_Ip_VS_0_PBcfg.c and Dma_Ip.h are different"
  100. #endif
  101. #endif
  102. #endif
  103. /*==================================================================================================
  104. * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  105. ==================================================================================================*/
  106. /*==================================================================================================
  107. * LOCAL MACROS
  108. ==================================================================================================*/
  109. /*==================================================================================================
  110. * GLOBAL FUNCTIONS
  111. ==================================================================================================*/
  112. /*==================================================================================================
  113. * STATE STRUCTURE DECLARATIONS
  114. ==================================================================================================*/
  115. /*==================================================================================================
  116. * LOCAL CONSTANTS
  117. ==================================================================================================*/
  118. /*==================================================================================================
  119. * LOCAL VARIABLES
  120. ==================================================================================================*/
  121. /*==================================================================================================
  122. * GLOBAL VARIABLES
  123. ==================================================================================================*/
  124. #define UART_START_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
  125. #include "Uart_MemMap.h"
  126. extern Lpuart_Uart_Ip_StateStructureType Lpuart_Uart_Ip_apStateStructure[3U];
  127. #define UART_STOP_SEC_VAR_CLEARED_UNSPECIFIED_NO_CACHEABLE
  128. #include "Uart_MemMap.h"
  129. #define UART_START_SEC_CONFIG_DATA_UNSPECIFIED
  130. #include "Uart_MemMap.h"
  131. /**
  132. * @brief Hardware configuration for Uart Hardware - Configuration:
  133. *
  134. * @api
  135. */
  136. const Lpuart_Uart_Ip_UserConfigType Lpuart_Uart_Ip_xHwConfigPB_0_VS_0 =
  137. {
  138. #if (defined UART0_BAUDRATE)
  139. #if (UART0_BAUDRATE == UART_BAUDRATE_9600)
  140. /*!< Baud rate in hertz */
  141. 9615U,
  142. /* Baud clock divisor*/
  143. 8U,
  144. /* Over sampling ratio*/
  145. 26U,
  146. #elif (UART0_BAUDRATE == UART_BAUDRATE_19200)
  147. /*!< Baud rate in hertz */
  148. 19230U,
  149. /* Baud clock divisor*/
  150. 4U,
  151. /* Over sampling ratio*/
  152. 26U,
  153. #elif (UART0_BAUDRATE == UART_BAUDRATE_115200)
  154. /*!< Baud rate in hertz */
  155. 117647U,
  156. /* Baud clock divisor*/
  157. 1U,
  158. /* Over sampling ratio*/
  159. 17U,
  160. #else
  161. #error "please select the right uart baudrate of uart0
  162. #endif
  163. #else
  164. #error "please define the UART0_BAUDRATE"
  165. #endif
  166. /* Parity type */
  167. LPUART_UART_IP_PARITY_DISABLED,
  168. /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
  169. LPUART_UART_IP_ONE_STOP_BIT,
  170. /* Number of bits per transmitted/received word */
  171. LPUART_UART_IP_8_BITS_PER_CHAR,
  172. /* Type of UART transfer (interrupt/dma based) */
  173. LPUART_UART_IP_USING_DMA,
  174. /* Callback to invoke for Uart event.*/
  175. (Lpuart_Uart_Ip_CallbackType)Uart_Ipw_LpuartCallback,
  176. /* User callback parameter pointer.*/
  177. NULL_PTR,
  178. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  179. /* DMA channel number for DMA-based rx. */
  180. DMA_LOGIC_CH_UART0_RX,
  181. /* DMA channel number for DMA-based tx. */
  182. DMA_LOGIC_CH_UART0_TX,
  183. #endif
  184. /* Runtime state structure refference */
  185. &Lpuart_Uart_Ip_apStateStructure[0]
  186. };
  187. /**
  188. * @brief Hardware configuration for Uart Hardware - Configuration:
  189. *
  190. * @api
  191. */
  192. const Lpuart_Uart_Ip_UserConfigType Lpuart_Uart_Ip_xHwConfigPB_1_VS_0 =
  193. {
  194. #if (defined UART1_BAUDRATE)
  195. #if (UART1_BAUDRATE == UART_BAUDRATE_9600)
  196. /*!< Baud rate in hertz */
  197. 9615U,
  198. /* Baud clock divisor*/
  199. 8U,
  200. /* Over sampling ratio*/
  201. 26U,
  202. #elif (UART1_BAUDRATE == UART_BAUDRATE_19200)
  203. /*!< Baud rate in hertz */
  204. 19230U,
  205. /* Baud clock divisor*/
  206. 4U,
  207. /* Over sampling ratio*/
  208. 26U,
  209. #elif (UART1_BAUDRATE == UART_BAUDRATE_115200)
  210. /*!< Baud rate in hertz */
  211. 117647U,
  212. /* Baud clock divisor*/
  213. 1U,
  214. /* Over sampling ratio*/
  215. 17U,
  216. #else
  217. #error "please select the right uart baudrate of uart0
  218. #endif
  219. #else
  220. #error "please define the UART0_BAUDRATE"
  221. #endif
  222. /* Parity type */
  223. LPUART_UART_IP_PARITY_DISABLED,
  224. /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
  225. LPUART_UART_IP_ONE_STOP_BIT,
  226. /* Number of bits per transmitted/received word */
  227. LPUART_UART_IP_8_BITS_PER_CHAR,
  228. /* Type of UART transfer (interrupt/dma based) */
  229. LPUART_UART_IP_USING_DMA,
  230. /* Callback to invoke for Uart event.*/
  231. (Lpuart_Uart_Ip_CallbackType)Uart_Ipw_LpuartCallback,
  232. /* User callback parameter pointer.*/
  233. NULL_PTR,
  234. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  235. /* DMA channel number for DMA-based rx. */
  236. DMA_LOGIC_CH_UART1_RX,
  237. /* DMA channel number for DMA-based tx. */
  238. DMA_LOGIC_CH_UART1_TX,
  239. #endif
  240. /* Runtime state structure refference */
  241. &Lpuart_Uart_Ip_apStateStructure[1]
  242. };
  243. /**
  244. * @brief Hardware configuration for Uart Hardware - Configuration:
  245. *
  246. * @api
  247. */
  248. const Lpuart_Uart_Ip_UserConfigType Lpuart_Uart_Ip_xHwConfigPB_2_VS_0 =
  249. {
  250. #if (defined UART2_BAUDRATE)
  251. #if (UART2_BAUDRATE == UART_BAUDRATE_9600)
  252. /*!< Baud rate in hertz */
  253. 9615U,
  254. /* Baud clock divisor*/
  255. 8U,
  256. /* Over sampling ratio*/
  257. 26U,
  258. #elif (UART2_BAUDRATE == UART_BAUDRATE_19200)
  259. /*!< Baud rate in hertz */
  260. 19230U,
  261. /* Baud clock divisor*/
  262. 4U,
  263. /* Over sampling ratio*/
  264. 26U,
  265. #elif (UART2_BAUDRATE == UART_BAUDRATE_115200)
  266. /*!< Baud rate in hertz */
  267. 117647U,
  268. /* Baud clock divisor*/
  269. 1U,
  270. /* Over sampling ratio*/
  271. 17U,
  272. #else
  273. #error "please select the right uart baudrate of uart0
  274. #endif
  275. #else
  276. #error "please define the UART0_BAUDRATE"
  277. #endif
  278. /* Parity type */
  279. LPUART_UART_IP_PARITY_DISABLED,
  280. /* Number of stop bits, 1 stop bit (default) or 2 stop bits */
  281. LPUART_UART_IP_ONE_STOP_BIT,
  282. /* Number of bits per transmitted/received word */
  283. LPUART_UART_IP_8_BITS_PER_CHAR,
  284. /* Type of UART transfer (interrupt/dma based) */
  285. LPUART_UART_IP_USING_DMA,
  286. /* Callback to invoke for Uart event.*/
  287. (Lpuart_Uart_Ip_CallbackType)Uart_Ipw_LpuartCallback,
  288. /* User callback parameter pointer.*/
  289. NULL_PTR,
  290. #if (LPUART_UART_IP_HAS_DMA_ENABLED == STD_ON)
  291. /* DMA channel number for DMA-based rx. */
  292. DMA_LOGIC_CH_UART2_RX,
  293. /* DMA channel number for DMA-based tx. */
  294. DMA_LOGIC_CH_UART2_TX,
  295. #endif
  296. /* Runtime state structure refference */
  297. &Lpuart_Uart_Ip_apStateStructure[2]
  298. };
  299. #define UART_STOP_SEC_CONFIG_DATA_UNSPECIFIED
  300. #include "Uart_MemMap.h"
  301. /*==================================================================================================
  302. * LOCAL FUNCTION PROTOTYPES
  303. ==================================================================================================*/
  304. /*==================================================================================================
  305. * LOCAL FUNCTIONS
  306. ==================================================================================================*/
  307. /*==================================================================================================
  308. * GLOBAL FUNCTIONS
  309. ==================================================================================================*/
  310. #ifdef __cplusplus
  311. }
  312. /** @} */
  313. #endif