Mcl_Types.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral : DMA,CACHE,TRGMUX,FLEXIO
  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 MCL_TYPES_H_
  25. #define MCL_TYPES_H_
  26. /**
  27. * @file Mcl_Types.h
  28. *
  29. * @version 1.0.0
  30. *
  31. * @brief AUTOSAR Mcl - MCL driver header file.
  32. * @details
  33. *
  34. * @addtogroup MCL_DRIVER MCL Driver
  35. * @{
  36. */
  37. #ifdef __cplusplus
  38. extern "C"
  39. {
  40. #endif
  41. /**
  42. * @page misra_violations MISRA-C:2012 violations
  43. */
  44. /*==================================================================================================
  45. * INCLUDE FILES
  46. * 1) system and project includes
  47. * 2) needed interfaces from external units
  48. * 3) internal and external interfaces from this unit
  49. ==================================================================================================*/
  50. #include "CDD_Mcl_Cfg_Defines.h"
  51. #if (MCL_DMA_IS_AVAILABLE == STD_ON)
  52. #include "Dma_Ip.h"
  53. #endif /* MCL_DMA_IS_AVAILABLE == STD_ON */
  54. #if (MCL_CACHE_IS_AVAILABLE == STD_ON)
  55. #include "Cache_Ip.h"
  56. #endif /* MCL_CACHE_IS_AVAILABLE == STD_ON */
  57. #if (MCL_LCU_IS_AVAILABLE == STD_ON)
  58. #include "Lcu_Ip.h"
  59. #endif /* MCL_LCU_IS_AVAILABLE == STD_ON */
  60. #if (MCL_TRGMUX_IS_AVAILABLE == STD_ON)
  61. #include "Trgmux_Ip.h"
  62. #endif /* MCL_TRGMUX_IS_AVAILABLE == STD_ON */
  63. #if (MCL_EMIOS_IS_AVAILABLE == STD_ON)
  64. #include "Emios_Mcl_Ip.h"
  65. #endif /* MCL_EMIOS_IS_AVAILABLE == STD_ON */
  66. #if (MCL_FLEXIO_IS_AVAILABLE == STD_ON)
  67. #include "Flexio_Mcl_Ip.h"
  68. #endif /* MCL_FLEXIO_IS_AVAILABLE == STD_ON */
  69. /*==================================================================================================
  70. * SOURCE FILE VERSION INFORMATION
  71. ==================================================================================================*/
  72. #define MCL_TYPES_VENDOR_ID_H 43
  73. #define MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H 4
  74. #define MCL_TYPES_AR_RELEASE_MINOR_VERSION_H 4
  75. #define MCL_TYPES_AR_RELEASE_REVISION_VERSION_H 0
  76. #define MCL_TYPES_SW_MAJOR_VERSION_H 1
  77. #define MCL_TYPES_SW_MINOR_VERSION_H 0
  78. #define MCL_TYPES_SW_PATCH_VERSION_H 0
  79. /*==================================================================================================
  80. * FILE VERSION CHECKS
  81. ==================================================================================================*/
  82. /* Check if header file and CDD_Mcl_Cfg_Defines.h file are of the same vendor */
  83. #if (MCL_TYPES_VENDOR_ID_H != CDD_MCL_CFG_DEFINES_VENDOR_ID_H)
  84. #error "Mcl_Types.h and CDD_Mcl_Cfg_Defines.h have different vendor ids"
  85. #endif
  86. /* Check if header file and CDD_Mcl_Cfg_Defines.h file are of the same Autosar version */
  87. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != CDD_MCL_CFG_DEFINES_AR_RELEASE_MAJOR_VERSION_H) || \
  88. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != CDD_MCL_CFG_DEFINES_AR_RELEASE_MINOR_VERSION_H) || \
  89. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != CDD_MCL_CFG_DEFINES_AR_RELEASE_REVISION_VERSION_H) \
  90. )
  91. #error "AutoSar Version Numbers of Mcl_Types.h and CDD_Mcl_Cfg_Defines.h are different"
  92. #endif
  93. /* Check if header file and CDD_Mcl_Cfg_Defines.h file are of the same Software version */
  94. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != CDD_MCL_CFG_DEFINES_SW_MAJOR_VERSION_H) || \
  95. (MCL_TYPES_SW_MINOR_VERSION_H != CDD_MCL_CFG_DEFINES_SW_MINOR_VERSION_H) || \
  96. (MCL_TYPES_SW_PATCH_VERSION_H != CDD_MCL_CFG_DEFINES_SW_PATCH_VERSION_H) \
  97. )
  98. #error "Software Version Numbers of Mcl_Types.h and CDD_Mcl_Cfg_Defines.h are different"
  99. #endif
  100. #if (MCL_DMA_IS_AVAILABLE == STD_ON)
  101. #if (MCL_TYPES_VENDOR_ID_H != DMA_IP_VENDOR_ID_H)
  102. #error "Mcl_Types.h and Dma_Ip.h have different vendor ids"
  103. #endif
  104. /* Check if header file and Dma_Ip.h file are of the same Autosar version */
  105. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != DMA_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  106. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != DMA_IP_AR_RELEASE_MINOR_VERSION_H) || \
  107. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != DMA_IP_AR_RELEASE_REVISION_VERSION_H) \
  108. )
  109. #error "AutoSar Version Numbers of Mcl_Types.h and Dma_Ip.h are different"
  110. #endif
  111. /* Check if header file and Dma_Ip.h file are of the same Software version */
  112. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != DMA_IP_SW_MAJOR_VERSION_H) || \
  113. (MCL_TYPES_SW_MINOR_VERSION_H != DMA_IP_SW_MINOR_VERSION_H) || \
  114. (MCL_TYPES_SW_PATCH_VERSION_H != DMA_IP_SW_PATCH_VERSION_H) \
  115. )
  116. #error "Software Version Numbers of Mcl_Types.h and Dma_Ip.h are different"
  117. #endif
  118. #endif /* MCL_DMA_IS_AVAILABLE == STD_ON */
  119. #if (MCL_CACHE_IS_AVAILABLE == STD_ON)
  120. #if (MCL_TYPES_VENDOR_ID_H != CACHE_IP_VENDOR_ID_H)
  121. #error "Mcl_Types.h and Cache_Ip.h have different vendor ids"
  122. #endif
  123. /* Check if header file and Cache_Ip.h file are of the same Autosar version */
  124. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != CACHE_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  125. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != CACHE_IP_AR_RELEASE_MINOR_VERSION_H) || \
  126. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != CACHE_IP_AR_RELEASE_REVISION_VERSION_H) \
  127. )
  128. #error "AutoSar Version Numbers of Mcl_Types.h and Cache_Ip.h are different"
  129. #endif
  130. /* Check if header file and Cache_Ip.h file are of the same Software version */
  131. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != CACHE_IP_SW_MAJOR_VERSION_H) || \
  132. (MCL_TYPES_SW_MINOR_VERSION_H != CACHE_IP_SW_MINOR_VERSION_H) || \
  133. (MCL_TYPES_SW_PATCH_VERSION_H != CACHE_IP_SW_PATCH_VERSION_H) \
  134. )
  135. #error "Software Version Numbers of Mcl_Types.h and Cache_Ip.h are different"
  136. #endif
  137. #endif /* MCL_CACHE_IS_AVAILABLE == STD_ON */
  138. #if (MCL_LCU_IS_AVAILABLE == STD_ON)
  139. #if (MCL_TYPES_VENDOR_ID_H != LCU_IP_VENDOR_ID_H)
  140. #error "Mcl_Types.h and Lcu_Ip.h have different vendor ids"
  141. #endif
  142. /* Check if header file and Lcu_Ip.h file are of the same Autosar version */
  143. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != LCU_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  144. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != LCU_IP_AR_RELEASE_MINOR_VERSION_H) || \
  145. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != LCU_IP_AR_RELEASE_REVISION_VERSION_H) \
  146. )
  147. #error "AutoSar Version Numbers of Mcl_Types.h and Lcu_Ip.h are different"
  148. #endif
  149. /* Check if header file and Lcu_Ip.h file are of the same Software version */
  150. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != LCU_IP_SW_MAJOR_VERSION_H) || \
  151. (MCL_TYPES_SW_MINOR_VERSION_H != LCU_IP_SW_MINOR_VERSION_H) || \
  152. (MCL_TYPES_SW_PATCH_VERSION_H != LCU_IP_SW_PATCH_VERSION_H) \
  153. )
  154. #error "Software Version Numbers of Mcl_Types.h and Lcu_Ip.h are different"
  155. #endif
  156. #endif /* MCL_LCU_IS_AVAILABLE == STD_ON */
  157. #if (MCL_TRGMUX_IS_AVAILABLE == STD_ON)
  158. #if (MCL_TYPES_VENDOR_ID_H != TRGMUX_IP_VENDOR_ID_H)
  159. #error "Mcl_Types.h and Trgmux_Ip.h have different vendor ids"
  160. #endif
  161. /* Check if header file and Trgmux_Ip.h file are of the same Autosar version */
  162. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != TRGMUX_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  163. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != TRGMUX_IP_AR_RELEASE_MINOR_VERSION_H) || \
  164. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != TRGMUX_IP_AR_RELEASE_REVISION_VERSION_H) \
  165. )
  166. #error "AutoSar Version Numbers of Mcl_Types.h and Trgmux_Ip.h are different"
  167. #endif
  168. /* Check if header file and Trgmux_Ip.h file are of the same Software version */
  169. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != TRGMUX_IP_SW_MAJOR_VERSION_H) || \
  170. (MCL_TYPES_SW_MINOR_VERSION_H != TRGMUX_IP_SW_MINOR_VERSION_H) || \
  171. (MCL_TYPES_SW_PATCH_VERSION_H != TRGMUX_IP_SW_PATCH_VERSION_H) \
  172. )
  173. #error "Software Version Numbers of Mcl_Types.h and Trgmux_Ip.h are different"
  174. #endif
  175. #endif /* MCL_TRGMUX_IS_AVAILABLE == STD_ON */
  176. #if (MCL_EMIOS_IS_AVAILABLE == STD_ON)
  177. #if (MCL_TYPES_VENDOR_ID_H != EMIOS_MCL_IP_VENDOR_ID_H)
  178. #error "Mcl_Types.h and Emios_Mcl_Ip.h have different vendor ids"
  179. #endif
  180. /* Check if header file and Emios_Mcl_Ip.h file are of the same Autosar version */
  181. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != EMIOS_MCL_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  182. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != EMIOS_MCL_IP_AR_RELEASE_MINOR_VERSION_H) || \
  183. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != EMIOS_MCL_IP_AR_RELEASE_REVISION_VERSION_H) \
  184. )
  185. #error "AutoSar Version Numbers of Mcl_Types.h and Emios_Mcl_Ip.h are different"
  186. #endif
  187. /* Check if header file and Emios_Mcl_Ip.h file are of the same Software version */
  188. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != EMIOS_MCL_IP_SW_MAJOR_VERSION_H) || \
  189. (MCL_TYPES_SW_MINOR_VERSION_H != EMIOS_MCL_IP_SW_MINOR_VERSION_H) || \
  190. (MCL_TYPES_SW_PATCH_VERSION_H != EMIOS_MCL_IP_SW_PATCH_VERSION_H) \
  191. )
  192. #error "Software Version Numbers of Mcl_Types.h and Emios_Mcl_Ip.h are different"
  193. #endif
  194. #endif /* MCL_EMIOS_IS_AVAILABLE == STD_ON */
  195. #if (MCL_FLEXIO_IS_AVAILABLE == STD_ON)
  196. #if (MCL_TYPES_VENDOR_ID_H != FLEXIO_MCL_IP_VENDOR_ID_H)
  197. #error "Mcl_Types.h and Flexio_Mcl_Ip.h have different vendor ids"
  198. #endif
  199. /* Check if header file and Flexio_Mcl_Ip.h file are of the same Autosar version */
  200. #if ((MCL_TYPES_AR_RELEASE_MAJOR_VERSION_H != FLEXIO_MCL_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  201. (MCL_TYPES_AR_RELEASE_MINOR_VERSION_H != FLEXIO_MCL_IP_AR_RELEASE_MINOR_VERSION_H) || \
  202. (MCL_TYPES_AR_RELEASE_REVISION_VERSION_H != FLEXIO_MCL_IP_AR_RELEASE_REVISION_VERSION_H) \
  203. )
  204. #error "AutoSar Version Numbers of Mcl_Types.h and Flexio_Mcl_Ip.h are different"
  205. #endif
  206. /* Check if header file and Flexio_Mcl_Ip.h file are of the same Software version */
  207. #if ((MCL_TYPES_SW_MAJOR_VERSION_H != FLEXIO_MCL_IP_SW_MAJOR_VERSION_H) || \
  208. (MCL_TYPES_SW_MINOR_VERSION_H != FLEXIO_MCL_IP_SW_MINOR_VERSION_H) || \
  209. (MCL_TYPES_SW_PATCH_VERSION_H != FLEXIO_MCL_IP_SW_PATCH_VERSION_H) \
  210. )
  211. #error "Software Version Numbers of Mcl_Types.h and Flexio_Mcl_Ip.h are different"
  212. #endif
  213. #endif /* MCL_FLEXIO_IS_AVAILABLE == STD_ON */
  214. /*==================================================================================================
  215. * CONSTANTS
  216. ==================================================================================================*/
  217. /*==================================================================================================
  218. * DEFINES AND MACROS
  219. ==================================================================================================*/
  220. /*==================================================================================================
  221. * ENUMS
  222. ==================================================================================================*/
  223. /**
  224. * @brief This type contains the Mcl Return Type.
  225. * @details The Return Type give information for the execution of interfaces.
  226. *
  227. * */
  228. typedef enum{
  229. MCL_STATUS_SUCCESS = E_OK,
  230. MCL_STATUS_ERROR = E_NOT_OK
  231. }Mcl_ReturnType;
  232. /*==================================================================================================
  233. * STRUCTURES AND OTHER TYPEDEFS
  234. ==================================================================================================*/
  235. #if (MCL_EMIOS_IS_AVAILABLE == STD_ON)
  236. typedef struct
  237. {
  238. const uint8 instance;
  239. const Emios_Mcl_Ip_ConfigType *emiosInstanceConfig;
  240. } Mcl_EmiosInstanceConfigType;
  241. typedef struct
  242. {
  243. const uint8 MclEmiosNumInstances;
  244. const Mcl_EmiosInstanceConfigType (*pMclEmiosInstanceConfig)[];
  245. } Mcl_EmiosInitConfigType;
  246. #endif /* MCL_EMIOS_IS_AVAILABLE == STD_ON */
  247. /**
  248. * @brief This type contains the Mcl Configuration.
  249. * @details The Mcl Configuration structure contains pointers to the Ip's configuration
  250. * structure. Based on the available support, specific configurations shall be
  251. * stored.
  252. *
  253. * */
  254. typedef struct{
  255. #if (MCL_DMA_IS_AVAILABLE == STD_ON)
  256. const Dma_Ip_InitType * const pxDmaInitType;
  257. #else
  258. const uint8 * const DummyDmaPtr;
  259. #endif /* MCL_DMA_IS_AVAILABLE == STD_ON */
  260. #if (MCL_TRGMUX_IS_AVAILABLE == STD_ON)
  261. const Trgmux_Ip_InitType * const pxTrgmuxInitType;
  262. #else
  263. const uint8 * const DummyTrgmuxPtr;
  264. #endif /* MCL_TRGMUX_IS_AVAILABLE == STD_ON */
  265. #if (MCL_LCU_IS_AVAILABLE == STD_ON)
  266. const Lcu_Ip_InitType * const pxLcuInitType;
  267. #else
  268. const uint8 * const DummyLcuPtr;
  269. #endif /* MCL_LCU_IS_AVAILABLE == STD_ON */
  270. #if (MCL_EMIOS_IS_AVAILABLE == STD_ON)
  271. const Mcl_EmiosInitConfigType * const pEmiosInitType;
  272. #else
  273. const uint8 * const DummyEmiosPtr;
  274. #endif /* MCL_EMIOS_IS_AVAILABLE == STD_ON */
  275. #if (MCL_FLEXIO_IS_AVAILABLE == STD_ON)
  276. const Flexio_Ip_InstanceConfigType * const pFlexioInitType;
  277. #else
  278. const uint8 * const DummyFlexioPtr;
  279. #endif /* MCL_FLEXIO_IS_AVAILABLE == STD_ON */
  280. }Mcl_ConfigType;
  281. /*==================================================================================================
  282. * GLOBAL VARIABLE DECLARATIONS
  283. ==================================================================================================*/
  284. /*==================================================================================================
  285. * FUNCTION PROTOTYPES
  286. ==================================================================================================*/
  287. #ifdef __cplusplus
  288. }
  289. #endif
  290. /** @} */
  291. #endif /* MCL_TYPES_H_ */
  292. /*==================================================================================================
  293. * END OF FILE
  294. ==================================================================================================*/