Dma_Ip_Driver_State.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. /* Prevention from multiple including the same header */
  25. #ifndef DMA_IP_DRIVER_STATES_H_
  26. #define DMA_IP_DRIVER_STATES_H_
  27. /**
  28. * @file Dma_Ip_Driver_State.h
  29. *
  30. * @version 1.0.0
  31. *
  32. * @brief AUTOSAR Mcl - Dma Ip driver header file.
  33. * @details
  34. *
  35. * @addtogroup DMA_IP_DRIVER DMA IP Driver
  36. * @{
  37. */
  38. /*==================================================================================================
  39. * INCLUDE FILES
  40. * 1) system and project includes
  41. * 2) needed interfaces from external units
  42. * 3) internal and external interfaces from this unit
  43. ==================================================================================================*/
  44. #include "Dma_Ip.h"
  45. #if (DMA_IP_IS_AVAILABLE == STD_ON)
  46. /*==================================================================================================
  47. SOURCE FILE VERSION INFORMATION
  48. ==================================================================================================*/
  49. #define DMA_IP_DRIVER_STATE_VENDOR_ID_H 43
  50. #define DMA_IP_DRIVER_STATE_AR_RELEASE_MAJOR_VERSION_H 4
  51. #define DMA_IP_DRIVER_STATE_AR_RELEASE_MINOR_VERSION_H 4
  52. #define DMA_IP_DRIVER_STATE_AR_RELEASE_REVISION_VERSION_H 0
  53. #define DMA_IP_DRIVER_STATE_SW_MAJOR_VERSION_H 1
  54. #define DMA_IP_DRIVER_STATE_SW_MINOR_VERSION_H 0
  55. #define DMA_IP_DRIVER_STATE_SW_PATCH_VERSION_H 0
  56. /*==================================================================================================
  57. FILE VERSION CHECKS
  58. ==================================================================================================*/
  59. /* Check if header file and Dma_Ip.h file are of the same vendor */
  60. #if (DMA_IP_DRIVER_STATE_VENDOR_ID_H != DMA_IP_VENDOR_ID_H)
  61. #error "Dma_Ip_Driver_State.h and Dma_Ip.h have different vendor ids"
  62. #endif
  63. /* Check if header file and Dma_Ip.h file are of the same Autosar version */
  64. #if ((DMA_IP_DRIVER_STATE_AR_RELEASE_MAJOR_VERSION_H != DMA_IP_AR_RELEASE_MAJOR_VERSION_H) || \
  65. (DMA_IP_DRIVER_STATE_AR_RELEASE_MINOR_VERSION_H != DMA_IP_AR_RELEASE_MINOR_VERSION_H) || \
  66. (DMA_IP_DRIVER_STATE_AR_RELEASE_REVISION_VERSION_H != DMA_IP_AR_RELEASE_REVISION_VERSION_H) \
  67. )
  68. #error "AutoSar Version Numbers of Dma_Ip_Driver_State.h and Dma_Ip.h are different"
  69. #endif
  70. /* Check if header file and Dma_Ip.h file are of the same Software version */
  71. #if ((DMA_IP_DRIVER_STATE_SW_MAJOR_VERSION_H != DMA_IP_SW_MAJOR_VERSION_H) || \
  72. (DMA_IP_DRIVER_STATE_SW_MINOR_VERSION_H != DMA_IP_SW_MINOR_VERSION_H) || \
  73. (DMA_IP_DRIVER_STATE_SW_PATCH_VERSION_H != DMA_IP_SW_PATCH_VERSION_H) \
  74. )
  75. #error "Software Version Numbers of Dma_Ip_Driver_State.h and Dma_Ip.h are different"
  76. #endif
  77. /*==================================================================================================
  78. ENUMS
  79. ==================================================================================================*/
  80. /* The enumeration values are linked to the Dma State Machine */
  81. typedef enum{
  82. DMA_IP_CH_RESET_EVENT = 0U,
  83. DMA_IP_CH_READY_EVENT = 1U,
  84. DMA_IP_CH_TRANSFER_EVENT = 2U,
  85. DMA_IP_CH_SCATTERGATHER_EVENT = 3U,
  86. DMA_IP_CH_ERROR_EVENT = 4U,
  87. }Dma_Ip_HwChannelEventValueEnum;
  88. /*==================================================================================================
  89. STRUCTURES
  90. ==================================================================================================*/
  91. typedef struct{
  92. #if (DMA_IP_HWV2_IS_AVAILABLE == STD_ON)
  93. Dma_Ip_HwChannelStateType * volatile ptHwChV2StateArray[DMA_IP_HWV2_DMA_NOF_INST][DMA_IP_HWV2_TCD_NOF_CH];
  94. #endif /* #if (DMA_IP_HWV2_IS_AVAILABLE == STD_ON) */
  95. #if (DMA_IP_HWV3_IS_AVAILABLE == STD_ON)
  96. Dma_Ip_HwChannelStateType * volatile ptHwChV3StateArray[DMA_IP_DMA_NOF_HWV3_INST][DMA_IP_TCD_NOF_HWV3_CH];
  97. #endif /* #if (DMA_IP_HWV3_IS_AVAILABLE == STD_ON) */
  98. }Dma_Ip_HwStateType;
  99. /*==================================================================================================
  100. * GLOBAL FUNCTION PROTOTYPES
  101. ==================================================================================================*/
  102. #define MCL_START_SEC_CODE
  103. /* @violates @ref Mcl_Dma_h_REF_1 MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once. */
  104. #include "Mcl_MemMap.h"
  105. void Dma_Ip_SetHwChannelState(const uint32 LocHwVers, const uint32 LocHwInst, const uint32 LocHwCh, const Dma_Ip_HwChannelEventValueEnum EventValue);
  106. Dma_Ip_HwChannelStateValueType Dma_Ip_GetHwChannelState(uint32 LocHwVers, uint32 LocHwInst, uint32 LocHwCh);
  107. Dma_Ip_HwChannelStateType * Dma_Ip_GetHwChannelStatePointer(uint32 LocHwVers, uint32 LocHwInst, uint32 LocHwCh);
  108. void Dma_Ip_SetHwChannelStatePointer(uint32 LocHwVers, uint32 LocHwInst, uint32 LocHwCh, Dma_Ip_HwChannelStateType * StatePointer);
  109. #define MCL_STOP_SEC_CODE
  110. /* @violates @ref Mcl_Dma_h_REF_1 MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents of a header file being included more than once. */
  111. #include "Mcl_MemMap.h"
  112. #endif /* #if (DMA_IP_IS_AVAILABLE == STD_ON) */
  113. /** @} */
  114. #endif /* #if !defined(DMA_IP_DRIVER_STATES_H_) */
  115. /*==================================================================================================
  116. * END OF FILE
  117. ==================================================================================================*/