FlexCAN_Ip_Cfg.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. #ifndef FLEXCAN_FLEXCAN_IP_CFG_H_
  25. #define FLEXCAN_FLEXCAN_IP_CFG_H_
  26. /**
  27. * @file FlexCAN_Ip_Cfg.h
  28. *
  29. * @addtogroup FlexCAN
  30. * @{
  31. */
  32. #ifdef __cplusplus
  33. extern "C"{
  34. #endif
  35. /*==================================================================================================
  36. * INCLUDE FILES
  37. * 1) system and project includes
  38. * 2) needed interfaces from external units
  39. * 3) internal and external interfaces from this unit
  40. ==================================================================================================*/
  41. #include "FlexCAN_Ip_VS_0_PBcfg.h"
  42. #include "OsIf.h"
  43. #include "Reg_eSys.h"
  44. /*==================================================================================================
  45. * SOURCE FILE VERSION INFORMATION
  46. ==================================================================================================*/
  47. #define FLEXCAN_IP_CFG_VENDOR_ID_H 43
  48. #define FLEXCAN_IP_CFG_AR_RELEASE_MAJOR_VERSION_H 4
  49. #define FLEXCAN_IP_CFG_AR_RELEASE_MINOR_VERSION_H 4
  50. #define FLEXCAN_IP_CFG_AR_RELEASE_REVISION_VERSION_H 0
  51. #define FLEXCAN_IP_CFG_SW_MAJOR_VERSION_H 1
  52. #define FLEXCAN_IP_CFG_SW_MINOR_VERSION_H 0
  53. #define FLEXCAN_IP_CFG_SW_PATCH_VERSION_H 0
  54. /*==================================================================================================
  55. * FILE VERSION CHECKS
  56. ==================================================================================================*/
  57. /* Check if current file and FlexCAN_Ip_VS_0_PBcfg.h header file are of the same vendor */
  58. #if (FLEXCAN_IP_CFG_VENDOR_ID_H != FLEXCAN_IP_VENDOR_ID_VS_0_PBCFG_H)
  59. #error "FlexCAN_Ip_Cfg.h and FlexCAN_Ip_VS_0_PBcfg.h have different vendor ids"
  60. #endif
  61. /* Check if current file and FlexCAN_Ip_VS_0_PBcfg.h header file are of the same Autosar version */
  62. #if ((FLEXCAN_IP_CFG_AR_RELEASE_MAJOR_VERSION_H != FLEXCAN_IP_AR_RELEASE_MAJOR_VERSION_VS_0_PBCFG_H) || \
  63. (FLEXCAN_IP_CFG_AR_RELEASE_MINOR_VERSION_H != FLEXCAN_IP_AR_RELEASE_MINOR_VERSION_VS_0_PBCFG_H) || \
  64. (FLEXCAN_IP_CFG_AR_RELEASE_REVISION_VERSION_H != FLEXCAN_IP_AR_RELEASE_REVISION_VERSION_VS_0_PBCFG_H) \
  65. )
  66. #error "AutoSar Version Numbers of FlexCAN_Ip_Cfg.h and FlexCAN_Ip_VS_0_PBcfg.h are different"
  67. #endif
  68. /* Check if current file and FlexCAN_Ip_VS_0_PBcfg.h header file are of the same Software version */
  69. #if ((FLEXCAN_IP_CFG_SW_MAJOR_VERSION_H != FLEXCAN_IP_SW_MAJOR_VERSION_VS_0_PBCFG_H) || \
  70. (FLEXCAN_IP_CFG_SW_MINOR_VERSION_H != FLEXCAN_IP_SW_MINOR_VERSION_VS_0_PBCFG_H) || \
  71. (FLEXCAN_IP_CFG_SW_PATCH_VERSION_H != FLEXCAN_IP_SW_PATCH_VERSION_VS_0_PBCFG_H) \
  72. )
  73. #error "Software Version Numbers of FlexCAN_Ip_Cfg.h and FlexCAN_Ip_VS_0_PBcfg.h are different"
  74. #endif
  75. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  76. /* Check if current file and OsIf header file are of the same version */
  77. #if ((FLEXCAN_IP_CFG_AR_RELEASE_MAJOR_VERSION_H != OSIF_AR_RELEASE_MAJOR_VERSION) || \
  78. (FLEXCAN_IP_CFG_AR_RELEASE_MINOR_VERSION_H != OSIF_AR_RELEASE_MINOR_VERSION) \
  79. )
  80. #error "AutoSar Version Numbers of FlexCAN_Ip_Cfg.h and OsIf.h are different"
  81. #endif
  82. /* Check if current file and Reg_eSys header file are of the same version */
  83. #if ((FLEXCAN_IP_CFG_AR_RELEASE_MAJOR_VERSION_H != REG_ESYS_AR_RELEASE_MAJOR_VERSION) || \
  84. (FLEXCAN_IP_CFG_AR_RELEASE_MINOR_VERSION_H != REG_ESYS_AR_RELEASE_MINOR_VERSION) \
  85. )
  86. #error "AutoSar Version Numbers of FlexCAN_Ip_Cfg.h and Reg_eSys.h are different"
  87. #endif
  88. #endif
  89. /*==================================================================================================
  90. * CONSTANTS
  91. ==================================================================================================*/
  92. /*==================================================================================================
  93. * DEFINES AND MACROS
  94. ==================================================================================================*/
  95. /* External Structures generated by FlexCAN_Ip_PBCfg */
  96. #define FLEXCAN_IP_CONFIG_EXT \
  97. FLEXCAN_IP_VS_0_PB_CFG
  98. /* for HLD, no need to extern states */
  99. #define FLEXCAN_IP_STATE_EXT
  100. #define FLEXCAN_IP_PN_CONFIG_EXT \
  101. FLEXCAN_IP_PN_VS_0_PB_CFG
  102. /*! @brief Enables / Disables user mode support */
  103. #define FLEXCAN_IP_ENABLE_USER_MODE_SUPPORT (STD_OFF)
  104. #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
  105. #if (STD_ON == FLEXCAN_IP_ENABLE_USER_MODE_SUPPORT)
  106. #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running FLEXCAN in user mode, MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined.
  107. #endif /* (STD_ON == FLEXCAN_IP_ENABLE_USER_MODE_SUPPORT */
  108. #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
  109. #if ((STD_ON == FLEXCAN_IP_ENABLE_USER_MODE_SUPPORT) && defined(MCAL_FLEXCAN_REG_PROT_AVAILABLE))
  110. #if (STD_ON == MCAL_FLEXCAN_REG_PROT_AVAILABLE)
  111. #define FLEXCAN_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE (STD_ON)
  112. #else
  113. #define FLEXCAN_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE (STD_OFF)
  114. #endif
  115. #else
  116. #define FLEXCAN_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE (STD_OFF)
  117. #endif
  118. #if (FLEXCAN_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE == STD_ON)
  119. /*! @brief Use to check if the instances support UAA bit or not */
  120. #define FLEXCAN_IP_CTRL_REG_PROT_SUPPORT_U8 ((uint8)0U)
  121. #endif
  122. /* Time out value in uS */
  123. #define FLEXCAN_IP_TIMEOUT_DURATION (1000000U)
  124. /* This this will set the timer source for osif that will be used for timeout */
  125. #define FLEXCAN_IP_SERVICE_TIMEOUT_TYPE (OSIF_COUNTER_DUMMY)
  126. /* @brief Maximum number of Message Buffers supported for payload size 8 for any of the CAN instances */
  127. #define FLEXCAN_IP_FEATURE_MAX_MB_NUM (32U)
  128. /* @brief Maximum number of Message Buffers supported for payload size 8 for CAN0 */
  129. #define FLEXCAN_IP_FEATURE_INSTANCE_0_MAX_MB_NUM (32U)
  130. /* @brief Maximum number of Message Buffers supported for payload size 8 for CAN1 */
  131. #define FLEXCAN_IP_FEATURE_INSTANCE_1_MAX_MB_NUM (16U)
  132. /* @brief Maximum number of Message Buffers supported for payload size 8 for CAN2 */
  133. #define FLEXCAN_IP_FEATURE_INSTANCE_2_MAX_MB_NUM (16U)
  134. /* @brief Array of maximum number of Message Buffers supported for payload size 8 for all the CAN instances */
  135. #define FLEXCAN_IP_FEATURE_MAX_MB_NUM_ARRAY { \
  136. FLEXCAN_IP_FEATURE_INSTANCE_0_MAX_MB_NUM, \
  137. FLEXCAN_IP_FEATURE_INSTANCE_1_MAX_MB_NUM, \
  138. FLEXCAN_IP_FEATURE_INSTANCE_2_MAX_MB_NUM \
  139. }
  140. /* @brief Has DMA enable (bit field MCR[DMA]). */
  141. #define FLEXCAN_IP_FEATURE_HAS_DMA_ENABLE (STD_OFF)
  142. /* @brief Has Supervisor Mode MCR[SUPV] */
  143. #define FLEXCAN_IP_FEATURE_HAS_SUPV (STD_ON)
  144. /* @brief Has Flexible Data Rate */
  145. #define FLEXCAN_IP_FEATURE_HAS_FD (STD_ON)
  146. /* @bried FlexCAN has Detection And Correction of Memory Errors */
  147. #define FLEXCAN_IP_FEATURE_HAS_MEM_ERR_DET (STD_OFF)
  148. /* @brief Has FlexCAN Enhanced Rx FIFO mode */
  149. #define FLEXCAN_IP_FEATURE_HAS_ENHANCED_RX_FIFO (STD_OFF)
  150. /* @brief Has FlexCAN expandable memory */
  151. #define FLEXCAN_IP_FEATURE_HAS_EXPANDABLE_MEMORY (STD_OFF)
  152. /* @brief Has FlexCAN Timestamp enabled */
  153. #define FLEXCAN_IP_FEATURE_HAS_TS_ENABLE (STD_OFF)
  154. /* @brief Has FlexCAN High Resolution Timer for Time stamp CAN Message */
  155. #define FLEXCAN_IP_FEATURE_HAS_HR_TIMER (STD_OFF)
  156. /* @brief Has FlexCAN Enhanced Rx FIFO has interrupts available */
  157. #define FLEXCAN_IP_FEATURE_HAS_ENHANCED_RX_FIFO_INTERRUPT (STD_OFF)
  158. #define FLEXCAN_IP_FEATURE_HAS_PE_CLKSRC_SELECT (STD_ON)
  159. #define FLEXCAN_IP_FEATURE_HAS_WAKE_UP_IRQ (STD_OFF)
  160. /* @brief Enable use of Enhanced CBT time segments and ENTDC */
  161. #define FLEXCAN_IP_FEATURE_HAS_ENHANCE_CBT (STD_OFF)
  162. /* @brief Has FD Iso Option Mode */
  163. #define FLEXCAN_IP_FEATURE_SWITCHINGISOMODE (STD_ON)
  164. /* @brief Has Protocol exception Mode */
  165. #define FLEXCAN_IP_FEATURE_PROTOCOLEXCEPTION (STD_ON)
  166. /* @brief Has Edge filter Feature */
  167. #define FLEXCAN_IP_FEATURE_EDGEFILTER (STD_ON)
  168. /* @brief Define if global variables need to be placed in non-cache area or not */
  169. #define FLEXCAN_IP_FEATURE_NO_CACHE_NEEDED (STD_OFF)
  170. /* @brief Has Pretending Network Feature */
  171. #define FLEXCAN_IP_FEATURE_HAS_PRETENDED_NETWORKING (STD_ON)
  172. /**
  173. * @brief Can Rx/Tx common interrupt support
  174. */
  175. #define FLEXCAN_IP_MB_INTERRUPT_SUPPORT (STD_OFF)
  176. /**
  177. * @brief Can Bus Off interrupt support
  178. */
  179. #define FLEXCAN_IP_BUSOFF_INTERRUPT_SUPPORT (STD_OFF)
  180. /**
  181. * @brief Can Error interrupt support
  182. */
  183. #define FLEXCAN_IP_ERROR_INTERRUPT_SUPPORT (STD_OFF)
  184. /* Defines the No Of Message Buffers Partions Suppport MBDSR regions */
  185. #define FLEXCAN_IP_FEATURE_MBDSR_COUNT (1U)
  186. /* Enable Development Error Detection */
  187. #define FLEXCAN_IP_DEV_ERROR_DETECT (STD_ON)
  188. #ifdef __cplusplus
  189. }
  190. #endif /* __cplusplus */
  191. /** @} */
  192. #endif /* FLEXCAN_FLEXCAN_IP_CFG_H_ */