Skip to content

Commit 4318caa

Browse files
author
Cruz Monrreal
authored
Merge pull request #6779 from maximmbed/add-max32625pico
[MAX32625PICO] Add new platform
2 parents ab7a856 + fcd1bc9 commit 4318caa

File tree

11 files changed

+589
-45
lines changed

11 files changed

+589
-45
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: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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, AIN_6, AIN_7, AIN_8, AIN_9,
64+
65+
// LEDs
66+
LED1 = P2_4,
67+
LED2 = P2_5,
68+
LED3 = P2_6,
69+
LED4 = LED1,
70+
LED_RED = LED1,
71+
LED_GREEN = LED2,
72+
LED_BLUE = LED3,
73+
74+
// Push button
75+
SW1 = P2_7,
76+
// Standardized button names
77+
BUTTON1 = SW1,
78+
79+
// USB bridge connected UART pins
80+
USBTX = P2_1,
81+
USBRX = P2_0,
82+
STDIO_UART_TX = USBTX,
83+
STDIO_UART_RX = USBRX,
84+
85+
// I2C pins
86+
I2C0_SCL = P1_7,
87+
I2C0_SDA = P1_6,
88+
89+
I2C1_SCL = P3_5,
90+
I2C1_SDA = P3_4,
91+
92+
// UART pins
93+
UART0_RX = P0_0,
94+
UART0_TX = P0_1,
95+
UART0_CTS = P0_2,
96+
UART0_RTS = P0_3,
97+
98+
UART1_RX = P2_0,
99+
UART1_TX = P2_1,
100+
101+
UART2_RX = P3_0,
102+
UART2_TX = P3_1,
103+
UART2_CTS = P3_2,
104+
UART2_RTS = P3_3,
105+
106+
// SPI pins
107+
SPI0_SCK = P0_4,
108+
SPI0_MOSI = P0_5,
109+
SPI0_MISO = P0_6,
110+
SPI0_SS = P0_7,
111+
112+
SPI1_SCK = P1_0,
113+
SPI1_MOSI = P1_1,
114+
SPI1_MISO = P1_2,
115+
SPI1_SS = P1_3,
116+
117+
SPI2_SCK = P2_4,
118+
SPI2_MOSI = P2_5,
119+
SPI2_MISO = P2_6,
120+
SPI2_SS = P2_7,
121+
122+
// Default peripherals defines
123+
I2C_SCL = I2C0_SCL,
124+
I2C_SDA = I2C0_SDA,
125+
126+
UART_RX = UART0_RX,
127+
UART_TX = UART0_TX,
128+
UART_CTS = UART0_CTS,
129+
UART_RTS = UART0_RTS,
130+
131+
SPI_SCK = SPI0_SCK,
132+
SPI_MOSI = SPI0_MOSI,
133+
SPI_MISO = SPI0_MISO,
134+
SPI_SS = SPI0_SS,
135+
136+
// Not connected
137+
NC = NOT_CONNECTED
138+
} PinName;
139+
140+
typedef enum {
141+
PullUp,
142+
PullDown,
143+
OpenDrain,
144+
PullNone,
145+
PullDefault = PullUp
146+
} PinMode;
147+
148+
typedef enum {
149+
LED_ON = 0,
150+
LED_OFF = 1
151+
} LedStates;
152+
153+
#ifdef __cplusplus
154+
}
155+
#endif
156+
157+
#endif
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
#include "cmsis.h"
35+
#include "ioman_regs.h"
36+
#include "gpio_regs.h"
37+
38+
//******************************************************************************
39+
// This function will get called early in system initialization
40+
void low_level_init(void)
41+
{
42+
/* The MAX32625PICO board utilizes a bootloader that can leave some
43+
* peripherals in a partially configured state. This function resets
44+
* those to allow proper initialization.
45+
*/
46+
MXC_IOMAN->uart0_req = 0x0; // Clear any requests
47+
MXC_IOMAN->uart1_req = 0x0; // Clear any requests
48+
49+
MXC_GPIO->inten[2] = 0x0; // Clear interrupt enable
50+
MXC_GPIO->int_mode[2] = 0x0; // Clear interrupt mode
51+
MXC_GPIO->in_mode[2] = 0x22222222; // Clear input mode
52+
MXC_GPIO->out_val[2] = 0x0; // Clear output value
53+
MXC_GPIO->out_mode[2] = 0xFFFFFFFF; // Clear output mode
54+
}
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 0x000010000 0x70000 { ; load region size_region
6+
ER_IROM1 0x000010000 0x70000 { ; 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)