Skip to content

Commit 480333f

Browse files
Jiwon Yuneadbridge
authored andcommitted
SDT32620B added
1 parent 91eda52 commit 480333f

File tree

3 files changed

+287
-0
lines changed

3 files changed

+287
-0
lines changed
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: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
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+
// Analog
68+
A0 = AIN_0,
69+
A1 = AIN_1,
70+
A2 = AIN_2,
71+
A3 = AIN_3,
72+
73+
// General Pin Input Output (GPIO)
74+
GPIO0 = P1_4,
75+
GPIO1 = P1_5,
76+
GPIO2 = P4_0,
77+
GPIO3 = P4_1,
78+
GPIO4 = P4_2,
79+
GPIO5 = P4_3,
80+
GPIO6 = P5_6,
81+
82+
//Purse Width Modulation (PWM)
83+
PWM0 = GPIO2,
84+
PWM1 = GPIO3,
85+
PWM2 = GPIO0,
86+
PWM3 = GPIO1,
87+
88+
// LEDs
89+
LED0 = GPIO0,
90+
LED1 = GPIO1,
91+
LED2 = GPIO2,
92+
LED3 = NOT_CONNECTED,
93+
LED4 = NOT_CONNECTED,
94+
95+
LED_RED = LED0,
96+
LED_GREEN = LED1,
97+
LED_BLUE = LED2,
98+
99+
// USB bridge and SWD UART connected UART pins
100+
USBTX = P2_1,
101+
USBRX = P2_0,
102+
STDIO_UART_TX = USBTX,
103+
STDIO_UART_RX = USBRX,
104+
105+
// UART pins
106+
UART0_RX = P0_0,
107+
UART0_TX = P0_1,
108+
UART0_CTS = P0_2,
109+
UART0_RTS = P0_3,
110+
111+
UART1_RX = P2_0,
112+
UART1_TX = P2_1,
113+
UART1_CTS = P2_2,
114+
UART1_RTS = P2_3,
115+
116+
UART2_RX = P3_0,
117+
UART2_TX = P3_1,
118+
UART2_CTS = P3_2,
119+
UART2_RTS = P3_3,
120+
121+
// I2C pins
122+
I2C0_SCL = P1_7,
123+
I2C0_SDA = P1_6,
124+
125+
I2C1_SCL = P3_5,
126+
I2C1_SDA = P3_4,
127+
128+
I2C2_SCL = P6_0,
129+
I2C2_SDA = P5_7,
130+
131+
// SPI pins
132+
SPI0_SCK = P0_4,
133+
SPI0_MOSI = P0_5,
134+
SPI0_MISO = P0_6,
135+
SPI0_SS0 = P0_7,
136+
SPI0_SS1 = P4_4,
137+
SPI0_SS2 = P4_5,
138+
139+
SPI1_SCK = P1_0,
140+
SPI1_MOSI = P1_1,
141+
SPI1_MISO = P1_2,
142+
SPI1_SS0 = P1_3,
143+
SPI1_SS1 = P3_6,
144+
SPI1_SS2 = P3_7,
145+
146+
SPI2_SCK = P2_4,
147+
SPI2_MOSI = P2_5,
148+
SPI2_MISO = P2_6,
149+
SPI2_SS0 = P2_7,
150+
SPI2_SS1 = P4_6,
151+
SPI2_SS2 = P4_7,
152+
153+
SPI3_SCK = P5_0,
154+
SPI3_MOSI = P5_1,
155+
SPI3_MISO = P5_2,
156+
SPI3_SS0 = P5_3,
157+
SPI3_SS1 = P5_4,
158+
SPI3_SS2 = P5_5,
159+
160+
// SWD UART
161+
SWD_TGT_TX = UART1_TX,
162+
SWD_TGT_RX = UART1_RX,
163+
SWD_TGT_CTS = UART1_CTS,
164+
SWD_TGT_RTS = UART1_RTS,
165+
166+
// Not connected
167+
NC = NOT_CONNECTED
168+
} PinName;
169+
170+
typedef enum {
171+
PullUp,
172+
PullDown,
173+
OpenDrain,
174+
PullNone,
175+
PullDefault = PullUp
176+
} PinMode;
177+
178+
typedef enum {
179+
LED_ON = 0,
180+
LED_OFF = 1
181+
} LedStates;
182+
183+
#ifdef __cplusplus
184+
}
185+
#endif
186+
187+
#endif

targets/targets.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,6 +3065,16 @@
30653065
"device_has": ["ANALOGIN", "I2C", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES", "USTICKER"],
30663066
"release_versions": ["2", "5"]
30673067
},
3068+
"SDT32620B": {
3069+
"inherits": ["Target"],
3070+
"core": "Cortex-M4F",
3071+
"macros": ["__SYSTEM_HFX=96000000","TARGET=MAX32620","TARGET_REV=0x4332","OPEN_DRAIN_LEDS"],
3072+
"detect_code": ["3101"],
3073+
"extra_labels": ["Maxim", "MAX32620C"],
3074+
"supported_toolchains": ["GCC_ARM", "IAR", "ARM"],
3075+
"device_has": ["ANALOGIN", "I2C", "INTERRUPTIN", "LPTICKER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES", "USTICKER"],
3076+
"release_versions": ["2", "5"]
3077+
},
30683078
"MAX32625_BASE": {
30693079
"inherits": ["Target"],
30703080
"core": "Cortex-M4F",

0 commit comments

Comments
 (0)