Skip to content

Commit a404a93

Browse files
author
Cruz Monrreal
authored
Merge pull request #6862 from jamesbeyond/fastmodel_support
Fastmodels support: add FVP_MPS2 targets to mbed os
2 parents eb9435b + 304b584 commit a404a93

File tree

86 files changed

+17690
-0
lines changed

Some content is hidden

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

86 files changed

+17690
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef MBED_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
UART_0 = (int)CMSDK_UART0_BASE,
27+
UART_1 = (int)CMSDK_UART1_BASE,
28+
UART_2 = (int)CMSDK_UART3_BASE,
29+
UART_3 = (int)CMSDK_UART4_BASE
30+
} UARTName;
31+
32+
typedef enum {
33+
I2C_0 = (int)MPS2_TSC_I2C_BASE,
34+
I2C_1 = (int)MPS2_AAIC_I2C_BASE,
35+
I2C_2 = (int)MPS2_SHIELD0_I2C_BASE,
36+
I2C_3 = (int)MPS2_SHIELD1_I2C_BASE
37+
38+
} I2CName;
39+
40+
typedef enum {
41+
ADC0_0 = 0,
42+
ADC0_1,
43+
ADC0_2,
44+
ADC0_3,
45+
ADC0_4,
46+
ADC0_5,
47+
ADC0_6,
48+
ADC0_7,
49+
ADC0_8,
50+
ADC0_9,
51+
ADC0_10,
52+
ADC0_11
53+
} ADCName;
54+
55+
typedef enum {
56+
SPI_0 = (int)MPS2_SSP1_BASE,
57+
SPI_1 = (int)MPS2_SSP0_BASE,
58+
SPI_2 = (int)MPS2_SSP2_BASE,
59+
SPI_3 = (int)MPS2_SSP3_BASE,
60+
SPI_4 = (int)MPS2_SSP4_BASE
61+
} SPIName;
62+
63+
typedef enum {
64+
PWM_1 = 0,
65+
PWM_2,
66+
PWM_3,
67+
PWM_4,
68+
PWM_5,
69+
PWM_6,
70+
PWM_7,
71+
PWM_8,
72+
PWM_9,
73+
PWM_10,
74+
PWM_11
75+
} PWMName;
76+
77+
#define STDIO_UART_TX USBTX
78+
#define STDIO_UART_RX USBRX
79+
#define STDIO_UART UART_0
80+
81+
#define MBED_UART0 USBTX, USBRX
82+
#define MBED_UART1 XB_TX, XB_RX
83+
#define MBED_UART2 SH0_TX, SH0_RX
84+
#define MBED_UART3 SH1_TX, SH1_RX
85+
#define MBED_UARTUSB USBTX, USBRX
86+
87+
#ifdef __cplusplus
88+
}
89+
#endif
90+
91+
#endif
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef MBED_PINNAMES_H
17+
#define MBED_PINNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
PIN_INPUT,
27+
PIN_OUTPUT
28+
} PinDirection;
29+
30+
#define PORT_SHIFT 5
31+
32+
typedef enum {
33+
// MPS2 EXP Pin Names
34+
EXP0 = 0,
35+
EXP1 = 1,
36+
EXP2 = 2,
37+
EXP3 = 3,
38+
EXP4 = 4,
39+
EXP5 = 5,
40+
EXP6 = 6,
41+
EXP7 = 7,
42+
EXP8 = 8,
43+
EXP9 = 9,
44+
EXP10 = 10,
45+
EXP11 = 11,
46+
EXP12 = 12,
47+
EXP13 = 13,
48+
EXP14 = 14,
49+
EXP15 = 15,
50+
EXP16 = 16,
51+
EXP17 = 17,
52+
EXP18 = 18,
53+
EXP19 = 19,
54+
EXP20 = 20,
55+
EXP21 = 21,
56+
EXP22 = 22,
57+
EXP23 = 23,
58+
EXP24 = 24,
59+
EXP25 = 25,
60+
61+
EXP26 = 26,
62+
EXP27 = 27,
63+
EXP28 = 28,
64+
EXP29 = 29,
65+
EXP30 = 30,
66+
EXP31 = 31,
67+
EXP32 = 32,
68+
EXP33 = 33,
69+
EXP34 = 34,
70+
EXP35 = 35,
71+
EXP36 = 36,
72+
EXP37 = 37,
73+
EXP38 = 38,
74+
EXP39 = 39,
75+
EXP40 = 40,
76+
EXP41 = 41,
77+
EXP42 = 42,
78+
EXP43 = 43,
79+
EXP44 = 44,
80+
EXP45 = 45,
81+
EXP46 = 46,
82+
EXP47 = 47,
83+
EXP48 = 48,
84+
EXP49 = 49,
85+
EXP50 = 50,
86+
EXP51 = 51,
87+
88+
// Other mbed Pin Names
89+
90+
//LEDs on mps2
91+
//user leds
92+
USERLED1 = 100,
93+
USERLED2 = 101,
94+
//user switches
95+
USERSW1 = 110,
96+
USERSW2 = 111,
97+
98+
//mcc leds
99+
LED1 = 200,
100+
LED2 = 201,
101+
LED3 = 202,
102+
LED4 = 203,
103+
LED5 = 204,
104+
LED6 = 205,
105+
LED7 = 206,
106+
LED8 = 207,
107+
108+
//MCC Switches
109+
SW1 = 210,
110+
SW2 = 211,
111+
SW3 = 212,
112+
SW4 = 213,
113+
SW5 = 214,
114+
SW6 = 215,
115+
SW7 = 216,
116+
SW8 = 217,
117+
118+
//MPS2 SPI header pins j21
119+
MOSI_SPI = 300,
120+
MISO_SPI = 301,
121+
SCLK_SPI = 302,
122+
SSEL_SPI = 303,
123+
124+
//MPS2 CLCD SPI
125+
CLCD_MOSI = 304,
126+
CLCD_MISO = 305,
127+
CLCD_SCLK = 306,
128+
CLCD_SSEL = 307,
129+
CLCD_RESET = 308,
130+
CLCD_RS = 309,
131+
CLCD_RD = 310,
132+
CLCD_BL_CTRL = 311,
133+
134+
//MPS2 shield 0 SPI
135+
SHIELD_0_SPI_SCK = 320,
136+
SHIELD_0_SPI_MOSI = 321,
137+
SHIELD_0_SPI_MISO = 322,
138+
SHIELD_0_SPI_nCS = 323,
139+
140+
//MPS2 shield 1 SPI
141+
SHIELD_1_SPI_SCK = 331,
142+
SHIELD_1_SPI_MOSI = 332,
143+
SHIELD_1_SPI_MISO = 333,
144+
SHIELD_1_SPI_nCS = 334,
145+
146+
//MPS2 shield ADC SPI
147+
ADC_MOSI = 650,
148+
ADC_MISO = 651,
149+
ADC_SCLK = 652,
150+
ADC_SSEL = 653,
151+
152+
//MPS2 Uart
153+
USBTX = 400,
154+
USBRX = 401,
155+
XB_TX = 402,
156+
XB_RX = 403,
157+
UART_TX2 = 404,
158+
UART_RX2 = 405,
159+
SH0_TX = 406,
160+
SH0_RX = 407,
161+
SH1_TX = 408,
162+
SH1_RX = 409,
163+
164+
//MPS2 I2C touchscreen and audio
165+
TSC_SDA = 500,
166+
TSC_SCL = 501,
167+
AUD_SDA = 502,
168+
AUD_SCL = 503,
169+
170+
//MPS2 I2C for shield
171+
SHIELD_0_SDA = 504,
172+
SHIELD_0_SCL = 505,
173+
SHIELD_1_SDA = 506,
174+
SHIELD_1_SCL = 507,
175+
176+
//MPS2 shield Analog pins
177+
A0_0 = 600,
178+
A0_1 = 601,
179+
A0_2 = 602,
180+
A0_3 = 603,
181+
A0_4 = 604,
182+
A0_5 = 605,
183+
A1_0 = 606,
184+
A1_1 = 607,
185+
A1_2 = 608,
186+
A1_3 = 609,
187+
A1_4 = 610,
188+
A1_5 = 611,
189+
//MPS2 Shield Digital pins
190+
D0_0 = EXP0,
191+
D0_1 = EXP4,
192+
D0_2 = EXP2,
193+
D0_3 = EXP3,
194+
D0_4 = EXP1,
195+
D0_5 = EXP6,
196+
D0_6 = EXP7,
197+
D0_7 = EXP8,
198+
D0_8 = EXP9,
199+
D0_9 = EXP10,
200+
D0_10 = EXP12,
201+
D0_11 = EXP13,
202+
D0_12 = EXP14,
203+
D0_13 = EXP11,
204+
D0_14 = EXP15,
205+
D0_15 = EXP5,
206+
207+
D1_0 = EXP26,
208+
D1_1 = EXP30,
209+
D1_2 = EXP28,
210+
D1_3 = EXP29,
211+
D1_4 = EXP27,
212+
D1_5 = EXP32,
213+
D1_6 = EXP33,
214+
D1_7 = EXP34,
215+
D1_8 = EXP35,
216+
D1_9 = EXP36,
217+
D1_10 = EXP38,
218+
D1_11 = EXP39,
219+
D1_12 = EXP40,
220+
D1_13 = EXP44,
221+
D1_14 = EXP41,
222+
D1_15 = EXP31,
223+
224+
// Not connected
225+
NC = (int)0xFFFFFFFF,
226+
} PinName;
227+
228+
229+
typedef enum {
230+
PullUp = 2,
231+
PullDown = 1,
232+
PullNone = 0,
233+
Repeater = 3,
234+
OpenDrain = 4,
235+
PullDefault = PullDown
236+
} PinMode;
237+
238+
#ifdef __cplusplus
239+
}
240+
#endif
241+
242+
#endif
243+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef MBED_PORTNAMES_H
17+
#define MBED_PORTNAMES_H
18+
19+
#ifdef __cplusplus
20+
extern "C" {
21+
#endif
22+
23+
typedef enum {
24+
Port0 = 0,
25+
Port1 = 1
26+
} PortName;
27+
28+
#ifdef __cplusplus
29+
}
30+
#endif
31+
#endif

0 commit comments

Comments
 (0)