Skip to content

Commit af6f9aa

Browse files
committed
DISCO_F413ZH: Creation folders and files (pinout, startup, etc...)
1 parent d121a43 commit af6f9aa

File tree

22 files changed

+20486
-0
lines changed

22 files changed

+20486
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 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+
ADC_1 = (int)ADC1_BASE
27+
} ADCName;
28+
29+
typedef enum {
30+
DAC_1 = (int)DAC1_BASE
31+
} DACName;
32+
33+
typedef enum {
34+
UART_1 = (int)USART1_BASE,
35+
UART_2 = (int)USART2_BASE,
36+
UART_3 = (int)USART3_BASE,
37+
UART_4 = (int)UART4_BASE,
38+
UART_5 = (int)UART5_BASE,
39+
UART_6 = (int)USART6_BASE,
40+
UART_7 = (int)UART7_BASE,
41+
UART_8 = (int)UART8_BASE,
42+
UART_9 = (int)UART9_BASE,
43+
UART_10 = (int)UART10_BASE
44+
} UARTName;
45+
46+
#define STDIO_UART_TX PG_9
47+
#define STDIO_UART_RX PG_14
48+
#define STDIO_UART UART_6
49+
50+
typedef enum {
51+
SPI_1 = (int)SPI1_BASE,
52+
SPI_2 = (int)SPI2_BASE,
53+
SPI_3 = (int)SPI3_BASE,
54+
SPI_4 = (int)SPI4_BASE,
55+
SPI_5 = (int)SPI5_BASE
56+
} SPIName;
57+
58+
typedef enum {
59+
I2C_1 = (int)I2C1_BASE,
60+
I2C_2 = (int)I2C2_BASE,
61+
I2C_3 = (int)I2C3_BASE,
62+
FMPI2C_1 = (int)FMPI2C1_BASE
63+
} I2CName;
64+
65+
typedef enum {
66+
PWM_1 = (int)TIM1_BASE,
67+
PWM_2 = (int)TIM2_BASE,
68+
PWM_3 = (int)TIM3_BASE,
69+
PWM_4 = (int)TIM4_BASE,
70+
PWM_5 = (int)TIM5_BASE,
71+
PWM_8 = (int)TIM8_BASE,
72+
PWM_9 = (int)TIM9_BASE,
73+
PWM_10 = (int)TIM10_BASE,
74+
PWM_11 = (int)TIM11_BASE,
75+
PWM_12 = (int)TIM12_BASE,
76+
PWM_13 = (int)TIM13_BASE,
77+
PWM_14 = (int)TIM14_BASE
78+
} PWMName;
79+
80+
typedef enum {
81+
CAN_1 = (int)CAN1_BASE,
82+
CAN_2 = (int)CAN2_BASE
83+
} CANName;
84+
85+
#ifdef __cplusplus
86+
}
87+
#endif
88+
89+
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_DISCO_F413ZH/PeripheralPins.c

