1 /* 2 * Copyright 2022-2023 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 /** 8 * @file Clock_Ip_Cfg.h 9 * @version 1.0.0 10 * 11 * @brief AUTOSAR Mcu - Clock configuration header file. 12 * @details This file is the header containing all the necessary information for CLOCK 13 * module configuration(s). 14 * 15 * @addtogroup CLOCK_DRIVER_CONFIGURATION Clock Driver 16 * @{ 17 */ 18 19 #ifndef CLOCK_IP_CFG_H 20 #define CLOCK_IP_CFG_H 21 22 23 #ifdef __cplusplus 24 extern "C"{ 25 #endif 26 27 28 /*================================================================================================== 29 INCLUDE FILES 30 1) system and project includes 31 2) needed interfaces from external units 32 3) internal and external interfaces from this unit 33 ==================================================================================================*/ 34 #include "Clock_Ip_Types.h" 35 36 /*================================================================================================== 37 * SOURCE FILE VERSION INFORMATION 38 ==================================================================================================*/ 39 #define CLOCK_IP_CFG_VENDOR_ID 43 40 #define CLOCK_IP_CFG_AR_RELEASE_MAJOR_VERSION 4 41 #define CLOCK_IP_CFG_AR_RELEASE_MINOR_VERSION 7 42 #define CLOCK_IP_CFG_AR_RELEASE_REVISION_VERSION 0 43 #define CLOCK_IP_CFG_SW_MAJOR_VERSION 1 44 #define CLOCK_IP_CFG_SW_MINOR_VERSION 0 45 #define CLOCK_IP_CFG_SW_PATCH_VERSION 0 46 47 /*================================================================================================== 48 * FILE VERSION CHECKS 49 ==================================================================================================*/ 50 /* Check if Clock_Ip_Cfg.h file and Clock_Ip_Types.h file are of the same vendor */ 51 #if (CLOCK_IP_CFG_VENDOR_ID != CLOCK_IP_TYPES_VENDOR_ID) 52 #error "Clock_Ip_Cfg.h and Clock_Ip_Types.h have different vendor ids" 53 #endif 54 55 /* Check if Clock_Ip_Cfg.h file and Clock_Ip_Types.h file are of the same Autosar version */ 56 #if ((CLOCK_IP_CFG_AR_RELEASE_MAJOR_VERSION != CLOCK_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \ 57 (CLOCK_IP_CFG_AR_RELEASE_MINOR_VERSION != CLOCK_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \ 58 (CLOCK_IP_CFG_AR_RELEASE_REVISION_VERSION != CLOCK_IP_TYPES_AR_RELEASE_REVISION_VERSION) \ 59 ) 60 #error "AutoSar Version Numbers of Clock_Ip_Cfg.h and Clock_Ip_Types.h are different" 61 #endif 62 63 /* Check if Clock_Ip_Cfg.h file and Clock_Ip_Types.h file are of the same Software version */ 64 #if ((CLOCK_IP_CFG_SW_MAJOR_VERSION != CLOCK_IP_TYPES_SW_MAJOR_VERSION) || \ 65 (CLOCK_IP_CFG_SW_MINOR_VERSION != CLOCK_IP_TYPES_SW_MINOR_VERSION) || \ 66 (CLOCK_IP_CFG_SW_PATCH_VERSION != CLOCK_IP_TYPES_SW_PATCH_VERSION) \ 67 ) 68 #error "Software Version Numbers of Clock_Ip_Cfg.h and Clock_Ip_Types.h are different" 69 #endif 70 71 /*================================================================================================== 72 DEFINES AND MACROS 73 ==================================================================================================*/ 74 /** 75 * @brief Pre-processor switch for enabling the default error detection and reporting to the DET. 76 * The detection of default errors is configurable (ON / OFF) at pre-compile time. 77 */ 78 #define CLOCK_IP_DEV_ERROR_DETECT (STD_OFF) 79 80 #define CLOCK_IP_TIMEOUT_TYPE (OSIF_COUNTER_DUMMY) 81 82 #define CLOCK_IP_TIMEOUT_VALUE_US (50000) 83 84 /** 85 * @brief Support for User mode. 86 * If this parameter has been configured to 'TRUE' the Clock can be executed from both supervisor and user mode. 87 */ 88 #define CLOCK_IP_ENABLE_USER_MODE_SUPPORT (STD_OFF) 89 90 /** Check the driver user mode is enabled only when the MCAL_ENABLE_USER_MODE_SUPPORT is enabled */ 91 #ifndef MCAL_ENABLE_USER_MODE_SUPPORT 92 #if (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT) 93 #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Clock in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined. 94 #endif /* (STD_ON == CLOCK_IP_ENABLE_USER_MODE_SUPPORT) */ 95 #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */ 96 97 /*================================================================================================== 98 ENUMS 99 ==================================================================================================*/ 100 101 #ifdef CLOCK_IP_PREPARE_MEMORY_CONFIG 102 /** 103 * @brief The stage of the flash and ram controllers configuration. 104 * @details This is used to specify the entry and exit point of the flash and ram controllers configuration. 105 */ 106 typedef enum 107 { 108 CLOCK_IP_RAM_MEMORY_CONFIG_ENTRY_POINT = 0x77U, 109 CLOCK_IP_RAM_MEMORY_CONFIG_EXIT_POINT = 0x88U, 110 CLOCK_IP_FLASH_MEMORY_CONFIG_ENTRY_POINT = 0x89U, 111 CLOCK_IP_FLASH_MEMORY_CONFIG_EXIT_POINT = 0x90U 112 113 } Clock_Ip_MemoryConfigStageType; 114 #endif 115 116 117 /*================================================================================================== 118 STRUCTURES AND OTHER TYPEDEFS 119 ==================================================================================================*/ 120 121 /*================================================================================================== 122 * FUNCTION PROTOTYPES 123 ==================================================================================================*/ 124 #define MCU_START_SEC_CODE 125 #include "Mcu_MemMap.h" 126 127 #if CLOCK_IP_CMUS_COUNT > 0U 128 129 /** 130 * @brief This function clear the CMU interrupt flag from CMU module. 131 * @details Called by RGM ISR routine when a user notification for CMU FCCU events is configured 132 * 133 * @return void 134 * 135 */ 136 ISR(Mcu_Cmu_ClockFail_IRQHandler); 137 138 #endif 139 #define MCU_STOP_SEC_CODE 140 #include "Mcu_MemMap.h" 141 142 143 #define MCU_START_SEC_CONFIG_DATA_UNSPECIFIED 144 #include "Mcu_MemMap.h" 145 146 147 /* ************************************************************************* 148 * Configuration structure for Clock Configuration 149 * ************************************************************************* */ 150 151 extern const Clock_Ip_ClockConfigType Clock_Ip_aClockConfig[]; 152 153 154 #define MCU_STOP_SEC_CONFIG_DATA_UNSPECIFIED 155 #include "Mcu_MemMap.h" 156 157 #ifdef __cplusplus 158 } 159 #endif 160 161 #endif /* CLOCK_IP_CFG_H */ 162 163 /** @} */ 164