1 /*
2  * Copyright 2022-2023 NXP
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef STM_IP_CFG_H
8 #define STM_IP_CFG_H
9 /**
10 *   @file           Stm_Ip_Cfg.h
11 *
12 *   @addtogroup stm_ip Stm IPL
13 *
14 *   @{
15 */
16 #ifdef __cplusplus
17 extern "C"{
18 #endif
19 
20 /*==================================================================================================
21 *                                        INCLUDE FILES
22 * 1) system and project includes
23 * 2) needed interfaces from external units
24 * 3) internal and external interfaces from this unit
25 ==================================================================================================*/
26 #include "Stm_Ip_Init_PBcfg.h"
27 /*==================================================================================================
28 *                              SOURCE FILE VERSION INFORMATION
29 ==================================================================================================*/
30 #define STM_IP_VENDOR_ID_CFG                    43
31 #define STM_IP_AR_RELEASE_MAJOR_VERSION_CFG     4
32 #define STM_IP_AR_RELEASE_MINOR_VERSION_CFG     7
33 #define STM_IP_AR_RELEASE_REVISION_VERSION_CFG  0
34 #define STM_IP_SW_MAJOR_VERSION_CFG             1
35 #define STM_IP_SW_MINOR_VERSION_CFG             0
36 #define STM_IP_SW_PATCH_VERSION_CFG             0
37 
38 /*==================================================================================================
39 *                                     FILE VERSION CHECKS
40 ==================================================================================================*/
41 #if (STM_IP_VENDOR_ID_CFG != STM_IP_VENDOR_ID_INIT_PBCFG_H)
42     #error "Stm_Ip_Cfg.h and Stm_Ip_Init_PBcfg.h have different vendor ids"
43 #endif
44 /* Check if this header file and header file are of the same Autosar version */
45 #if ((STM_IP_AR_RELEASE_MAJOR_VERSION_CFG != STM_IP_AR_RELEASE_MAJOR_VERSION_INIT_PBCFG_H) || \
46      (STM_IP_AR_RELEASE_MINOR_VERSION_CFG != STM_IP_AR_RELEASE_MINOR_VERSION_INIT_PBCFG_H) || \
47      (STM_IP_AR_RELEASE_REVISION_VERSION_CFG != STM_IP_AR_RELEASE_REVISION_VERSION_INIT_PBCFG_H) \
48     )
49     #error "AutoSar Version Numbers of Stm_Ip_Cfg.h and Stm_Ip_Init_PBcfg.h are different"
50 #endif
51 /* Check if this header file and header file are of the same Software version */
52 #if ((STM_IP_SW_MAJOR_VERSION_CFG != STM_IP_SW_MAJOR_VERSION_INIT_PBCFG_H) || \
53      (STM_IP_SW_MINOR_VERSION_CFG != STM_IP_SW_MINOR_VERSION_INIT_PBCFG_H) || \
54      (STM_IP_SW_PATCH_VERSION_CFG != STM_IP_SW_PATCH_VERSION_INIT_PBCFG_H) \
55     )
56     #error "Software Version Numbers of Stm_Ip_Cfg.h and Stm_Ip_Init_PBcfg.h are different"
57 #endif
58 /*==================================================================================================
59 *                                          CONSTANTS
60 ==================================================================================================*/
61 
62 /*==================================================================================================
63 *                                      DEFINES AND MACROS
64 ==================================================================================================*/
65 /**
66 * @brief Dev error detect switch
67 */
68 #define STM_IP_DEV_ERROR_DETECT     (STD_OFF)
69 /*================================================================================================*/
70 /**
71 * @brief    STM_IP_CHANGE_NEXT_TIMEOUT_VALUE switch
72 * @details  Enable/disable support for changing timeout value during timer running
73 */
74 #define STM_IP_CHANGE_NEXT_TIMEOUT_VALUE     (STD_OFF)
75 /*================================================================================================*/
76 #define STM_IP_PREDEFTIMER_FUNCTIONALITY_API     (STD_OFF)
77 /*================================================================================================*/
78 /**
79 * @brief    STM_IP_ABSOLUTE_COUTNING_API switch
80 * @details  Enable/disable support for absolute compare value
81 */
82 #define STM_IP_ABSOLUTE_COUNTING_API    (STD_ON)
83 /*================================================================================================*/
84 
85 /**
86 * @brief    STM_IP_ENABLE_USER_MODE_SUPPORT switch
87 * @details  Enable/disable support usermode.If this parameter has been configured to TRUE the GPT driver code can be executed from both supervisor and user mode.
88 */
89 #define STM_IP_ENABLE_USER_MODE_SUPPORT     (STD_OFF)
90 
91 #ifndef MCAL_ENABLE_USER_MODE_SUPPORT
92     #ifdef STM_IP_ENABLE_USER_MODE_SUPPORT
93         #if (STD_ON == STM_IP_ENABLE_USER_MODE_SUPPORT)
94             #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Gpt in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined.
95         #endif /* (STD_ON == STM_IP_ENABLE_USER_MODE_SUPPORT) */
96     #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */
97 #endif /* ifdef MCAL_ENABLE_USER_MODE_SUPPORT*/
98 
99 /**
100 *   @brief      GPT_STM_INSTANCE_COUNT
101 *   @details    GPT_STM_INSTANCE_COUNT
102 */
103 #if (defined(CRS_FSS_AND_RTU_BASE_ADDR_OF_STM_REGISTERS_CONCATENATED) && (CRS_FSS_AND_RTU_BASE_ADDR_OF_STM_REGISTERS_CONCATENATED == STD_ON))
104 #define GPT_STM_INSTANCE_COUNT (STM_INSTANCE_COUNT + RTU_STM_INSTANCE_COUNT)
105 #else
106 #define GPT_STM_INSTANCE_COUNT (STM_INSTANCE_COUNT)
107 #endif
108 
109 /*================================================================================================*/
110 
111 /* Channels number instance RTU0_STM_0 */
112 #define RTU0_STM_0_IP_CHANNELS_NUMBER  (4U)
113 #define RTU0_STM_0_IP_EXISTS
114 #define RTU0_STM_0_IP_INSTANCE_NUMBER  (3U)/* Channels number instance RTU0_STM_1 */
115 #define RTU0_STM_1_IP_CHANNELS_NUMBER  (4U)
116 #define RTU0_STM_1_IP_EXISTS
117 #define RTU0_STM_1_IP_INSTANCE_NUMBER  (4U)/* Channels number instance RTU0_STM_2 */
118 #define RTU0_STM_2_IP_CHANNELS_NUMBER  (4U)
119 #define RTU0_STM_2_IP_EXISTS
120 #define RTU0_STM_2_IP_INSTANCE_NUMBER  (5U)/* Channels number instance RTU0_STM_3 */
121 #define RTU0_STM_3_IP_CHANNELS_NUMBER  (4U)
122 #define RTU0_STM_3_IP_EXISTS
123 #define RTU0_STM_3_IP_INSTANCE_NUMBER  (6U)/* Channels number instance RTU1_STM_0 */
124 #define RTU1_STM_0_IP_CHANNELS_NUMBER  (4U)
125 #define RTU1_STM_0_IP_EXISTS
126 #define RTU1_STM_0_IP_INSTANCE_NUMBER  (7U)/* Channels number instance RTU1_STM_1 */
127 #define RTU1_STM_1_IP_CHANNELS_NUMBER  (4U)
128 #define RTU1_STM_1_IP_EXISTS
129 #define RTU1_STM_1_IP_INSTANCE_NUMBER  (8U)/* Channels number instance RTU1_STM_2 */
130 #define RTU1_STM_2_IP_CHANNELS_NUMBER  (4U)
131 #define RTU1_STM_2_IP_EXISTS
132 #define RTU1_STM_2_IP_INSTANCE_NUMBER  (9U)/* Channels number instance RTU1_STM_3 */
133 #define RTU1_STM_3_IP_CHANNELS_NUMBER  (4U)
134 #define RTU1_STM_3_IP_EXISTS
135 #define RTU1_STM_3_IP_INSTANCE_NUMBER  (10U)/* Channels number instance CE_STM_0 */
136 #define CE_STM_0_IP_CHANNELS_NUMBER  (4U)
137 #define CE_STM_0_IP_EXISTS
138 #define CE_STM_0_IP_INSTANCE_NUMBER  (0U)/* Channels number instance CE_STM_1 */
139 #define CE_STM_1_IP_CHANNELS_NUMBER  (4U)
140 #define CE_STM_1_IP_EXISTS
141 #define CE_STM_1_IP_INSTANCE_NUMBER  (1U)/* Channels number instance CE_STM_2 */
142 #define CE_STM_2_IP_CHANNELS_NUMBER  (4U)
143 #define CE_STM_2_IP_EXISTS
144 #define CE_STM_2_IP_INSTANCE_NUMBER  (2U)/* Channels number instance SMU_STM_0 */
145 #define SMU_STM_0_IP_CHANNELS_NUMBER  (4U)
146 #define SMU_STM_0_IP_EXISTS
147 #define SMU_STM_0_IP_INSTANCE_NUMBER  (11U)/* Channels number instance SMU_STM_2 */
148 #define SMU_STM_2_IP_CHANNELS_NUMBER  (4U)
149 #define SMU_STM_2_IP_EXISTS
150 #define SMU_STM_2_IP_INSTANCE_NUMBER  (12U)
151 /*==================================================================================================
152 *                                             ENUMS
153 ==================================================================================================*/
154 
155 /*==================================================================================================
156 *                                STRUCTURES AND OTHER TYPEDEFS
157 ==================================================================================================*/
158 
159 /*==================================================================================================
160 *                                GLOBAL VARIABLE DECLARATIONS
161 ==================================================================================================*/
162 
163 /*==================================================================================================
164 *                                    FUNCTION PROTOTYPES
165 ==================================================================================================*/
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 /** @} */
171 
172 #endif  /* STM_IP_CFG_H */
173