1 /******************************************************************************
2  *
3  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
4  * Analog Devices, Inc.),
5  * Copyright (C) 2023-2024 Analog Devices, Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************************/
20 
21 /**
22  * @file    mxc_device.h
23  * @brief   contains device and revision specific definitions
24  */
25 
26 #ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32662_MXC_DEVICE_H_
27 #define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32662_MXC_DEVICE_H_
28 
29 #include "max32662.h"
30 #include "mxc_errors.h"
31 #include "mxc_pins.h"
32 
33 #ifndef TARGET
34 #error TARGET NOT DEFINED
35 #endif
36 
37 // Create a string definition for the TARGET
38 #define STRING_ARG(arg) #arg
39 #define STRING_NAME(name) STRING_ARG(name)
40 #define TARGET_NAME STRING_NAME(TARGET)
41 
42 // Define which revisions of the IP we are using
43 #ifndef TARGET_REV
44 #error TARGET_REV NOT DEFINED
45 #endif
46 
47 #if (TARGET_REV == 0x4131)
48 // A1
49 #define MXC_PBM_REV 0
50 #define MXC_TMR_REV 0
51 #define MXC_UART_REV 1
52 #else
53 
54 #error TARGET_REV NOT SUPPORTED
55 
56 #endif // if(TARGET_REV == ...)
57 
58 #endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32662_MXC_DEVICE_H_
59