FlexCAN_Ip_DeviceReg.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. * @file
  26. *
  27. * @brief FlexCAN Registers and Default Reg Values
  28. * @details <File details>
  29. *
  30. * @addtogroup FlexCAN
  31. * @{
  32. */
  33. #ifndef FLEXCAN_IP_DEVICEREG_H_
  34. #define FLEXCAN_IP_DEVICEREG_H_
  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 "Platform_Types.h"
  42. #include "FlexCAN_Ip_CfgDefines.h"
  43. /*==================================================================================================
  44. * SOURCE FILE VERSION INFORMATION
  45. ==================================================================================================*/
  46. #define FLEXCAN_IP_DEVICEREG_VENDOR_ID_H 43
  47. #define FLEXCAN_IP_DEVICEREG_AR_RELEASE_MAJOR_VERSION_H 4
  48. #define FLEXCAN_IP_DEVICEREG_AR_RELEASE_MINOR_VERSION_H 4
  49. #define FLEXCAN_IP_DEVICEREG_AR_RELEASE_REVISION_VERSION_H 0
  50. #define FLEXCAN_IP_DEVICEREG_SW_MAJOR_VERSION_H 1
  51. #define FLEXCAN_IP_DEVICEREG_SW_MINOR_VERSION_H 0
  52. #define FLEXCAN_IP_DEVICEREG_SW_PATCH_VERSION_H 0
  53. /*==================================================================================================
  54. * FILE VERSION CHECKS
  55. ==================================================================================================*/
  56. /* Check if current file and FlexCAN_Ip_CfgDefines header file are of the same vendor */
  57. #if (FLEXCAN_IP_DEVICEREG_VENDOR_ID_H != FLEXCAN_IP_CFGDEFINES_VENDOR_ID_H)
  58. #error "FlexCAN_Ip_DeviceReg.h and FlexCAN_Ip_CfgDefines.h have different vendor ids"
  59. #endif
  60. /* Check if current file and FlexCAN_Ip_CfgDefines header file are of the same Autosar version */
  61. #if ((FLEXCAN_IP_DEVICEREG_AR_RELEASE_MAJOR_VERSION_H != FLEXCAN_IP_CFGDEFINES_AR_RELEASE_MAJOR_VERSION_H) || \
  62. (FLEXCAN_IP_DEVICEREG_AR_RELEASE_MINOR_VERSION_H != FLEXCAN_IP_CFGDEFINES_AR_RELEASE_MINOR_VERSION_H) || \
  63. (FLEXCAN_IP_DEVICEREG_AR_RELEASE_REVISION_VERSION_H != FLEXCAN_IP_CFGDEFINES_AR_RELEASE_REVISION_VERSION_H))
  64. #error "AutoSar Version Numbers of FlexCAN_Ip_DeviceReg.h and FlexCAN_Ip_CfgDefines.h are different"
  65. #endif
  66. /* Check if current file and FlexCAN_Ip_CfgDefines header file are of the same Software version */
  67. #if ((FLEXCAN_IP_DEVICEREG_SW_MAJOR_VERSION_H != FLEXCAN_IP_CFGDEFINES_SW_MAJOR_VERSION_H) || \
  68. (FLEXCAN_IP_DEVICEREG_SW_MINOR_VERSION_H != FLEXCAN_IP_CFGDEFINES_SW_MINOR_VERSION_H) || \
  69. (FLEXCAN_IP_DEVICEREG_SW_PATCH_VERSION_H != FLEXCAN_IP_CFGDEFINES_SW_PATCH_VERSION_H))
  70. #error "Software Version Numbers of FlexCAN_Ip_DeviceReg.h and FlexCAN_Ip_CfgDefines.h are different"
  71. #endif
  72. #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
  73. /* Check if current file and Platform_Types header file are of the same Autosar version */
  74. #if ((FLEXCAN_IP_DEVICEREG_AR_RELEASE_MAJOR_VERSION_H != PLATFORM_TYPES_AR_RELEASE_MAJOR_VERSION) || \
  75. (FLEXCAN_IP_DEVICEREG_AR_RELEASE_MINOR_VERSION_H != PLATFORM_TYPES_AR_RELEASE_MINOR_VERSION) \
  76. )
  77. #error "AutoSar Version Numbers of FlexCAN_Ip_DeviceReg.h and Platform_Types.h are different"
  78. #endif
  79. #endif
  80. /*==================================================================================================
  81. * CONSTANTS
  82. ==================================================================================================*/
  83. /*==================================================================================================
  84. * DEFINES AND MACROS
  85. ==================================================================================================*/
  86. /* Default value for register */
  87. /**
  88. * @brief Default value for the MCR register
  89. */
  90. #define FLEXCAN_IP_MCR_DEFAULT_VALUE_U32 ((uint32)0xD890000FU)
  91. /**
  92. * @brief Default value for the CTRL1 register
  93. */
  94. #define FLEXCAN_IP_CTRL1_DEFAULT_VALUE_U32 ((uint32)0x00000000U)
  95. /**
  96. * @brief Default value for the TIMER register
  97. */
  98. #define FLEXCAN_IP_TIMER_DEFAULT_VALUE_U32 ((uint32)0x00000000U)
  99. /**
  100. * @brief Default value for the ECR register
  101. */
  102. #define FLEXCAN_IP_ECR_DEFAULT_VALUE_U32 ((uint32)0x00000000U)
  103. /**
  104. * @brief Default value for the ESR1 register
  105. */
  106. #define FLEXCAN_IP_ESR1_DEFAULT_VALUE_U32 ((uint32)0x0003B006U)
  107. /**
  108. * @brief Default value for the IMASK2 register
  109. */
  110. #define FLEXCAN_IP_IMASK_DEFAULT_VALUE_U32 ((uint32)0x00000000U)
  111. /**
  112. * @brief Default value for the IFLAG4 register
  113. */
  114. #define FLEXCAN_IP_IFLAG_DEFAULT_VALUE_U32 ((uint32)0xFFFFFFFFU)
  115. /**
  116. * @brief Default value for the CTRL2 register
  117. */
  118. #define FLEXCAN_IP_CTRL2_DEFAULT_VALUE_U32 ((uint32)0x00100000U)
  119. /**
  120. * @brief Default value for the CTRL2 register
  121. */
  122. #define FLEXCAN_IP_CBT_DEFAULT_VALUE_U32 ((uint32)0x00000000U)
  123. /**
  124. * @brief Default value for the FDCTRL register
  125. */
  126. #define FLEXCAN_IP_FDCTRL_DEFAULT_VALUE_U32 ((uint32)0x80004100U)
  127. /**
  128. * @brief Default value for the FDCBT register
  129. */
  130. #define FLEXCAN_IP_FDCBT_DEFAULT_VALUE_U32 ((uint32)0x00000000U)
  131. #define CAN_FEATURE_S32K1XX TRUE
  132. #if (defined(S32K116) || defined(S32K118) || defined(S32K144) || defined(S32K142))
  133. /** Array init has of CAN Peripheral base address has FD capability */
  134. #define CAN_BASE_PTRS_HAS_FD { IP_FLEXCAN0 }
  135. #define CAN_FEATURE_FD_INSTANCES (1U)
  136. #elif (defined(S32K146) || defined(S32K144W) || defined(S32K142W))
  137. #define CAN_FEATURE_FD_INSTANCES (2U)
  138. #define CAN_BASE_PTRS_HAS_FD { IP_FLEXCAN0, IP_FLEXCAN1}
  139. #elif defined(S32K148)
  140. #define CAN_FEATURE_FD_INSTANCES (3U)
  141. #define CAN_BASE_PTRS_HAS_FD { IP_FLEXCAN0, IP_FLEXCAN1, IP_FLEXCAN2 }
  142. #endif
  143. #if (defined(S32K116) || defined(S32K118))
  144. #define FLEXCAN_IP_FEATURE_BUSOFF_ERROR_INTERRUPT_UNIFIED (STD_ON)
  145. #else
  146. #define FLEXCAN_IP_FEATURE_BUSOFF_ERROR_INTERRUPT_UNIFIED (STD_OFF)
  147. #endif
  148. #define FLEXCAN_IP_RAMn_COUNT FLEXCAN_RAMn_COUNT
  149. #define FLEXCAN_0_BASE IP_FLEXCAN0_BASE
  150. #if FLEXCAN_INSTANCE_COUNT > 1U
  151. #define FLEXCAN_1_BASE IP_FLEXCAN1_BASE
  152. #endif
  153. #if FLEXCAN_INSTANCE_COUNT > 2U
  154. #define FLEXCAN_2_BASE IP_FLEXCAN2_BASE
  155. #endif
  156. #endif /* FLEXCAN_IP_DEVICEREG_H_ */
  157. /** @} */