Lines changed: 383 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2017 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+
#include "PinNamesTypes.h"
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
typedef enum {
27+
ALT0 = 0x100,
28+
ALT1 = 0x200,
29+
ALT2 = 0x300,
30+
ALT3 = 0x400
31+
} ALTx;
32+
33+
typedef enum {
34+
PA_0 = 0x00,
35+
PA_1 = 0x01,
36+
PA_2 = 0x02,
37+
PA_2_ALT0 = PA_2|ALT0,
38+
PA_3 = 0x03,
39+
PA_4 = 0x04,
40+
PA_4_ALT0 = PA_4|ALT0,
41+
PA_5 = 0x05,
42+
PA_5_ALT0 = PA_5|ALT0,
43+
PA_6 = 0x06,
44+
PA_6_ALT0 = PA_6|ALT0,
45+
PA_7 = 0x07,
46+
PA_7_ALT0 = PA_7|ALT0,
47+
PA_7_ALT1 = PA_7|ALT1,
48+
PA_7_ALT2 = PA_7|ALT2,
49+
PA_8 = 0x08,
50+
PA_9 = 0x09,
51+
PA_10 = 0x0A,
52+
PA_10_ALT0 = PA_10|ALT0,
53+
PA_11 = 0x0B,
54+
PA_12 = 0x0C,
55+
PA_12_ALT0 = PA_12|ALT0,
56+
PA_13 = 0x0D,
57+
PA_14 = 0x0E,
58+
PA_15 = 0x0F,
59+
PA_15_ALT0 = PA_15|ALT0,
60+
61+
PB_0 = 0x10,
62+
PB_0_ALT0 = PB_0|ALT0,
63+
PB_0_ALT1 = PB_0|ALT1,
64+
PB_1 = 0x11,
65+
PB_1_ALT0 = PB_1|ALT0,
66+
PB_1_ALT1 = PB_1|ALT1,
67+
PB_2 = 0x12,
68+
PB_3 = 0x13,
69+
PB_3_ALT0 = PB_3|ALT0,
70+
PB_4 = 0x14,
71+
PB_4_ALT0 = PA_4|ALT0,
72+
PB_5 = 0x15,
73+
PB_5_ATL0 = PB_5|ALT0,
74+
PB_6 = 0x16,
75+
PB_7 = 0x17,
76+
PB_8 = 0x18,
77+
PB_8_ATL0 = PB_8|ALT0,
78+
PB_9 = 0x19,
79+
PB_9_ALT0 = PB_9|ALT0,
80+
PB_10 = 0x1A,
81+
PB_11 = 0x1B,
82+
PB_12 = 0x1C,
83+
PB_12_ALT0 = PB_12|ALT0,
84+
PB_13 = 0x1D,
85+
PB_13_ALT0 = PB_13|ALT0,
86+
PB_14 = 0x1E,
87+
PB_14_ALT0 = PB_14|ALT0,
88+
PB_14_ALT1 = PB_14|ALT1,
89+
PB_15 = 0x1F,
90+
PB_15_ALT0 = PB_15|ALT0,
91+
PB_15_ALT1 = PB_15|ALT1,
92+
93+
PC_0 = 0x20,
94+
PC_1 = 0x21,
95+
PC_2 = 0x22,
96+
PC_3 = 0x23,
97+
PC_4 = 0x24,
98+
PC_5 = 0x25,
99+
PC_6 = 0x26,
100+
PC_6_ALT0 = PC_6|ALT0,
101+
PC_7 = 0x27,
102+
PC_7_ALT0 = PC_7|ALT0,
103+
PC_8 = 0x28,
104+
PC_8_ALT0 = PC_8|ALT0,
105+
PC_9 = 0x29,
106+
PC_9_ALT0 = PC_9|ALT0,
107+
PC_10 = 0x2A,
108+
PC_11 = 0x2B,
109+
PC_11_ALT0 = PC_11|ALT0,
110+
PC_12 = 0x2C,
111+
PC_13 = 0x2D,
112+
PC_14 = 0x2E,
113+
PC_15 = 0x2F,
114+
115+
PD_0 = 0x30,
116+
PD_1 = 0x31,
117+
PD_2 = 0x32,
118+
PD_3 = 0x33,
119+
PD_4 = 0x34,
120+
PD_5 = 0x35,
121+
PD_6 = 0x36,
122+
PD_7 = 0x37,
123+
PD_8 = 0x38,
124+
PD_9 = 0x39,
125+
PD_10 = 0x3A,
126+
PD_11 = 0x3B,
127+
PD_12 = 0x3C,
128+
PD_13 = 0x3D,
129+
PD_14 = 0x3E,
130+
PD_15 = 0x3F,
131+
132+
PE_0 = 0x40,
133+
PE_1 = 0x41,
134+
PE_2 = 0x42,
135+
PE_2_ALT0 = PE_2|ALT0,
136+
PE_3 = 0x43,
137+
PE_4 = 0x44,
138+
PE_4_ALT0 = PE_4|ALT0,
139+
PE_5 = 0x45,
140+
PE_5_ALT0 = PE_5|ALT0,
141+
PE_6 = 0x46,
142+
PE_6_ALT0 = PE_6|ALT0,
143+
PE_7 = 0x47,
144+
PE_8 = 0x48,
145+
PE_9 = 0x49,
146+
PE_10 = 0x4A,
147+
PE_11 = 0x4B,
148+
PE_11_ALT0 = PE_11|ALT0,
149+
PE_12 = 0x4C,
150+
PE_12_ALT0 = PE_12|ALT0,
151+
PE_13 = 0x4D,
152+
PE_13_ALT0 = PE_13|ALT0,
153+
PE_14 = 0x4E,
154+
PE_14_ALT0 = PE_14|ALT0,
155+
PE_15 = 0x4F,
156+
157+
PF_0 = 0x50,
158+
PF_1 = 0x51,
159+
PF_2 = 0x52,
160+
PF_3 = 0x53,
161+
PF_4 = 0x54,
162+
PF_5 = 0x55,
163+
PF_6 = 0x56,
164+
PF_7 = 0x57,
165+
PF_8 = 0x58,
166+
PF_9 = 0x59,
167+
PF_10 = 0x5A,
168+
PF_11 = 0x5B,
169+
PF_12 = 0x5C,
170+
PF_13 = 0x5D,
171+
PF_14 = 0x5E,
172+
PF_15 = 0x5F,
173+
174+
PG_0 = 0x60,
175+
PG_1 = 0x61,
176+
PG_2 = 0x62,
177+
PG_3 = 0x63,
178+
PG_4 = 0x64,
179+
PG_5 = 0x65,
180+
PG_6 = 0x66,
181+
PG_7 = 0x67,
182+
PG_8 = 0x68,
183+
PG_9 = 0x69,
184+
PG_10 = 0x6A,
185+
PG_11 = 0x6B,
186+
PG_12 = 0x6C,
187+
PG_13 = 0x6D,
188+
PG_14 = 0x6E,
189+
PG_15 = 0x6F,
190+
191+
PH_0 = 0x70,
192+
PH_1 = 0x71,
193+
194+
// ADC internal channels
195+
ADC_TEMP = 0xF0,
196+
ADC_VREF = 0xF1,
197+
ADC_VBAT = 0xF2,
198+
199+
// Arduino connector namings
200+
A0 = PC_0,
201+
A1 = PA_1,
202+
A2 = PA_2,
203+
A3 = PA_5,
204+
A4 = PB_1,
205+
A5 = PC_4,
206+
D0 = PF_6,
207+
D1 = PF_7,
208+
D2 = PG_13,
209+
D3 = PF_10,
210+
D4 = PB_6,
211+
D5 = PE_6,
212+
D6 = PB_0,
213+
D7 = PC_13,
214+
D8 = PA_4,
215+
D9 = PB_8,
216+
D10 = PA_15,
217+
D11 = PB_5,
218+
D12 = PB_4,
219+
D13 = PB_12,
220+
D14 = PB_11,
221+
D15 = PB_10,
222+
223+
// Generic signals namings
224+
LED1 = PE_3, // Red
225+
LED2 = PC_7, // Green
226+
LED_RED = LED1,
227+
USER_BUTTON = PA_0,
228+
SERIAL_TX = PG_9,
229+
SERIAL_RX = PG_14,
230+
USBTX = SERIAL_TX,
231+
USBRX = SERIAL_RX,
232+
I2C_SCL = D15,
233+
I2C_SDA = D14,
234+
SPI_MOSI = D11,
235+
SPI_MISO = D12,
236+
SPI_SCK = D13,
237+
SPI_CS = D10,
238+
PWM_OUT = D9,
239+
240+
// Not connected
241+
NC = (int)0xFFFFFFFF
242+
} PinName;
243+
244+
#ifdef __cplusplus
245+
}
246+
#endif
247+
248+
#endif

0 commit comments

Comments
 (0)