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