Port_Cfg.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : PORT_CI
  5. * Dependencies : none
  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. #ifndef PORT_CFG_H
  25. #define PORT_CFG_H
  26. /**
  27. * @file Port_Cfg.h
  28. *
  29. * @implements Port_Cfg.h_Artifact
  30. * @defgroup Port_CFG Port CFG
  31. * @{
  32. */
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /*=================================================================================================
  37. INCLUDE FILES
  38. 1) system and project includes
  39. 2) needed interfaces from external units
  40. 3) internal and external interfaces from this unit
  41. =================================================================================================*/
  42. #include "Port_VS_0_PBcfg.h"
  43. #include "Port_Ci_Port_Ip_Types.h"
  44. /*=================================================================================================
  45. * SOURCE FILE VERSION INFORMATION
  46. =================================================================================================*/
  47. /**
  48. * @brief Parameters that shall be published within the Port driver header file and also in the
  49. * module description file
  50. * @details The integration of incompatible files shall be avoided.
  51. *
  52. */
  53. #define PORT_VENDOR_ID_CFG_H 43
  54. #define PORT_AR_RELEASE_MAJOR_VERSION_CFG_H 4
  55. #define PORT_AR_RELEASE_MINOR_VERSION_CFG_H 4
  56. #define PORT_AR_RELEASE_REVISION_VERSION_CFG_H 0
  57. #define PORT_SW_MAJOR_VERSION_CFG_H 1
  58. #define PORT_SW_MINOR_VERSION_CFG_H 0
  59. #define PORT_SW_PATCH_VERSION_CFG_H 0
  60. /*=================================================================================================
  61. * FILE VERSION CHECKS
  62. =================================================================================================*/
  63. /* Check if the files Port_Cfg.h and Port_VS_0_PBcfg.h are of the same version */
  64. #if (PORT_VENDOR_ID_CFG_H != PORT_VENDOR_ID_VS_0_PBCFG_H)
  65. #error "Port_Cfg.h and Port_VS_0_PBcfg.h have different vendor IDs"
  66. #endif
  67. /* Check if the files Port_Cfg.h and Port_VS_0_PBcfg.h are of the same Autosar version */
  68. #if ((PORT_AR_RELEASE_MAJOR_VERSION_CFG_H != PORT_AR_RELEASE_MAJOR_VERSION_VS_0_PBCFG_H) || \
  69. (PORT_AR_RELEASE_MINOR_VERSION_CFG_H != PORT_AR_RELEASE_MINOR_VERSION_VS_0_PBCFG_H) || \
  70. (PORT_AR_RELEASE_REVISION_VERSION_CFG_H != PORT_AR_RELEASE_REVISION_VERSION_VS_0_PBCFG_H) \
  71. )
  72. #error "AutoSar Version Numbers of Port_Cfg.h and Port_VS_0_PBcfg.h are different"
  73. #endif
  74. /* Check if the files Port_Cfg.h and Port_VS_0_PBcfg.h are of the same software version */
  75. #if ((PORT_SW_MAJOR_VERSION_CFG_H != PORT_SW_MAJOR_VERSION_VS_0_PBCFG_H) || \
  76. (PORT_SW_MINOR_VERSION_CFG_H != PORT_SW_MINOR_VERSION_VS_0_PBCFG_H) || \
  77. (PORT_SW_PATCH_VERSION_CFG_H != PORT_SW_PATCH_VERSION_VS_0_PBCFG_H) \
  78. )
  79. #error "Software Version Numbers of Port_Cfg.h and Port_VS_0_PBcfg.h are different"
  80. #endif
  81. /* Check if the files Port_Cfg.h and Port_Ci_Port_Ip_Types.h are of the same version */
  82. #if (PORT_VENDOR_ID_CFG_H != PORT_CI_PORT_IP_VENDOR_ID_TYPES_H)
  83. #error "Port_Cfg.h and Port_Ci_Port_Ip_Types.h have different vendor IDs"
  84. #endif
  85. /* Check if the files Port_Cfg.h and Port_Ci_Port_Ip_Types.h are of the same Autosar version */
  86. #if ((PORT_AR_RELEASE_MAJOR_VERSION_CFG_H != PORT_CI_PORT_IP_AR_RELEASE_MAJOR_VERSION_TYPES_H) || \
  87. (PORT_AR_RELEASE_MINOR_VERSION_CFG_H != PORT_CI_PORT_IP_AR_RELEASE_MINOR_VERSION_TYPES_H) || \
  88. (PORT_AR_RELEASE_REVISION_VERSION_CFG_H != PORT_CI_PORT_IP_AR_RELEASE_REVISION_VERSION_TYPES_H) \
  89. )
  90. #error "AutoSar Version Numbers of Port_Cfg.h and Port_Ci_Port_Ip_Types.h are different"
  91. #endif
  92. /* Check if the files Port_Cfg.h and Port_Ci_Port_Ip_Types.h are of the same software version */
  93. #if ((PORT_SW_MAJOR_VERSION_CFG_H != PORT_CI_PORT_IP_SW_MAJOR_VERSION_TYPES_H) || \
  94. (PORT_SW_MINOR_VERSION_CFG_H != PORT_CI_PORT_IP_SW_MINOR_VERSION_TYPES_H) || \
  95. (PORT_SW_PATCH_VERSION_CFG_H != PORT_CI_PORT_IP_SW_PATCH_VERSION_TYPES_H) \
  96. )
  97. #error "Software Version Numbers of Port_Cfg.h and Port_Ci_Port_Ip_Types.h are different"
  98. #endif
  99. /*=================================================================================================
  100. * CONSTANTS
  101. =================================================================================================*/
  102. /* @implements Port_PinType_typedef */
  103. typedef uint32 Port_PinType;
  104. /**
  105. * @brief Different port pin modes.
  106. * @details A port pin shall be configurable with a number of port pin modes (type Port_PinModeType).
  107. * The type Port_PinModeType shall be used with the function call Port_SetPinMode
  108. * @implements Port_PinModeType_typedef
  109. */
  110. typedef uint8 Port_PinModeType;
  111. /**
  112. * @brief Possible directions of a port pin.
  113. * @implements Port_PinDirectionType_enumeration
  114. */
  115. typedef enum
  116. {
  117. PORT_PIN_DISABLED = 0, /**< @brief Sets port pin as bidirectional. */
  118. PORT_PIN_IN, /**< @brief Sets port pin as input. */
  119. PORT_PIN_OUT, /**< @brief Sets port pin as output. */
  120. PORT_PIN_HIGH_Z /**< @brief Sets port pin as high_z. */
  121. } Port_PinDirectionType;
  122. /*=================================================================================================
  123. * DEFINES AND MACROS
  124. =================================================================================================*/
  125. #define PORT_CONFIG_EXT \
  126. PORT_CONFIG_VS_0_PB \
  127. /**
  128. * @brief Ensure better readability of the configuration
  129. * @note
  130. */
  131. #define SHL_PAD_U16(x) ((uint16)(((uint16)1) << (x)))
  132. /** @brief Port Alternate 0 Mode */
  133. #define PORT_ALT0_FUNC_MODE ((Port_PinModeType)0)
  134. /** @brief Port GPIO Mode */
  135. #define PORT_GPIO_MODE ((Port_PinModeType)1)
  136. /** @brief Port Alternate 2 Mode */
  137. #define PORT_ALT2_FUNC_MODE ((Port_PinModeType)2)
  138. /** @brief Port Alternate 3 Mode */
  139. #define PORT_ALT3_FUNC_MODE ((Port_PinModeType)3)
  140. /** @brief Port Alternate 4 Mode */
  141. #define PORT_ALT4_FUNC_MODE ((Port_PinModeType)4)
  142. /** @brief Port Alternate 5 Mode */
  143. #define PORT_ALT5_FUNC_MODE ((Port_PinModeType)5)
  144. /** @brief Port Alternate 6 Mode */
  145. #define PORT_ALT6_FUNC_MODE ((Port_PinModeType)6)
  146. /** @brief Port Alternate 7 Mode */
  147. #define PORT_ALT7_FUNC_MODE ((Port_PinModeType)7)
  148. #define PORT0_ADC0_SE0_CMP0_IN0 (PORT_ALT0_FUNC_MODE)
  149. #define PORT0_GPIO (PORT_GPIO_MODE)
  150. #define PORT0_FTM2_CH1 (PORT_ALT2_FUNC_MODE)
  151. #define PORT0_LPI2C0_SCLS (PORT_ALT3_FUNC_MODE)
  152. #define PORT0_FXIO_D2 (PORT_ALT4_FUNC_MODE)
  153. #define PORT0_FTM2_QD_PHA (PORT_ALT5_FUNC_MODE)
  154. #define PORT0_LPUART0_CTS (PORT_ALT6_FUNC_MODE)
  155. #define PORT0_TRGMUX_OUT3 (PORT_ALT7_FUNC_MODE)
  156. #define PORT1_ADC0_SE1_CMP0_IN1 (PORT_ALT0_FUNC_MODE)
  157. #define PORT1_GPIO (PORT_GPIO_MODE)
  158. #define PORT1_FTM1_CH1 (PORT_ALT2_FUNC_MODE)
  159. #define PORT1_LPI2C0_SDAS (PORT_ALT3_FUNC_MODE)
  160. #define PORT1_FXIO_D3 (PORT_ALT4_FUNC_MODE)
  161. #define PORT1_FTM1_QD_PHA (PORT_ALT5_FUNC_MODE)
  162. #define PORT1_LPUART0_RTS (PORT_ALT6_FUNC_MODE)
  163. #define PORT1_TRGMUX_OUT0 (PORT_ALT7_FUNC_MODE)
  164. #define PORT2_ADC1_SE0 (PORT_ALT0_FUNC_MODE)
  165. #define PORT2_GPIO (PORT_GPIO_MODE)
  166. #define PORT2_FTM3_CH0 (PORT_ALT2_FUNC_MODE)
  167. #define PORT2_LPI2C0_SDA (PORT_ALT3_FUNC_MODE)
  168. #define PORT2_EWM_OUT_b (PORT_ALT4_FUNC_MODE)
  169. #define PORT2_FXIO_D4 (PORT_ALT5_FUNC_MODE)
  170. #define PORT2_LPUART0_RX (PORT_ALT6_FUNC_MODE)
  171. #define PORT3_ADC1_SE1 (PORT_ALT0_FUNC_MODE)
  172. #define PORT3_GPIO (PORT_GPIO_MODE)
  173. #define PORT3_FTM3_CH1 (PORT_ALT2_FUNC_MODE)
  174. #define PORT3_LPI2C0_SCL (PORT_ALT3_FUNC_MODE)
  175. #define PORT3_EWM_IN (PORT_ALT4_FUNC_MODE)
  176. #define PORT3_FXIO_D5 (PORT_ALT5_FUNC_MODE)
  177. #define PORT3_LPUART0_TX (PORT_ALT6_FUNC_MODE)
  178. #define PORT4_DISABLED (PORT_ALT0_FUNC_MODE)
  179. #define PORT4_GPIO (PORT_GPIO_MODE)
  180. #define PORT4_CMP0_OUT (PORT_ALT4_FUNC_MODE)
  181. #define PORT4_EWM_OUT_b (PORT_ALT5_FUNC_MODE)
  182. #define PORT4_JTAG_TMS_SWD_DIO (PORT_ALT7_FUNC_MODE)
  183. #define PORT5_DISABLED (PORT_ALT0_FUNC_MODE)
  184. #define PORT5_GPIO (PORT_GPIO_MODE)
  185. #define PORT5_TCLK1 (PORT_ALT3_FUNC_MODE)
  186. #define PORT5_RESET_b (PORT_ALT7_FUNC_MODE)
  187. #define PORT6_ADC0_SE2 (PORT_ALT0_FUNC_MODE)
  188. #define PORT6_GPIO (PORT_GPIO_MODE)
  189. #define PORT6_FTM0_FLT1 (PORT_ALT2_FUNC_MODE)
  190. #define PORT6_LPSPI1_PCS1 (PORT_ALT3_FUNC_MODE)
  191. #define PORT6_LPUART1_CTS (PORT_ALT6_FUNC_MODE)
  192. #define PORT7_ADC0_SE3 (PORT_ALT0_FUNC_MODE)
  193. #define PORT7_GPIO (PORT_GPIO_MODE)
  194. #define PORT7_FTM0_FLT2 (PORT_ALT2_FUNC_MODE)
  195. #define PORT7_RTC_CLKIN (PORT_ALT4_FUNC_MODE)
  196. #define PORT7_LPUART1_RTS (PORT_ALT6_FUNC_MODE)
  197. #define PORT10_DISABLED (PORT_ALT0_FUNC_MODE)
  198. #define PORT10_GPIO (PORT_GPIO_MODE)
  199. #define PORT10_FTM1_CH4 (PORT_ALT2_FUNC_MODE)
  200. #define PORT10_FXIO_D0 (PORT_ALT4_FUNC_MODE)
  201. #define PORT10_JTAG_TDO (PORT_ALT7_FUNC_MODE)
  202. #define PORT11_DISABLED (PORT_ALT0_FUNC_MODE)
  203. #define PORT11_GPIO (PORT_GPIO_MODE)
  204. #define PORT11_FTM1_CH5 (PORT_ALT2_FUNC_MODE)
  205. #define PORT11_FXIO_D1 (PORT_ALT4_FUNC_MODE)
  206. #define PORT11_CMP0_RRT (PORT_ALT5_FUNC_MODE)
  207. #define PORT12_DISABLED (PORT_ALT0_FUNC_MODE)
  208. #define PORT12_GPIO (PORT_GPIO_MODE)
  209. #define PORT12_FTM1_CH6 (PORT_ALT2_FUNC_MODE)
  210. #define PORT12_CAN1_RX (PORT_ALT3_FUNC_MODE)
  211. #define PORT12_FTM2_QD_PHB (PORT_ALT6_FUNC_MODE)
  212. #define PORT13_DISABLED (PORT_ALT0_FUNC_MODE)
  213. #define PORT13_GPIO (PORT_GPIO_MODE)
  214. #define PORT13_FTM1_CH7 (PORT_ALT2_FUNC_MODE)
  215. #define PORT13_CAN1_TX (PORT_ALT3_FUNC_MODE)
  216. #define PORT13_FTM2_QD_PHA (PORT_ALT6_FUNC_MODE)
  217. #define PORT32_ADC0_SE4_ADC1_SE14 (PORT_ALT0_FUNC_MODE)
  218. #define PORT32_GPIO (PORT_GPIO_MODE)
  219. #define PORT32_LPUART0_RX (PORT_ALT2_FUNC_MODE)
  220. #define PORT32_LPSPI0_PCS0 (PORT_ALT3_FUNC_MODE)
  221. #define PORT32_LPTMR0_ALT3 (PORT_ALT4_FUNC_MODE)
  222. #define PORT32_CAN0_RX (PORT_ALT5_FUNC_MODE)
  223. #define PORT33_ADC0_SE5_ADC1_SE15 (PORT_ALT0_FUNC_MODE)
  224. #define PORT33_GPIO (PORT_GPIO_MODE)
  225. #define PORT33_LPUART0_TX (PORT_ALT2_FUNC_MODE)
  226. #define PORT33_LPSPI0_SOUT (PORT_ALT3_FUNC_MODE)
  227. #define PORT33_TCLK0 (PORT_ALT4_FUNC_MODE)
  228. #define PORT33_CAN0_TX (PORT_ALT5_FUNC_MODE)
  229. #define PORT34_ADC0_SE6 (PORT_ALT0_FUNC_MODE)
  230. #define PORT34_GPIO (PORT_GPIO_MODE)
  231. #define PORT34_FTM1_CH0 (PORT_ALT2_FUNC_MODE)
  232. #define PORT34_LPSPI0_SCK (PORT_ALT3_FUNC_MODE)
  233. #define PORT34_FTM1_QD_PHB (PORT_ALT4_FUNC_MODE)
  234. #define PORT34_TRGMUX_IN3 (PORT_ALT6_FUNC_MODE)
  235. #define PORT35_ADC0_SE7 (PORT_ALT0_FUNC_MODE)
  236. #define PORT35_GPIO (PORT_GPIO_MODE)
  237. #define PORT35_FTM1_CH1 (PORT_ALT2_FUNC_MODE)
  238. #define PORT35_LPSPI0_SIN (PORT_ALT3_FUNC_MODE)
  239. #define PORT35_FTM1_QD_PHA (PORT_ALT4_FUNC_MODE)
  240. #define PORT35_TRGMUX_IN2 (PORT_ALT6_FUNC_MODE)
  241. #define PORT36_DISABLED (PORT_ALT0_FUNC_MODE)
  242. #define PORT36_GPIO (PORT_GPIO_MODE)
  243. #define PORT36_FTM0_CH4 (PORT_ALT2_FUNC_MODE)
  244. #define PORT36_LPSPI0_SOUT (PORT_ALT3_FUNC_MODE)
  245. #define PORT36_TRGMUX_IN1 (PORT_ALT6_FUNC_MODE)
  246. #define PORT37_DISABLED (PORT_ALT0_FUNC_MODE)
  247. #define PORT37_GPIO (PORT_GPIO_MODE)
  248. #define PORT37_FTM0_CH5 (PORT_ALT2_FUNC_MODE)
  249. #define PORT37_LPSPI0_PCS1 (PORT_ALT3_FUNC_MODE)
  250. #define PORT37_LPSPI0_PCS0 (PORT_ALT4_FUNC_MODE)
  251. #define PORT37_CLKOUT (PORT_ALT5_FUNC_MODE)
  252. #define PORT37_TRGMUX_IN0 (PORT_ALT6_FUNC_MODE)
  253. #define PORT38_XTAL (PORT_ALT0_FUNC_MODE)
  254. #define PORT38_GPIO (PORT_GPIO_MODE)
  255. #define PORT38_LPI2C0_SDA (PORT_ALT2_FUNC_MODE)
  256. #define PORT39_EXTAL (PORT_ALT0_FUNC_MODE)
  257. #define PORT39_GPIO (PORT_GPIO_MODE)
  258. #define PORT39_LPI2C0_SCL (PORT_ALT2_FUNC_MODE)
  259. #define PORT44_ADC1_SE7 (PORT_ALT0_FUNC_MODE)
  260. #define PORT44_GPIO (PORT_GPIO_MODE)
  261. #define PORT44_FTM0_CH0 (PORT_ALT2_FUNC_MODE)
  262. #define PORT44_FTM3_FLT2 (PORT_ALT3_FUNC_MODE)
  263. #define PORT44_CAN2_RX (PORT_ALT4_FUNC_MODE)
  264. #define PORT45_ADC1_SE8_ADC0_SE8 (PORT_ALT0_FUNC_MODE)
  265. #define PORT45_GPIO (PORT_GPIO_MODE)
  266. #define PORT45_FTM0_CH1 (PORT_ALT2_FUNC_MODE)
  267. #define PORT45_FTM3_FLT1 (PORT_ALT3_FUNC_MODE)
  268. #define PORT45_CAN2_TX (PORT_ALT4_FUNC_MODE)
  269. #define PORT64_ADC0_SE8 (PORT_ALT0_FUNC_MODE)
  270. #define PORT64_GPIO (PORT_GPIO_MODE)
  271. #define PORT64_FTM0_CH0 (PORT_ALT2_FUNC_MODE)
  272. #define PORT64_LPSPI2_SIN (PORT_ALT3_FUNC_MODE)
  273. #define PORT64_FTM1_CH6 (PORT_ALT6_FUNC_MODE)
  274. #define PORT65_ADC0_SE9 (PORT_ALT0_FUNC_MODE)
  275. #define PORT65_GPIO (PORT_GPIO_MODE)
  276. #define PORT65_FTM0_CH1 (PORT_ALT2_FUNC_MODE)
  277. #define PORT65_LPSPI2_SOUT (PORT_ALT3_FUNC_MODE)
  278. #define PORT65_FTM1_CH7 (PORT_ALT6_FUNC_MODE)
  279. #define PORT66_ADC0_SE10_CMP0_IN5 (PORT_ALT0_FUNC_MODE)
  280. #define PORT66_GPIO (PORT_GPIO_MODE)
  281. #define PORT66_FTM0_CH2 (PORT_ALT2_FUNC_MODE)
  282. #define PORT66_CAN0_RX (PORT_ALT3_FUNC_MODE)
  283. #define PORT66_LPUART0_RX (PORT_ALT4_FUNC_MODE)
  284. #define PORT67_ADC0_SE11_CMP0_IN4 (PORT_ALT0_FUNC_MODE)
  285. #define PORT67_GPIO (PORT_GPIO_MODE)
  286. #define PORT67_FTM0_CH3 (PORT_ALT2_FUNC_MODE)
  287. #define PORT67_CAN0_TX (PORT_ALT3_FUNC_MODE)
  288. #define PORT67_LPUART0_TX (PORT_ALT4_FUNC_MODE)
  289. #define PORT68_CMP0_IN2 (PORT_ALT0_FUNC_MODE)
  290. #define PORT68_GPIO (PORT_GPIO_MODE)
  291. #define PORT68_FTM1_CH0 (PORT_ALT2_FUNC_MODE)
  292. #define PORT68_RTC_CLKOUT (PORT_ALT3_FUNC_MODE)
  293. #define PORT68_EWM_IN (PORT_ALT5_FUNC_MODE)
  294. #define PORT68_FTM1_QD_PHB (PORT_ALT6_FUNC_MODE)
  295. #define PORT68_JTAG_TCLK_SWD_CLK (PORT_ALT7_FUNC_MODE)
  296. #define PORT69_DISABLED (PORT_ALT0_FUNC_MODE)
  297. #define PORT69_GPIO (PORT_GPIO_MODE)
  298. #define PORT69_FTM2_CH0 (PORT_ALT2_FUNC_MODE)
  299. #define PORT69_RTC_CLKOUT (PORT_ALT3_FUNC_MODE)
  300. #define PORT69_FTM2_QD_PHB (PORT_ALT6_FUNC_MODE)
  301. #define PORT69_JTAG_TDI (PORT_ALT7_FUNC_MODE)
  302. #define PORT70_ADC1_SE4 (PORT_ALT0_FUNC_MODE)
  303. #define PORT70_GPIO (PORT_GPIO_MODE)
  304. #define PORT70_LPUART1_RX (PORT_ALT2_FUNC_MODE)
  305. #define PORT70_CAN1_RX (PORT_ALT3_FUNC_MODE)
  306. #define PORT70_FTM3_CH2 (PORT_ALT4_FUNC_MODE)
  307. #define PORT70_FTM1_QD_PHB (PORT_ALT6_FUNC_MODE)
  308. #define PORT71_ADC1_SE5 (PORT_ALT0_FUNC_MODE)
  309. #define PORT71_GPIO (PORT_GPIO_MODE)
  310. #define PORT71_LPUART1_TX (PORT_ALT2_FUNC_MODE)
  311. #define PORT71_CAN1_TX (PORT_ALT3_FUNC_MODE)
  312. #define PORT71_FTM3_CH3 (PORT_ALT4_FUNC_MODE)
  313. #define PORT71_FTM1_QD_PHA (PORT_ALT6_FUNC_MODE)
  314. #define PORT72_DISABLED (PORT_ALT0_FUNC_MODE)
  315. #define PORT72_GPIO (PORT_GPIO_MODE)
  316. #define PORT72_LPUART1_RX (PORT_ALT2_FUNC_MODE)
  317. #define PORT72_FTM1_FLT0 (PORT_ALT3_FUNC_MODE)
  318. #define PORT72_LPUART0_CTS (PORT_ALT6_FUNC_MODE)
  319. #define PORT73_DISABLED (PORT_ALT0_FUNC_MODE)
  320. #define PORT73_GPIO (PORT_GPIO_MODE)
  321. #define PORT73_LPUART1_TX (PORT_ALT2_FUNC_MODE)
  322. #define PORT73_FTM1_FLT1 (PORT_ALT3_FUNC_MODE)
  323. #define PORT73_LPUART0_RTS (PORT_ALT6_FUNC_MODE)
  324. #define PORT78_ADC0_SE12 (PORT_ALT0_FUNC_MODE)
  325. #define PORT78_GPIO (PORT_GPIO_MODE)
  326. #define PORT78_FTM1_CH2 (PORT_ALT2_FUNC_MODE)
  327. #define PORT78_LPSPI2_PCS0 (PORT_ALT3_FUNC_MODE)
  328. #define PORT78_TRGMUX_IN9 (PORT_ALT6_FUNC_MODE)
  329. #define PORT79_ADC0_SE13 (PORT_ALT0_FUNC_MODE)
  330. #define PORT79_GPIO (PORT_GPIO_MODE)
  331. #define PORT79_FTM1_CH3 (PORT_ALT2_FUNC_MODE)
  332. #define PORT79_LPSPI2_SCK (PORT_ALT3_FUNC_MODE)
  333. #define PORT79_TRGMUX_IN8 (PORT_ALT6_FUNC_MODE)
  334. #define PORT80_ADC0_SE14 (PORT_ALT0_FUNC_MODE)
  335. #define PORT80_GPIO (PORT_GPIO_MODE)
  336. #define PORT80_FTM1_FLT2 (PORT_ALT2_FUNC_MODE)
  337. #define PORT80_CAN2_RX (PORT_ALT3_FUNC_MODE)
  338. #define PORT81_ADC0_SE15 (PORT_ALT0_FUNC_MODE)
  339. #define PORT81_GPIO (PORT_GPIO_MODE)
  340. #define PORT81_FTM1_FLT3 (PORT_ALT2_FUNC_MODE)
  341. #define PORT81_CAN2_TX (PORT_ALT3_FUNC_MODE)
  342. #define PORT96_DISABLED (PORT_ALT0_FUNC_MODE)
  343. #define PORT96_GPIO (PORT_GPIO_MODE)
  344. #define PORT96_FTM0_CH2 (PORT_ALT2_FUNC_MODE)
  345. #define PORT96_LPSPI1_SCK (PORT_ALT3_FUNC_MODE)
  346. #define PORT96_FTM2_CH0 (PORT_ALT4_FUNC_MODE)
  347. #define PORT96_FXIO_D0 (PORT_ALT6_FUNC_MODE)
  348. #define PORT96_TRGMUX_OUT1 (PORT_ALT7_FUNC_MODE)
  349. #define PORT97_DISABLED (PORT_ALT0_FUNC_MODE)
  350. #define PORT97_GPIO (PORT_GPIO_MODE)
  351. #define PORT97_FTM0_CH3 (PORT_ALT2_FUNC_MODE)
  352. #define PORT97_LPSPI1_SIN (PORT_ALT3_FUNC_MODE)
  353. #define PORT97_FTM2_CH1 (PORT_ALT4_FUNC_MODE)
  354. #define PORT97_FXIO_D1 (PORT_ALT6_FUNC_MODE)
  355. #define PORT97_TRGMUX_OUT2 (PORT_ALT7_FUNC_MODE)
  356. #define PORT98_ADC1_SE2 (PORT_ALT0_FUNC_MODE)
  357. #define PORT98_GPIO (PORT_GPIO_MODE)
  358. #define PORT98_FTM3_CH4 (PORT_ALT2_FUNC_MODE)
  359. #define PORT98_LPSPI1_SOUT (PORT_ALT3_FUNC_MODE)
  360. #define PORT98_FXIO_D4 (PORT_ALT4_FUNC_MODE)
  361. #define PORT98_FXIO_D6 (PORT_ALT5_FUNC_MODE)
  362. #define PORT98_TRGMUX_IN5 (PORT_ALT6_FUNC_MODE)
  363. #define PORT99_ADC1_SE3 (PORT_ALT0_FUNC_MODE)
  364. #define PORT99_GPIO (PORT_GPIO_MODE)
  365. #define PORT99_FTM3_CH5 (PORT_ALT2_FUNC_MODE)
  366. #define PORT99_LPSPI1_PCS0 (PORT_ALT3_FUNC_MODE)
  367. #define PORT99_FXIO_D5 (PORT_ALT4_FUNC_MODE)
  368. #define PORT99_FXIO_D7 (PORT_ALT5_FUNC_MODE)
  369. #define PORT99_TRGMUX_IN4 (PORT_ALT6_FUNC_MODE)
  370. #define PORT99_NMI_b (PORT_ALT7_FUNC_MODE)
  371. #define PORT100_ADC1_SE6 (PORT_ALT0_FUNC_MODE)
  372. #define PORT100_GPIO (PORT_GPIO_MODE)
  373. #define PORT100_FTM0_FLT3 (PORT_ALT2_FUNC_MODE)
  374. #define PORT100_FTM3_FLT3 (PORT_ALT3_FUNC_MODE)
  375. #define PORT101_DISABLED (PORT_ALT0_FUNC_MODE)
  376. #define PORT101_GPIO (PORT_GPIO_MODE)
  377. #define PORT101_FTM2_CH3 (PORT_ALT2_FUNC_MODE)
  378. #define PORT101_LPTMR0_ALT2 (PORT_ALT3_FUNC_MODE)
  379. #define PORT101_FTM2_FLT1 (PORT_ALT4_FUNC_MODE)
  380. #define PORT101_TRGMUX_IN7 (PORT_ALT6_FUNC_MODE)
  381. #define PORT102_CMP0_IN7 (PORT_ALT0_FUNC_MODE)
  382. #define PORT102_GPIO (PORT_GPIO_MODE)
  383. #define PORT102_LPUART2_RX (PORT_ALT2_FUNC_MODE)
  384. #define PORT102_FTM2_FLT2 (PORT_ALT4_FUNC_MODE)
  385. #define PORT103_CMP0_IN6 (PORT_ALT0_FUNC_MODE)
  386. #define PORT103_GPIO (PORT_GPIO_MODE)
  387. #define PORT103_LPUART2_TX (PORT_ALT2_FUNC_MODE)
  388. #define PORT103_FTM2_FLT3 (PORT_ALT4_FUNC_MODE)
  389. #define PORT111_DISABLED (PORT_ALT0_FUNC_MODE)
  390. #define PORT111_GPIO (PORT_GPIO_MODE)
  391. #define PORT111_FTM0_CH0 (PORT_ALT2_FUNC_MODE)
  392. #define PORT111_LPSPI0_SCK (PORT_ALT4_FUNC_MODE)
  393. #define PORT112_DISABLED (PORT_ALT0_FUNC_MODE)
  394. #define PORT112_GPIO (PORT_GPIO_MODE)
  395. #define PORT112_FTM0_CH1 (PORT_ALT2_FUNC_MODE)
  396. #define PORT112_LPSPI0_SIN (PORT_ALT4_FUNC_MODE)
  397. #define PORT112_CMP0_RRT (PORT_ALT5_FUNC_MODE)
  398. #define PORT128_DISABLED (PORT_ALT0_FUNC_MODE)
  399. #define PORT128_GPIO (PORT_GPIO_MODE)
  400. #define PORT128_LPSPI0_SCK (PORT_ALT2_FUNC_MODE)
  401. #define PORT128_TCLK1 (PORT_ALT3_FUNC_MODE)
  402. #define PORT128_LPSPI1_SOUT (PORT_ALT5_FUNC_MODE)
  403. #define PORT128_FTM1_FLT2 (PORT_ALT6_FUNC_MODE)
  404. #define PORT129_DISABLED (PORT_ALT0_FUNC_MODE)
  405. #define PORT129_GPIO (PORT_GPIO_MODE)
  406. #define PORT129_LPSPI0_SIN (PORT_ALT2_FUNC_MODE)
  407. #define PORT129_LPI2C0_HREQ (PORT_ALT3_FUNC_MODE)
  408. #define PORT129_LPSPI1_PCS0 (PORT_ALT5_FUNC_MODE)
  409. #define PORT129_FTM1_FLT1 (PORT_ALT6_FUNC_MODE)
  410. #define PORT130_ADC1_SE10 (PORT_ALT0_FUNC_MODE)
  411. #define PORT130_GPIO (PORT_GPIO_MODE)
  412. #define PORT130_LPSPI0_SOUT (PORT_ALT2_FUNC_MODE)
  413. #define PORT130_LPTMR0_ALT3 (PORT_ALT3_FUNC_MODE)
  414. #define PORT130_FTM3_CH6 (PORT_ALT4_FUNC_MODE)
  415. #define PORT130_LPUART1_CTS (PORT_ALT6_FUNC_MODE)
  416. #define PORT131_DISABLED (PORT_ALT0_FUNC_MODE)
  417. #define PORT131_GPIO (PORT_GPIO_MODE)
  418. #define PORT131_FTM0_FLT0 (PORT_ALT2_FUNC_MODE)
  419. #define PORT131_LPUART2_RTS (PORT_ALT3_FUNC_MODE)
  420. #define PORT131_FTM2_FLT0 (PORT_ALT4_FUNC_MODE)
  421. #define PORT131_TRGMUX_IN6 (PORT_ALT6_FUNC_MODE)
  422. #define PORT131_CMP0_OUT (PORT_ALT7_FUNC_MODE)
  423. #define PORT132_DISABLED (PORT_ALT0_FUNC_MODE)
  424. #define PORT132_GPIO (PORT_GPIO_MODE)
  425. #define PORT132_FTM2_QD_PHB (PORT_ALT3_FUNC_MODE)
  426. #define PORT132_FTM2_CH2 (PORT_ALT4_FUNC_MODE)
  427. #define PORT132_CAN0_RX (PORT_ALT5_FUNC_MODE)
  428. #define PORT132_FXIO_D6 (PORT_ALT6_FUNC_MODE)
  429. #define PORT132_EWM_OUT_b (PORT_ALT7_FUNC_MODE)
  430. #define PORT133_DISABLED (PORT_ALT0_FUNC_MODE)
  431. #define PORT133_GPIO (PORT_GPIO_MODE)
  432. #define PORT133_TCLK2 (PORT_ALT2_FUNC_MODE)
  433. #define PORT133_FTM2_QD_PHA (PORT_ALT3_FUNC_MODE)
  434. #define PORT133_FTM2_CH3 (PORT_ALT4_FUNC_MODE)
  435. #define PORT133_CAN0_TX (PORT_ALT5_FUNC_MODE)
  436. #define PORT133_FXIO_D7 (PORT_ALT6_FUNC_MODE)
  437. #define PORT133_EWM_IN (PORT_ALT7_FUNC_MODE)
  438. #define PORT134_ADC1_SE11 (PORT_ALT0_FUNC_MODE)
  439. #define PORT134_GPIO (PORT_GPIO_MODE)
  440. #define PORT134_LPSPI0_PCS2 (PORT_ALT2_FUNC_MODE)
  441. #define PORT134_FTM3_CH7 (PORT_ALT4_FUNC_MODE)
  442. #define PORT134_LPUART1_RTS (PORT_ALT6_FUNC_MODE)
  443. #define PORT135_DISABLED (PORT_ALT0_FUNC_MODE)
  444. #define PORT135_GPIO (PORT_GPIO_MODE)
  445. #define PORT135_FTM0_CH7 (PORT_ALT2_FUNC_MODE)
  446. #define PORT135_FTM3_FLT0 (PORT_ALT3_FUNC_MODE)
  447. #define PORT136_CMP0_IN3 (PORT_ALT0_FUNC_MODE)
  448. #define PORT136_GPIO (PORT_GPIO_MODE)
  449. #define PORT136_FTM0_CH6 (PORT_ALT2_FUNC_MODE)
  450. #define PORT137_DISABLED (PORT_ALT0_FUNC_MODE)
  451. #define PORT137_GPIO (PORT_GPIO_MODE)
  452. #define PORT137_FTM0_CH7 (PORT_ALT2_FUNC_MODE)
  453. #define PORT137_LPUART2_CTS (PORT_ALT3_FUNC_MODE)
  454. #define PORT138_DISABLED (PORT_ALT0_FUNC_MODE)
  455. #define PORT138_GPIO (PORT_GPIO_MODE)
  456. #define PORT138_CLKOUT (PORT_ALT2_FUNC_MODE)
  457. #define PORT138_LPSPI2_PCS1 (PORT_ALT3_FUNC_MODE)
  458. #define PORT138_FTM2_CH4 (PORT_ALT4_FUNC_MODE)
  459. #define PORT138_FXIO_D4 (PORT_ALT6_FUNC_MODE)
  460. #define PORT138_TRGMUX_OUT4 (PORT_ALT7_FUNC_MODE)
  461. #define PORT139_DISABLED (PORT_ALT0_FUNC_MODE)
  462. #define PORT139_GPIO (PORT_GPIO_MODE)
  463. #define PORT139_LPSPI2_PCS0 (PORT_ALT2_FUNC_MODE)
  464. #define PORT139_LPTMR0_ALT1 (PORT_ALT3_FUNC_MODE)
  465. #define PORT139_FTM2_CH5 (PORT_ALT4_FUNC_MODE)
  466. #define PORT139_FXIO_D5 (PORT_ALT6_FUNC_MODE)
  467. #define PORT139_TRGMUX_OUT5 (PORT_ALT7_FUNC_MODE)
  468. /**
  469. * @brief Enable/Disable Development Error Detection
  470. *
  471. * @implements PORT_DEV_ERROR_DETECT_define
  472. */
  473. #define PORT_DEV_ERROR_DETECT (STD_ON)
  474. /**
  475. * @brief Use/remove Port_SetPinDirection function from the compiled driver
  476. *
  477. * @implements PORT_SET_PIN_DIRECTION_API_define
  478. */
  479. #define PORT_SET_PIN_DIRECTION_API (STD_ON)
  480. /**
  481. * @brief Use/remove Port_Set2PinsDirection function from the compiled driver
  482. *
  483. * PORT_SET_2_PINS_DIRECTION_API_define
  484. */
  485. #define PORT_SET_2_PINS_DIRECTION_API (STD_OFF)
  486. /**
  487. * @brief Enable/Disable multicore function from the driver
  488. */
  489. #define PORT_MULTICORE_ENABLED (STD_OFF)
  490. /**
  491. * @brief Use/remove Port_SetPinMode function from the compiled driver
  492. *
  493. * @implements PORT_SET_PIN_MODE_API_define
  494. */
  495. #define PORT_SET_PIN_MODE_API (STD_ON)
  496. /**
  497. * @brief Use/remove Port_SetAsUnusedPin/Port_SetAsUsedPin function from the compiled driver.
  498. *
  499. */
  500. #define PORT_SET_AS_UNUSED_PIN_API (STD_OFF)
  501. /**
  502. * @brief Use/remove Port_ResetPinMode function from the compiled driver.
  503. *
  504. */
  505. #define PORT_RESET_PIN_MODE_API (STD_OFF)
  506. /**
  507. * @brief Enable/Disable Port_SetPinMode function updating the output level of the pins configured at runtime as GPIO
  508. */
  509. #define PORT_SETPINMODE_DOES_NOT_TOUCH_GPIO_LEVEL (STD_OFF)
  510. /**
  511. * @brief Use/remove Port_GetVersionInfo function from the compiled driver
  512. *
  513. * @implements PORT_VERSION_INFO_API_define
  514. */
  515. #define PORT_VERSION_INFO_API (STD_ON)
  516. /**
  517. * @brief The number of configured partition on the platform
  518. */
  519. #define PORT_MAX_PARTITION (1U)
  520. /**
  521. * @brief Port Pin symbolic names
  522. * @details Get All Symbolic Names from configuration tool
  523. *
  524. */
  525. #define PortConfigSet_PortContainer_LPUART_PTC3_LPUART0_TX_MCU_TXD0_TX 0
  526. #define PortConfigSet_PortContainer_LPUART_PTC2_LPUART0_RX_MCU_RXD0_RX 1
  527. #define PortConfigSet_PortContainer_LPUART_PTC9_LPUART1_TX_MCU_WIFI_TX 2
  528. #define PortConfigSet_PortContainer_LPUART_PTC8_LPUART1_RX_MCU_WIFI_RX 3
  529. #define PortConfigSet_PortContainer_LPUART_PTD7_LPUART2_TX_MCU_BT_TX 4
  530. #define PortConfigSet_PortContainer_LPUART_PTD6_LPUART2_RX_MCU_BT_RX 5
  531. #define PortConfigSet_PortContainer_CAN_PTE5_CAN0_TX_MCU_CAN0_TX 6
  532. #define PortConfigSet_PortContainer_CAN_PTE4_CAN0_RX_MCU_CAN0_RX 7
  533. #define PortConfigSet_PortContainer_GPIO_PTD16_GPIO_OUT_MCU_WIFI_POW_EN 8
  534. #define PortConfigSet_PortContainer_GPIO_PTD15_GPIO_OUT_MCU_WIFI_RESET 9
  535. #define PortConfigSet_PortContainer_GPIO_PTE9_GPIO_OUT_MCU_BT_POW_EN 10
  536. #define PortConfigSet_PortContainer_GPIO_PTE8_GPIO_OUT_MCU_BT_RESET 11
  537. #define PortConfigSet_PortContainer_GPIO_PTE7_GPIO_OUT_MCU_BT_MOD 12
  538. /**
  539. * @brief Number of available pad modes options
  540. * @details Platform constant
  541. */
  542. #define PAD_MODE_OPTIONS_U8 ((uint8)8)
  543. /**
  544. * @brief Number of pad 16 blocks
  545. * @details Platform constant
  546. */
  547. #define PAD_16BLOCK_NO_U8 ((uint8)9)
  548. /**
  549. * @brief The last supported pin number
  550. */
  551. #define PORT_MAX_PIN_PACKAGE_U16 ((uint16)144)
  552. /**
  553. * @brief The maximum number of configured pins
  554. */
  555. #define PORT_MAX_CONFIGURED_PADS_U16 ((uint16)13)
  556. /**
  557. * @brief Number of UnUsed pin array
  558. */
  559. #define PORT_MAX_UNUSED_PADS_U16 (69U)
  560. /**
  561. * @brief Port driver Pre-Compile configuration switch
  562. */
  563. #define PORT_PRECOMPILE_SUPPORT (STD_ON)
  564. /*=================================================================================================
  565. * ENUMS
  566. =================================================================================================*/
  567. /*=================================================================================================
  568. * STRUCTURES AND OTHER TYPEDEFS
  569. =================================================================================================*/
  570. typedef struct
  571. {
  572. uint32 u32PCR; /**< Content of Mscr Register */
  573. Port_PinDirectionType ePadDir; /**< @brief Pad Data Direction */
  574. uint8 u8PDO; /**< Pad Data Output */
  575. } Port_UnUsedPinConfigType;
  576. /**
  577. * @brief Single pin configuration.
  578. * @details This structure contains all configuration parameters of a single pin
  579. * identified by @p SIUPin.
  580. */
  581. typedef struct
  582. {
  583. uint16 Pin; /**< @brief Index of the pin's Mscr */
  584. uint32 u32PCR; /**< @brief Pad Control Register */
  585. uint8 u8PDO; /**< @brief Pad Data Output */
  586. Port_PinDirectionType ePadDir; /**< @brief Pad Data Direction */
  587. boolean bGPIO; /**< @brief GPIO initial mode*/
  588. boolean bDC; /**< @brief Direction changebility*/
  589. boolean bMC; /**< @brief Mode changebility*/
  590. } Port_PinConfigType;
  591. /**
  592. * @brief Structure needed by @p Port_Init().
  593. * @details The structure @p Port_ConfigType is a type for the external data
  594. * structure containing the initialization data for the PORT Driver.
  595. * @note The user must use the symbolic names defined in the configuration
  596. * tool.
  597. *
  598. * @implements Port_ConfigType_struct
  599. */
  600. typedef struct
  601. {
  602. uint16 u16NumPins; /**< @brief Number of used pads (to be configured) */
  603. uint16 u16NumUnusedPins; /**< @brief Number of unused pads */
  604. const uint16 * pUnusedPads; /**< @brief Unused pad id's array */
  605. const Port_UnUsedPinConfigType * pUnusedPadConfig; /**< @brief Unused pad configuration */
  606. const Port_PinConfigType * pUsedPadConfig; /**< @brief Used pads data configuration */
  607. uint8 u8NumDigitalFilterPorts; /**< @brief Number of configured digital filter ports */
  608. const Port_Ci_Port_Ip_DigitalFilterConfigType * pDigitalFilterConfig; /**< @brief Digital filter ports configuration */
  609. const uint32 *pau32Port_PinToPartitionMap; /**< @brief Pointer to pin partition mapping */
  610. const uint8 *pau8Port_PartitionList; /**< @brief Pointer to used partitions */
  611. const Port_Ci_Port_Ip_PinSettingsConfig *IpConfigPtr; /**< @brief Ip configuration */
  612. } Port_ConfigType;
  613. /*=================================================================================================
  614. GLOBAL VARIABLE DECLARATIONS
  615. =================================================================================================*/
  616. #define PORT_START_SEC_CONST_16
  617. #include "Port_MemMap.h"
  618. #if (STD_ON == PORT_SET_PIN_MODE_API)
  619. /**
  620. * @brief External declaration of the Port pin description array
  621. */
  622. extern const uint16 Port_au16PinDescription[8][9];
  623. #endif
  624. #define PORT_STOP_SEC_CONST_16
  625. #include "Port_MemMap.h"
  626. /*=================================================================================================
  627. * FUNCTION PROTOTYPES
  628. =================================================================================================*/
  629. #ifdef __cplusplus
  630. }
  631. #endif
  632. /** @} */
  633. #endif /* PORT_CFG_H */
  634. /* End of File */