Skip to content

Commit 15cd3da

Browse files
authored
Merge pull request #3640 from maximmbed/max32630
MAX32630FTHR: Adding new platform
2 parents ade6722 + dddcf76 commit 15cd3da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+31024
-0
lines changed

targets/TARGET_Maxim/TARGET_MAX32630/PeripheralPins.c

Lines changed: 197 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included
12+
* in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18+
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* Except as contained in this notice, the name of Maxim Integrated
23+
* Products, Inc. shall not be used except as stated in the Maxim Integrated
24+
* Products, Inc. Branding Policy.
25+
*
26+
* The mere transfer of this software does not imply any licenses
27+
* of trade secrets, proprietary technology, copyrights, patents,
28+
* trademarks, maskwork rights, or any other form of intellectual
29+
* property whatsoever. Maxim Integrated Products, Inc. retains all
30+
* ownership rights.
31+
*******************************************************************************
32+
*/
33+
34+
#ifndef MBED_PERIPHERALPINS_H
35+
#define MBED_PERIPHERALPINS_H
36+
37+
#include "pinmap.h"
38+
39+
//************I2C***************
40+
extern const PinMap PinMap_I2C_SDA[];
41+
extern const PinMap PinMap_I2C_SCL[];
42+
43+
//************UART***************
44+
extern const PinMap PinMap_UART_TX[];
45+
extern const PinMap PinMap_UART_RX[];
46+
extern const PinMap PinMap_UART_CTS[];
47+
extern const PinMap PinMap_UART_RTS[];
48+
49+
//************SPI***************
50+
extern const PinMap PinMap_SPI_SCLK[];
51+
extern const PinMap PinMap_SPI_MOSI[];
52+
extern const PinMap PinMap_SPI_MISO[];
53+
extern const PinMap PinMap_SPI_SSEL[];
54+
55+
//************PWM***************
56+
extern const PinMap PinMap_PWM[];
57+
58+
//************ADC***************
59+
extern const PinMap PinMap_ADC[];
60+
#endif
61+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included
12+
* in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18+
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* Except as contained in this notice, the name of Maxim Integrated
23+
* Products, Inc. shall not be used except as stated in the Maxim Integrated
24+
* Products, Inc. Branding Policy.
25+
*
26+
* The mere transfer of this software does not imply any licenses
27+
* of trade secrets, proprietary technology, copyrights, patents,
28+
* trademarks, maskwork rights, or any other form of intellectual
29+
* property whatsoever. Maxim Integrated Products, Inc. retains all
30+
* ownership rights.
31+
*******************************************************************************
32+
*/
33+
34+
#ifndef MBED_PORTNAMES_H
35+
#define MBED_PORTNAMES_H
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
typedef enum {
42+
Port0 = 0,
43+
Port1,
44+
Port2,
45+
Port3,
46+
Port4,
47+
Port5,
48+
Port6,
49+
Port7,
50+
Port8,
51+
} PortName;
52+
53+
#ifdef __cplusplus
54+
}
55+
#endif
56+
#endif
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included
12+
* in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18+
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* Except as contained in this notice, the name of Maxim Integrated
23+
* Products, Inc. shall not be used except as stated in the Maxim Integrated
24+
* Products, Inc. Branding Policy.
25+
*
26+
* The mere transfer of this software does not imply any licenses
27+
* of trade secrets, proprietary technology, copyrights, patents,
28+
* trademarks, maskwork rights, or any other form of intellectual
29+
* property whatsoever. Maxim Integrated Products, Inc. retains all
30+
* ownership rights.
31+
*******************************************************************************
32+
*/
33+
34+
#ifndef MBED_PERIPHERALNAMES_H
35+
#define MBED_PERIPHERALNAMES_H
36+
37+
#include "cmsis.h"
38+
39+
#ifdef __cplusplus
40+
extern "C" {
41+
#endif
42+
43+
typedef enum {
44+
UART_0 = MXC_BASE_UART0,
45+
UART_1 = MXC_BASE_UART1,
46+
UART_2 = MXC_BASE_UART2,
47+
UART_3 = MXC_BASE_UART3,
48+
STDIO_UART = UART_1
49+
} UARTName;
50+
51+
typedef enum {
52+
I2C_0 = MXC_BASE_I2CM0,
53+
I2C_1 = MXC_BASE_I2CM1,
54+
I2C_2 = MXC_BASE_I2CM2
55+
} I2CName;
56+
57+
typedef enum {
58+
SPI_0 = MXC_BASE_SPIM0,
59+
SPI_1 = MXC_BASE_SPIM1,
60+
SPI_2 = MXC_BASE_SPIM2
61+
} SPIName;
62+
63+
typedef enum {
64+
PWM_0 = MXC_BASE_PT0,
65+
PWM_1 = MXC_BASE_PT1,
66+
PWM_2 = MXC_BASE_PT2,
67+
PWM_3 = MXC_BASE_PT3,
68+
PWM_4 = MXC_BASE_PT4,
69+
PWM_5 = MXC_BASE_PT5,
70+
PWM_6 = MXC_BASE_PT6,
71+
PWM_7 = MXC_BASE_PT7,
72+
PWM_8 = MXC_BASE_PT8,
73+
PWM_9 = MXC_BASE_PT9,
74+
PWM_10 = MXC_BASE_PT10,
75+
PWM_11 = MXC_BASE_PT11,
76+
PWM_12 = MXC_BASE_PT12,
77+
PWM_13 = MXC_BASE_PT13,
78+
PWM_14 = MXC_BASE_PT14,
79+
PWM_15 = MXC_BASE_PT15
80+
} PWMName;
81+
82+
typedef enum {
83+
ADC = MXC_BASE_ADC
84+
} ADCName;
85+
86+
#ifdef __cplusplus
87+
}
88+
#endif
89+
90+
#endif
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included
12+
* in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18+
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* Except as contained in this notice, the name of Maxim Integrated
23+
* Products, Inc. shall not be used except as stated in the Maxim Integrated
24+
* Products, Inc. Branding Policy.
25+
*
26+
* The mere transfer of this software does not imply any licenses
27+
* of trade secrets, proprietary technology, copyrights, patents,
28+
* trademarks, maskwork rights, or any other form of intellectual
29+
* property whatsoever. Maxim Integrated Products, Inc. retains all
30+
* ownership rights.
31+
*******************************************************************************
32+
*/
33+
34+
#ifndef MBED_PINNAMES_H
35+
#define MBED_PINNAMES_H
36+
37+
#include "cmsis.h"
38+
#include "gpio_regs.h"
39+
40+
#ifdef __cplusplus
41+
extern "C" {
42+
#endif
43+
44+
typedef enum {
45+
PIN_INPUT = MXC_V_GPIO_OUT_MODE_NORMAL_HIGH_Z,
46+
PIN_OUTPUT = MXC_V_GPIO_OUT_MODE_NORMAL
47+
} PinDirection;
48+
49+
#define PORT_SHIFT 12
50+
#define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT)
51+
#define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT))
52+
53+
#define NOT_CONNECTED (int)0xFFFFFFFF
54+
55+
typedef enum {
56+
P0_0 = (0 << PORT_SHIFT), P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7,
57+
P1_0 = (1 << PORT_SHIFT), P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7,
58+
P2_0 = (2 << PORT_SHIFT), P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7,
59+
P3_0 = (3 << PORT_SHIFT), P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7,
60+
P4_0 = (4 << PORT_SHIFT), P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7,
61+
P5_0 = (5 << PORT_SHIFT), P5_1, P5_2, P5_3, P5_4, P5_5, P5_6, P5_7,
62+
P6_0 = (6 << PORT_SHIFT), P6_1, P6_2, P6_3, P6_4, P6_5, P6_6, P6_7,
63+
P7_0 = (7 << PORT_SHIFT), P7_1, P7_2, P7_3, P7_4, P7_5, P7_6, P7_7,
64+
P8_0 = (8 << PORT_SHIFT), P8_1,
65+
66+
// Analog input pins
67+
AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, AIN_6, AIN_7, AIN_8, AIN_9,
68+
69+
// LEDs
70+
LED_RED = P2_4,
71+
LED_GREEN = P2_5,
72+
LED_BLUE = P2_6,
73+
LED1 = LED_RED,
74+
LED2 = LED_GREEN,
75+
LED3 = LED_BLUE,
76+
LED4 = NOT_CONNECTED,
77+
78+
// Push button
79+
SW1 = P2_3,
80+
SW2 = NOT_CONNECTED,
81+
SW3 = NOT_CONNECTED,
82+
83+
// USB bridge connected UART pins
84+
USBTX = P2_1,
85+
USBRX = P2_0,
86+
STDIO_UART_TX = USBTX,
87+
STDIO_UART_RX = USBRX,
88+
89+
// I2C pins
90+
I2C0_SCL = NOT_CONNECTED,
91+
I2C0_SDA = NOT_CONNECTED,
92+
93+
I2C1_SCL = P3_5,
94+
I2C1_SDA = P3_4,
95+
96+
I2C2_SCL = P6_0,
97+
I2C2_SDA = P5_7,
98+
99+
// UART pins
100+
UART0_RX = P0_0,
101+
UART0_TX = P0_1,
102+
UART0_CTS = P0_2,
103+
UART0_RTS = P0_3,
104+
105+
UART1_RX = P2_0,
106+
UART1_TX = P2_1,
107+
UART1_CTS = NOT_CONNECTED,
108+
UART1_RTS = NOT_CONNECTED,
109+
110+
UART2_RX = P3_0,
111+
UART2_TX = P3_1,
112+
UART2_CTS = P3_2,
113+
UART2_RTS = P3_3,
114+
115+
UART3_RX = P5_3,
116+
UART3_TX = P5_4,
117+
UART3_CTS = P5_5,
118+
UART3_RTS = P5_6,
119+
120+
// SPI pins
121+
SPI0_SCK = P0_4,
122+
SPI0_MOSI = P0_5,
123+
SPI0_MISO = P0_6,
124+
SPI0_SS = P0_7,
125+
126+
SPI1_SCK = P1_0,
127+
SPI1_MOSI = P1_1,
128+
SPI1_MISO = P1_2,
129+
SPI1_SS = P1_3,
130+
SPI1_DIO2 = P1_4,
131+
SPI1_DIO3 = P1_5,
132+
133+
SPI2_SCK = P5_0,
134+
SPI2_MOSI = P5_1,
135+
SPI2_MISO = P5_2,
136+
SPI2_SS = P5_3,
137+
SPI2_SDIO2 = P5_4,
138+
SPI2_SDIO3 = P5_5,
139+
SPI2_SRN = P5_6,
140+
141+
// 1-Wire Master
142+
OWM = P4_0,
143+
144+
// BTLE Module hardwired
145+
BT_RST = P1_6,
146+
BT_CLK = P1_7,
147+
148+
// MAX14690N hardwired
149+
PMIC_INT = P3_7,
150+
MPC = P2_7,
151+
MON = AIN_0,
152+
153+
// BMI160 hardwired
154+
IMU_INT = P3_6,
155+
156+
// microSD hardwired
157+
DETECT = P2_2,
158+
159+
// Not connected
160+
NC = NOT_CONNECTED
161+
} PinName;
162+
163+
typedef enum {
164+
PullUp,
165+
PullDown,
166+
OpenDrain,
167+
PullNone,
168+
PullDefault = PullUp
169+
} PinMode;
170+
171+
typedef enum {
172+
LED_ON = 0,
173+
LED_OFF = 1
174+
} LedStates;
175+
176+
#ifdef __cplusplus
177+
}
178+
#endif
179+
180+
#endif

0 commit comments

Comments
 (0)