Skip to content

Commit 0784f03

Browse files
committed
[MAX32625MBED] Adding new Maxim Integrated target.
1 parent 1e5466a commit 0784f03

File tree

6 files changed

+465
-0
lines changed

6 files changed

+465
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
STDIO_UART = UART_1
48+
} UARTName;
49+
50+
typedef enum {
51+
I2C_0 = MXC_BASE_I2CM0,
52+
I2C_1 = MXC_BASE_I2CM1
53+
} I2CName;
54+
55+
typedef enum {
56+
SPI_0 = MXC_BASE_SPIM0,
57+
SPI_1 = MXC_BASE_SPIM1,
58+
SPI_2 = MXC_BASE_SPIM2
59+
} SPIName;
60+
61+
typedef enum {
62+
PWM_0 = MXC_BASE_PT0,
63+
PWM_1 = MXC_BASE_PT1,
64+
PWM_2 = MXC_BASE_PT2,
65+
PWM_3 = MXC_BASE_PT3,
66+
PWM_4 = MXC_BASE_PT4,
67+
PWM_5 = MXC_BASE_PT5,
68+
PWM_6 = MXC_BASE_PT6,
69+
PWM_7 = MXC_BASE_PT7,
70+
PWM_8 = MXC_BASE_PT8,
71+
PWM_9 = MXC_BASE_PT9,
72+
PWM_10 = MXC_BASE_PT10,
73+
PWM_11 = MXC_BASE_PT11,
74+
PWM_12 = MXC_BASE_PT12,
75+
PWM_13 = MXC_BASE_PT13,
76+
PWM_14 = MXC_BASE_PT14,
77+
PWM_15 = MXC_BASE_PT15
78+
} PWMName;
79+
80+
typedef enum {
81+
ADC = MXC_BASE_ADC
82+
} ADCName;
83+
84+
#ifdef __cplusplus
85+
}
86+
#endif
87+
88+
#endif
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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 = 0, /* MXC_V_GPIO_OUT_MODE_HIGH_Z,*/
46+
PIN_OUTPUT = 1 /* MXC_V_GPIO_OUT_MODE_NORMAL_DRIVE */
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+
62+
// Analog input pins
63+
AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5,
64+
65+
LED_GREEN = P3_1,
66+
LED_RED = P3_0,
67+
LED_YELLOW = P3_3,
68+
LED_BLUE = P3_2,
69+
70+
// mbed original LED naming
71+
LED1 = LED_RED,
72+
LED2 = LED_GREEN,
73+
LED3 = LED_BLUE,
74+
LED4 = LED_YELLOW,
75+
76+
// Push button
77+
SW2 = P2_2,
78+
SW3 = P2_3,
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+
// UART pins
94+
UART0_RX = P0_0,
95+
UART0_TX = P0_1,
96+
UART0_CTS = P0_2,
97+
UART0_RTS = P0_3,
98+
99+
UART1_RX = P2_0,
100+
UART1_TX = P2_1,
101+
UART1_CTS = P2_2,
102+
UART1_RTS = P2_3,
103+
104+
UART2_RX = P3_0,
105+
UART2_TX = P3_1,
106+
UART2_CTS = P3_2,
107+
UART2_RTS = P3_3,
108+
109+
// SPI pins
110+
SPI0_SCK = P0_4,
111+
SPI0_MOSI = P0_5,
112+
SPI0_MISO = P0_6,
113+
SPI0_SS = P0_7,
114+
115+
SPI1_SCK = P1_0,
116+
SPI1_MOSI = P1_1,
117+
SPI1_MISO = P1_2,
118+
SPI1_SS = P1_3,
119+
120+
SPI2_SCK = P2_4,
121+
SPI2_MOSI = P2_5,
122+
SPI2_MISO = P2_6,
123+
SPI2_SS = P2_7,
124+
125+
// Not connected
126+
NC = NOT_CONNECTED
127+
} PinName;
128+
129+
typedef enum {
130+
PullUp,
131+
PullDown,
132+
OpenDrain,
133+
PullNone,
134+
PullDefault = PullUp
135+
} PinMode;
136+
137+
typedef enum {
138+
LED_ON = 0,
139+
LED_OFF = 1
140+
} LedStates;
141+
142+
#ifdef __cplusplus
143+
}
144+
#endif
145+
146+
#endif
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; MAX32625
2+
; 512KB FLASH (0x80000) @ 0x000000000
3+
; 160KB RAM (0x28000) @ 0x20000000
4+
5+
LR_IROM1 0x000000000 0x80000 { ; load region size_region
6+
ER_IROM1 0x000000000 0x80000 { ; load address = execution address
7+
*.o (RESET, +First)
8+
*(InRoot$$Sections)
9+
.ANY (+RO)
10+
}
11+
12+
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
13+
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110) { ; RW data
14+
.ANY (+RW +ZI)
15+
}
16+
}

0 commit comments

Comments
 (0)