1 /**
2  * @file    mxc_pins.h
3  * @brief   This file contains constant pin configurations for the peripherals.
4  */
5 
6 /******************************************************************************
7  *
8  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9  * Analog Devices, Inc.),
10  * Copyright (C) 2023-2024 Analog Devices, Inc.
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  *     http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  *
24  ******************************************************************************/
25 
26 #ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32662_MXC_PINS_H_
27 #define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32662_MXC_PINS_H_
28 
29 #include "gpio.h"
30 
31 typedef enum { MAP_A, MAP_B, MAP_C } sys_map_t;
32 
33 /***** Global Variables *****/
34 // Predefined GPIO Configurations
35 extern const mxc_gpio_cfg_t gpio_cfg_lp_extclk;
36 extern const mxc_gpio_cfg_t gpio_cfg_hf_extclk;
37 
38 extern const mxc_gpio_cfg_t gpio_cfg_i2c0;
39 extern const mxc_gpio_cfg_t gpio_cfg_i2c1;
40 
41 extern const mxc_gpio_cfg_t gpio_cfg_uart0;
42 extern const mxc_gpio_cfg_t gpio_cfg_uart0_flow;
43 extern const mxc_gpio_cfg_t gpio_cfg_uart0_flow_disable;
44 extern const mxc_gpio_cfg_t gpio_cfg_uart0b;
45 extern const mxc_gpio_cfg_t gpio_cfg_uart0b_flow;
46 extern const mxc_gpio_cfg_t gpio_cfg_uart0b_flow_disable;
47 extern const mxc_gpio_cfg_t gpio_cfg_uart1;
48 extern const mxc_gpio_cfg_t gpio_cfg_uart1_flow;
49 extern const mxc_gpio_cfg_t gpio_cfg_uart1_flow_disable;
50 
51 // Timers are only defined once, depending on package, each timer could be mapped to other pins
52 extern const mxc_gpio_cfg_t gpio_cfg_tmr0;
53 extern const mxc_gpio_cfg_t gpio_cfg_tmr0b;
54 extern const mxc_gpio_cfg_t gpio_cfg_tmr0c;
55 extern const mxc_gpio_cfg_t gpio_cfg_tmr1;
56 extern const mxc_gpio_cfg_t gpio_cfg_tmr1b;
57 extern const mxc_gpio_cfg_t gpio_cfg_tmr1c;
58 extern const mxc_gpio_cfg_t gpio_cfg_tmr2;
59 extern const mxc_gpio_cfg_t gpio_cfg_tmr2b;
60 extern const mxc_gpio_cfg_t gpio_cfg_tmr2c;
61 extern const mxc_gpio_cfg_t gpio_cfg_tmr3;
62 
63 extern const mxc_gpio_cfg_t gpio_cfg_i2s;
64 
65 extern const mxc_gpio_cfg_t gpio_cfg_spi0;
66 extern const mxc_gpio_cfg_t gpio_cfg_spi0_ss0;
67 
68 extern const mxc_gpio_cfg_t gpio_cfg_spi1;
69 extern const mxc_gpio_cfg_t gpio_cfg_spi1_ss0;
70 extern const mxc_gpio_cfg_t gpio_cfg_spi1b;
71 extern const mxc_gpio_cfg_t gpio_cfg_spi1b_ss0;
72 
73 extern const mxc_gpio_cfg_t gpio_cfg_pt0;
74 extern const mxc_gpio_cfg_t gpio_cfg_pt1;
75 extern const mxc_gpio_cfg_t gpio_cfg_pt2;
76 extern const mxc_gpio_cfg_t gpio_cfg_pt3;
77 
78 extern const mxc_gpio_cfg_t gpio_cfg_adc_ain0;
79 extern const mxc_gpio_cfg_t gpio_cfg_adc_ain1;
80 extern const mxc_gpio_cfg_t gpio_cfg_adc_ain2;
81 extern const mxc_gpio_cfg_t gpio_cfg_adc_ain3;
82 
83 extern const mxc_gpio_cfg_t gpio_cfg_adc_trig_p0_9;
84 extern const mxc_gpio_cfg_t gpio_cfg_adc_trig_p0_0;
85 
86 extern const mxc_gpio_cfg_t gpio_cfg_can;
87 extern const mxc_gpio_cfg_t gpio_cfg_canb;
88 
89 // SPI v2 Pin Definitions
90 extern const mxc_gpio_cfg_t gpio_cfg_spi0_standard;
91 extern const mxc_gpio_cfg_t gpio_cfg_spi0_3wire;
92 // MXC_SPI0 does not support Dual or Quad mode.
93 extern const mxc_gpio_cfg_t gpio_cfg_spi1a_standard;
94 extern const mxc_gpio_cfg_t gpio_cfg_spi1a_3wire;
95 extern const mxc_gpio_cfg_t gpio_cfg_spi1b_standard;
96 extern const mxc_gpio_cfg_t gpio_cfg_spi1b_3wire;
97 // MXC_SPI1 does not support Dual or Quad mode.
98 
99 // SPI v2 Target Selects Pin Definitions
100 extern const mxc_gpio_cfg_t gpio_cfg_spi0_ts0;
101 extern const mxc_gpio_cfg_t gpio_cfg_spi1a_ts0;
102 extern const mxc_gpio_cfg_t gpio_cfg_spi1b_ts0;
103 
104 #endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32662_MXC_PINS_H_
105