1 /* 2 * Copyright 2022 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef LINFLEXD_UART_IP_DEFINES_H 8 #define LINFLEXD_UART_IP_DEFINES_H 9 10 /** 11 * @file 12 * @defgroup linflexd_uart_ip Linflexd UART IPL 13 * @addtogroup linflexd_uart_ip Linflexd UART IPL 14 * @{ 15 */ 16 17 /*================================================================================================== 18 * INCLUDE FILES 19 * 1) system and project includes 20 * 2) needed interfaces from external units 21 * 3) internal and external interfaces from this unit 22 * 4) user callback header files 23 ==================================================================================================*/ 24 #include <zephyr/devicetree.h> 25 #include "S32Z2_LINFLEXD.h" 26 #include "Mcal.h" 27 /*================================================================================================== 28 * SOURCE FILE VERSION INFORMATION 29 ==================================================================================================*/ 30 #define LINFLEXD_UART_IP_DEFINES_VENDOR_ID 43 31 #define LINFLEXD_UART_IP_DEFINES_AR_RELEASE_MAJOR_VERSION 4 32 #define LINFLEXD_UART_IP_DEFINES_AR_RELEASE_MINOR_VERSION 7 33 #define LINFLEXD_UART_IP_DEFINES_AR_RELEASE_REVISION_VERSION 0 34 #define LINFLEXD_UART_IP_DEFINES_SW_MAJOR_VERSION 0 35 #define LINFLEXD_UART_IP_DEFINES_SW_MINOR_VERSION 9 36 #define LINFLEXD_UART_IP_DEFINES_SW_PATCH_VERSION 0 37 38 /*================================================================================================== 39 * FILE VERSION CHECKS 40 ==================================================================================================*/ 41 #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK 42 /* Checks against Mcal.h */ 43 #if ((LINFLEXD_UART_IP_DEFINES_AR_RELEASE_MAJOR_VERSION != MCAL_AR_RELEASE_MAJOR_VERSION) || \ 44 (LINFLEXD_UART_IP_DEFINES_AR_RELEASE_MINOR_VERSION != MCAL_AR_RELEASE_MINOR_VERSION)) 45 #error "AUTOSAR Version Numbers of Linflexd_Uart_Ip_Defines.h and Mcal.h are different" 46 #endif 47 #endif 48 /*================================================================================================== 49 * CONSTANTS 50 ==================================================================================================*/ 51 52 /*================================================================================================== 53 * DEFINES AND MACROS 54 ==================================================================================================*/ 55 /* @brief Development error detection */ 56 #define LINFLEXD_UART_IP_DEV_ERROR_DETECT (STD_OFF) 57 58 /* @brief Total number of channels configured */ 59 #define LINFLEXD_UART_IP_NUMBER_OF_INSTANCES (DT_NUM_INST_STATUS_OKAY(nxp_s32_linflexd)) 60 61 /* @brief Uart Osif source counter. This parameter is used to select between different OsIf counter implementation */ 62 #define LINFLEXD_UART_IP_TIMEOUT_TYPE (OSIF_COUNTER_DUMMY) 63 64 /* @brief Number of loops before returning STATUS_TIMEOUT.*/ 65 #define LINFLEXD_UART_IP_TIMEOUT_VALUE_US (0) 66 67 /* @brief LINFLEXD rx/tx/error interrupt lines ored together. */ 68 #define LINFLEXD_UART_IP_ORED_INT_LINES (1U) 69 70 /* @brief LINFlexD DMA support */ 71 #define LINFLEXD_UART_IP_HAS_DMA_ENABLED (STD_OFF) 72 73 /* @brief LINFlexD User-mode support */ 74 #define LINFLEXD_UART_IP_ENABLE_USER_MODE_SUPPORT (STD_OFF) 75 76 /* @brief LINFLEXD DMA enabled instances */ 77 #define LINFLEXD_UART_IP_INST_HAS_DMA {(boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE, (boolean)TRUE} 78 79 /* @brief Support for Uart Timeout Interrupt. If this parameter has been configured to TRUE, the Uart driver will enable Timeout Interrupt. */ 80 #define LINFLEXD_UART_IP_ENABLE_TIMEOUT_INTERRUPT (STD_OFF) 81 82 #if (STD_ON == LINFLEXD_UART_IP_ENABLE_TIMEOUT_INTERRUPT) 83 /* @brief Array of instances that have loopback mode enabled. */ 84 #define LINFLEXD_UART_IP_ENABLE_TIMEOUT_INTERRUPT_PER_INSTANCE {(boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE} 85 #endif 86 87 /* @brief Support for Internal Loopback. If this parameter has been configured to TRUE, the Uart driver will be executed in Loopback mode. */ 88 #define LINFLEXD_UART_IP_ENABLE_INTERNAL_LOOPBACK (STD_OFF) 89 90 #if (STD_ON == LINFLEXD_UART_IP_ENABLE_INTERNAL_LOOPBACK) 91 /* @brief Array of instances that have loopback mode enabled. */ 92 #define LINFLEXD_UART_IP_ENABLE_INTERNAL_LOOPBACK_PER_INSTANCE {(boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE, (boolean) FALSE} 93 #endif 94 95 /* Check the driver user mode is enabled only when the MCAL_ENABLE_USER_MODE_SUPPORT is enabled */ 96 #ifndef MCAL_ENABLE_USER_MODE_SUPPORT 97 #if (STD_ON == LINFLEXD_UART_IP_ENABLE_USER_MODE_SUPPORT) 98 #error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Uart in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined. 99 #endif /* (STD_ON == LINFLEXD_UART_IP_ENABLE_USER_MODE_SUPPORT) */ 100 #endif /* ifndef MCAL_ENABLE_USER_MODE_SUPPORT */ 101 102 #ifdef MCAL_LINFLEX_REG_PROT_AVAILABLE 103 #if ((STD_ON == LINFLEXD_UART_IP_ENABLE_USER_MODE_SUPPORT) && (STD_ON == MCAL_LINFLEX_REG_PROT_AVAILABLE)) 104 /* @brief User mode enabled. */ 105 #define LINFLEXD_UART_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE (STD_ON) 106 #else 107 /* @brief User mode disabled. */ 108 #define LINFLEXD_UART_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE (STD_OFF) 109 #endif 110 #else 111 /* @brief User mode disabled. */ 112 #define LINFLEXD_UART_IP_SET_USER_ACCESS_ALLOWED_AVAILABLE (STD_OFF) 113 #endif /* MCAL_LINFLEX_REG_PROT_AVAILABLE */ 114 /*================================================================================================== 115 * ENUMS 116 ==================================================================================================*/ 117 118 /*================================================================================================== 119 * STRUCTURES AND OTHER TYPEDEFS 120 ==================================================================================================*/ 121 122 /*================================================================================================== 123 * GLOBAL VARIABLE DECLARATIONS 124 ==================================================================================================*/ 125 126 /*================================================================================================== 127 * FUNCTION PROTOTYPES 128 ==================================================================================================*/ 129 130 131 #ifdef __cplusplus 132 } 133 #endif 134 135 /** @} */ 136 137 #endif /* LINFLEXD_UART_IP_DEFINES_H */ 138