Skip to content

Commit 1b2f63a

Browse files
authored
Merge pull request #6503 from maximmbed/add-platform-MAX32620C
[MAX32620C] Add new target
2 parents 192a8e5 + 2bb78d4 commit 1b2f63a

Some content is hidden

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

123 files changed

+29544
-1
lines changed

targets/TARGET_Maxim/TARGET_MAX32620C/PeripheralPins.c

Lines changed: 194 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) 2017 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) 2017 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: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
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),
63+
64+
// Analog input pins
65+
AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, AIN_6, AIN_7, AIN_8, AIN_9, AIN_10, AIN_11,
66+
67+
// LEDs
68+
LED1 = P2_4,
69+
LED2 = P2_5,
70+
LED3 = P2_6,
71+
LED4 = LED1,
72+
73+
LED_RED = LED1,
74+
LED_GREEN = LED2,
75+
LED_BLUE = LED3,
76+
77+
// Push button
78+
SW1 = P2_7,
79+
80+
// USB bridge connected UART pins
81+
USBTX = P2_1,
82+
USBRX = P2_0,
83+
STDIO_UART_TX = USBTX,
84+
STDIO_UART_RX = USBRX,
85+
86+
// I2C pins
87+
I2C0_SCL = P1_7,
88+
I2C0_SDA = P1_6,
89+
90+
I2C1_SCL = P3_5,
91+
I2C1_SDA = P3_4,
92+
93+
I2C2_SCL = P6_0,
94+
I2C2_SDA = P5_7,
95+
96+
// UART pins
97+
UART0_RX = P0_0,
98+
UART0_TX = P0_1,
99+
UART0_CTS = P0_2,
100+
UART0_RTS = P0_3,
101+
102+
UART1_RX = P2_0,
103+
UART1_TX = P2_1,
104+
UART1_CTS = P2_2,
105+
UART1_RTS = P2_3,
106+
107+
UART2_RX = P3_0,
108+
UART2_TX = P3_1,
109+
UART2_CTS = P3_2,
110+
UART2_RTS = P3_3,
111+
112+
UART3_RX = P5_3,
113+
UART3_TX = P5_4,
114+
UART3_CTS = P5_5,
115+
UART3_RTS = P5_6,
116+
117+
// SPI pins
118+
SPI0_SCK = P0_4,
119+
SPI0_MOSI = P0_5,
120+
SPI0_MISO = P0_6,
121+
SPI0_SS = P0_7,
122+
123+
SPI1_SCK = P1_0,
124+
SPI1_MOSI = P1_1,
125+
SPI1_MISO = P1_2,
126+
SPI1_SS = P1_3,
127+
128+
SPI2_SCK = NOT_CONNECTED,
129+
SPI2_MOSI = NOT_CONNECTED,
130+
SPI2_MISO = NOT_CONNECTED,
131+
SPI2_SS = NOT_CONNECTED,
132+
133+
// 1-Wire Master
134+
OWM_IO = P4_0,
135+
OWM_PUE = P4_1,
136+
137+
// Not connected
138+
NC = NOT_CONNECTED
139+
} PinName;
140+
141+
typedef enum {
142+
PullUp,
143+
PullDown,
144+
OpenDrain,
145+
PullNone,
146+
PullDefault = PullUp
147+
} PinMode;
148+
149+
typedef enum {
150+
LED_ON = 0,
151+
LED_OFF = 1
152+
} LedStates;
153+
154+
#ifdef __cplusplus
155+
}
156+
#endif
157+
158+
#endif

0 commit comments

Comments
 (0)