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_MAX32660_MXC_DEVICE_H_
27 #define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32660_MXC_DEVICE_H_
28 
29 #include "max32660.h"
30 #include "mxc_errors.h"
31 
32 #ifndef TARGET
33 #error TARGET NOT DEFINED
34 #endif
35 
36 // Create a string definition for the TARGET
37 #define STRING_ARG(arg) #arg
38 #define STRING_NAME(name) STRING_ARG(name)
39 #define TARGET_NAME STRING_NAME(TARGET)
40 
41 // Define which revisions of the IP we are using
42 #ifndef TARGET_REV
43 #error TARGET_REV NOT DEFINED
44 #endif
45 
46 #if (TARGET_REV == 0x4131)
47 // A1
48 #define MXC_PBM_REV 0
49 #define MXC_TMR_REV 0
50 #define MXC_UART_REV 1
51 #else
52 
53 #error TARGET_REV NOT SUPPORTED
54 
55 #endif // if(TARGET_REV == ...)
56 
57 #endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32660_MXC_DEVICE_H_
58