Can_Cfg.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : FLEXCAN
  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. ==================================================================================================*/
  26. /*
  27. @brief The consistency of the configuration must be checked by the configuration tool(s).
  28. @brief (SWS_Can_00022) The code configuration of the Can module is CAN controller specific.
  29. If the CAN controller is sited on-chip, the code generation tool for the Can module is Controller specific.
  30. If the CAN controller is an external device the generation tool must not be Controller specific.
  31. @brief (SWS_Can_00024) The valid values that can be configured are hardware dependent.
  32. Therefore the rules and constraints can't be given in the standard.
  33. The configuration tool is responsible to do a static configuration checking, also regarding dependencies between modules (i.e. Port driver, MCU driver etc.)
  34. */
  35. /*
  36. * @file Can_Cfg.h
  37. */
  38. #ifndef CAN_CFG_H
  39. #define CAN_CFG_H
  40. /**
  41. * @file Can_Cfg.h
  42. * @version 1.0.0
  43. *
  44. * @brief AUTOSAR Can - module interface
  45. * @details Configuration settings generated by user settings.
  46. *
  47. * @addtogroup CAN_DRIVER
  48. * @{
  49. */
  50. #ifdef __cplusplus
  51. extern "C"{
  52. #endif
  53. /**
  54. * @page misra_violations MISRA-C:2012 violations
  55. *
  56. * @section [global]
  57. * Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
  58. * The used compilers use more than 31 chars for identifiers.
  59. *
  60. * @section [global]
  61. * Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name space shall be distinct.
  62. * The used compilers use more than 31 chars for identifiers.
  63. *
  64. * @section [global]
  65. * Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
  66. * The used compilers use more than 31 chars for identifiers.
  67. *
  68. * @section [global]
  69. * Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
  70. * The used compilers use more than 31 chars for identifiers.
  71. *
  72. * @section Can_Cfg_h_REF_1
  73. * Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
  74. * Some macro are required by ASR even they are not use in MCAL layer
  75. *
  76. * @section Can_Cfg_h_REF_2
  77. * Violates MISRA 2012 Advisory Rule 4.9, A function should be used in preference to a function-like macro where they are interchangeable.
  78. * Function like macro are used to reduce code complexity
  79. */
  80. /*==================================================================================================
  81. * INCLUDE FILES
  82. * 1) system and project includes
  83. * 2) needed interfaces from external units
  84. * 3) internal and external interfaces from this unit
  85. ==================================================================================================*/
  86. #include "Can_VS_0_PBcfg.h"
  87. /*==================================================================================================
  88. * SOURCE FILE VERSION INFORMATION
  89. ==================================================================================================*/
  90. /*
  91. * @file Can_Cfg.h
  92. */
  93. #define CAN_VENDOR_ID_CFG_H 43
  94. #define CAN_MODULE_ID_CFG_H 80
  95. #define CAN_AR_RELEASE_MAJOR_VERSION_CFG_H 4
  96. #define CAN_AR_RELEASE_MINOR_VERSION_CFG_H 4
  97. #define CAN_AR_RELEASE_REVISION_VERSION_CFG_H 0
  98. #define CAN_SW_MAJOR_VERSION_CFG_H 1
  99. #define CAN_SW_MINOR_VERSION_CFG_H 0
  100. #define CAN_SW_PATCH_VERSION_CFG_H 0
  101. /*==================================================================================================
  102. * FILE VERSION CHECKS
  103. ==================================================================================================*/
  104. /* Check if header file and Can_VS_0_PBcfg.h configuration header file are of the same vendor */
  105. #if (CAN_VENDOR_ID_VS_0_PBCFG_H != CAN_VENDOR_ID_CFG_H)
  106. #error "Can_VS_0_PBcfg.h and Can_Cfg.h have different vendor IDs"
  107. #endif
  108. /* Check if header file and Can_VS_0_PBcfg.h configuration header file are of the same Autosar version */
  109. #if ((CAN_AR_RELEASE_MAJOR_VERSION_VS_0_PBCFG_H != CAN_AR_RELEASE_MAJOR_VERSION_CFG_H) || \
  110. (CAN_AR_RELEASE_MINOR_VERSION_VS_0_PBCFG_H != CAN_AR_RELEASE_MINOR_VERSION_CFG_H) || \
  111. (CAN_AR_RELEASE_REVISION_VERSION_VS_0_PBCFG_H != CAN_AR_RELEASE_REVISION_VERSION_CFG_H) \
  112. )
  113. #error "AutoSar Version Numbers of Can_VS_0_PBcfg.h and Can_Cfg.h are different"
  114. #endif
  115. /* Check if header file and Can_VS_0_PBcfg.h configuration header file are of the same software version */
  116. #if ((CAN_SW_MAJOR_VERSION_VS_0_PBCFG_H != CAN_SW_MAJOR_VERSION_CFG_H) || \
  117. (CAN_SW_MINOR_VERSION_VS_0_PBCFG_H != CAN_SW_MINOR_VERSION_CFG_H) || \
  118. (CAN_SW_PATCH_VERSION_VS_0_PBCFG_H != CAN_SW_PATCH_VERSION_CFG_H) \
  119. )
  120. #error "Software Version Numbers of Can_VS_0_PBcfg.h and Can_Cfg.h are different"
  121. #endif
  122. /*==================================================================================================
  123. * DEFINES AND MACROS
  124. ==================================================================================================*/
  125. /**
  126. * @brief Enable/Disable Precompile Support
  127. */
  128. #define CAN_PRECOMPILE_SUPPORT (STD_ON)
  129. /**
  130. * @brief Number of Can Controller Support
  131. */
  132. #define CAN_HWCONTROLLER_SUPPORT 3U
  133. /**
  134. * @brief Controller unsed
  135. */
  136. #define CAN_CONTROLLER_UNUSED ((uint8)0xFFU)
  137. /**
  138. * @brief The definition represent for Message buffer index which not assigned for any Hw Object
  139. */
  140. #define CAN_HWOBJ_UNMAPPED ((Can_HwHandleType)0xFFFFU)
  141. /**
  142. * @brief The definition represent for number of ECUC partition configured.
  143. */
  144. #define CAN_MAX_PARTITIONS 1U
  145. /**
  146. * @brief Number Of Hw Message Buffer support
  147. */
  148. #define CAN_HWMB_COUNT ((uint8)32U)
  149. /**
  150. * @brief The definition of TimeStamp Enable Support for Hw Objects
  151. */
  152. #define CAN_TIMESTAMP_ENABLE (STD_OFF)
  153. /**
  154. * @brief The definition used for guarding GetCoreID/Multicore
  155. */
  156. #define CAN_MULTICORE_ENABLED (STD_OFF)
  157. /**
  158. * @brief Define if global variables need to be placed in non-cache area or not
  159. */
  160. #define CAN_NO_CACHE_NEEDED (STD_OFF)
  161. /**
  162. * @brief Enable/Disable Development Error Detection and Notification
  163. */
  164. #define CAN_DEV_ERROR_DETECT (STD_OFF)
  165. /**
  166. * @brief Enable/Disable support Can_GetVersionInfo API
  167. */
  168. #define CAN_VERSION_INFO_API (STD_ON)
  169. /**
  170. * @brief Enable/Disable support Can_SetBaudrate API
  171. */
  172. #define CAN_SET_BAUDRATE_API (STD_ON)
  173. /**
  174. * @brief Enable/Disable support Can_AbortMb API
  175. */
  176. #define CAN_ABORT_MB_API (STD_ON)
  177. /**
  178. * @brief Enable/Disable LPdu Callout Function
  179. */
  180. #define CAN_LPDU_CALLOUT_FUNC_ENABLE (STD_OFF)
  181. /**
  182. * @brief Enable/Disable Extended Range of Can Hw Object
  183. */
  184. #define CAN_MBCOUNTEXTENSION (STD_OFF)
  185. /**
  186. * @brief Instance of the Can Hw unit
  187. */
  188. #define CAN_INSTANCE ((uint8)0U)
  189. /**
  190. * @brief Enable/Disable support Dual Clock Mode
  191. */
  192. #define CAN_DUAL_CLOCK_MODE (STD_OFF)
  193. /**
  194. * @brief Enable/Disable support Listen Only Mode
  195. */
  196. #define CAN_LISTEN_ONLY_MODE (STD_OFF)
  197. /**
  198. * @brief Enable/Disable LPdu Receive callout function support
  199. */
  200. #define CAN_LPDU_CALLOUT_SUPPORT (STD_OFF)
  201. #define CAN_LPDU_CALLOUT_FUNC_CALLED
  202. /**
  203. * @brief Symbolic Name generated for CanMainFunctionRWPeriods
  204. */
  205. #define CanMainFunctionRWPeriods_0 0U
  206. /**
  207. * @brief Period for cyclic call of Main Function Read/Write
  208. */
  209. #define CAN_MAINFUNCTION_MULTIPLE_WRITE (STD_OFF)
  210. #define CAN_MAINFUNCTION_MULTIPLE_READ (STD_OFF)
  211. #define CAN_MAINFUNCTION_READ_PERIOD (0.001F)
  212. #define CAN_MAINFUNCTION_WRITE_PERIOD (0.001F)
  213. /**
  214. * @brief Period for cyclic call of Main Function Mode
  215. */
  216. #define CAN_MAINFUNCTION_MODE_PERIOD (0.001F)
  217. /**
  218. * @brief Period for cyclic call of Main Function Bus Off
  219. */
  220. #define CAN_MAINFUNCTION_BUSOFF_PERIOD (0.001F)
  221. /**
  222. * @brief Supporting Pretended Networking
  223. */
  224. #define CAN_PUBLIC_ICOM_SUPPORT (STD_ON)
  225. /**
  226. * @brief Number Of Can Controller Config
  227. */
  228. #define CAN_CONTROLLER_CONFIG_COUNT (2U)
  229. /**
  230. * @brief Number Of HardwareObject Config
  231. */
  232. #define CAN_HWOBJECT_CONFIG_COUNT ((Can_HwHandleType)4U)
  233. /**
  234. * @brief Symbolic Name generated for Can Controller
  235. */
  236. #define CanController_0 ((uint8)0U)
  237. #define CanController_1 ((uint8)1U)
  238. /**
  239. * @brief Symbolic Name generated for Can HardwareObject
  240. */
  241. #define Can0HardwareObject_RX ((Can_HwHandleType)0U)
  242. #define Can1HardwareObject_RX ((Can_HwHandleType)1U)
  243. #define Can0HardwareObject_TX ((Can_HwHandleType)2U)
  244. #define Can1HardwareObject_TX ((Can_HwHandleType)3U)
  245. /**
  246. * @brief Enable/Disable support Can_CheckWakeup API
  247. */
  248. #define CAN_CHECK_WAKEUP_API (STD_OFF)
  249. /**
  250. * @brief Can Tx Polling support
  251. */
  252. #define CAN_TX_POLLING_SUPPORT (STD_ON)
  253. /**
  254. * @brief Can Rx Polling support
  255. */
  256. #define CAN_RX_POLLING_SUPPORT (STD_ON)
  257. /**
  258. * @brief Can Bus Off Polling support
  259. */
  260. #define CAN_BUSOFF_POLLING_SUPPORT (STD_ON)
  261. /**
  262. * @brief Can Wakeup Polling support
  263. */
  264. #define CAN_WAKEUP_POLLING_SUPPORT (STD_ON)
  265. /**
  266. * @brief Can Wakeup support
  267. */
  268. #define CAN_WAKEUP_SUPPORT (STD_OFF)
  269. /**
  270. * @brief Can Rx/Tx common interrupt support
  271. */
  272. /**
  273. * @brief The definition was represented for at least one Hw Object enabled trigger transmit.
  274. */
  275. #define CAN_TRIGGER_TRANSMIT_USED (STD_OFF)
  276. /**
  277. * @brief Can Enhanced RxFiFo enabling.
  278. */
  279. #define CAN_ENHANCED_FIFO_ENABLED (STD_OFF)
  280. #define CAN_CONFIG_EXT
  281. #ifdef __cplusplus
  282. }
  283. #endif
  284. /** @} */
  285. #endif /* _CAN_CFG_H_ */