Skip to content

Commit e22bbba

Browse files
bcostmadbridge
authored andcommitted
Add GCC_ARM files and fix errors during GCC build
1 parent c279154 commit e22bbba

File tree

9 files changed

+869
-162
lines changed

9 files changed

+869
-162
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F412ZG/PeripheralNames.h

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
/* mbed Microcontroller Library
2-
*******************************************************************************
3-
* Copyright (c) 2014, STMicroelectronics
4-
* All rights reserved.
2+
* Copyright (c) 2016 ARM Limited
53
*
6-
* Redistribution and use in source and binary forms, with or without
7-
* modification, are permitted provided that the following conditions are met:
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
87
*
9-
* 1. Redistributions of source code must retain the above copyright notice,
10-
* this list of conditions and the following disclaimer.
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15-
* may be used to endorse or promote products derived from this software
16-
* without specific prior written permission.
8+
* http://www.apache.org/licenses/LICENSE-2.0
179
*
18-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
*******************************************************************************
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.
2915
*/
3016
#ifndef MBED_PERIPHERALNAMES_H
3117
#define MBED_PERIPHERALNAMES_H
@@ -62,7 +48,8 @@ typedef enum {
6248
typedef enum {
6349
I2C_1 = (int)I2C1_BASE,
6450
I2C_2 = (int)I2C2_BASE,
65-
I2C_3 = (int)I2C3_BASE
51+
I2C_3 = (int)I2C3_BASE,
52+
FMPI2C_1 = (int)FMPI2C1_BASE
6653
} I2CName;
6754

6855
typedef enum {
@@ -77,10 +64,14 @@ typedef enum {
7764
PWM_11 = (int)TIM11_BASE,
7865
PWM_12 = (int)TIM12_BASE,
7966
PWM_13 = (int)TIM13_BASE,
80-
PWM_14 = (int)TIM14_BASE,
81-
PWM_15 = (int)TIM15_BASE
67+
PWM_14 = (int)TIM14_BASE
8268
} PWMName;
8369

70+
typedef enum {
71+
CAN_1 = (int)CAN1_BASE,
72+
CAN_2 = (int)CAN2_BASE
73+
} CANName;
74+
8475
#ifdef __cplusplus
8576
}
8677
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F412ZG/PeripheralPins.c

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
11
/* mbed Microcontroller Library
2-
*******************************************************************************
3-
* Copyright (c) 2016, STMicroelectronics
4-
* All rights reserved.
2+
* Copyright (c) 2016 ARM Limited
53
*
6-
* Redistribution and use in source and binary forms, with or without
7-
* modification, are permitted provided that the following conditions are met:
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
87
*
9-
* 1. Redistributions of source code must retain the above copyright notice,
10-
* this list of conditions and the following disclaimer.
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15-
* may be used to endorse or promote products derived from this software
16-
* without specific prior written permission.
8+
* http://www.apache.org/licenses/LICENSE-2.0
179
*
18-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
*******************************************************************************
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.
2915
*/
30-
3116
#include "PeripheralPins.h"
3217

3318
// =====

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F412ZG/PinNames.h

Lines changed: 123 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
/* mbed Microcontroller Library
2-
*******************************************************************************
3-
* Copyright (c) 2014, STMicroelectronics
4-
* All rights reserved.
2+
* Copyright (c) 2016 ARM Limited
53
*
6-
* Redistribution and use in source and binary forms, with or without
7-
* modification, are permitted provided that the following conditions are met:
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
87
*
9-
* 1. Redistributions of source code must retain the above copyright notice,
10-
* this list of conditions and the following disclaimer.
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15-
* may be used to endorse or promote products derived from this software
16-
* without specific prior written permission.
8+
* http://www.apache.org/licenses/LICENSE-2.0
179
*
18-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
*******************************************************************************
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.
2915
*/
3016
#ifndef MBED_PINNAMES_H
3117
#define MBED_PINNAMES_H
@@ -36,14 +22,22 @@
3622
extern "C" {
3723
#endif
3824

39-
// See stm32f4xx_hal_gpio.h and stm32f4xx_hal_gpio_ex.h for values of MODE, PUPD and AFNUM
40-
#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM & 0x0F) << 7) | ((PUPD & 0x07) << 4) | ((MODE & 0x0F) << 0)))
41-
#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((INVERTED & 0x01) << 16) | ((CHANNEL & 0x1F) << 11) | ((AFNUM & 0x0F) << 7) | ((PUPD & 0x07) << 4) | ((MODE & 0x0F) << 0)))
42-
#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F)
43-
#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07)
44-
#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F)
25+
#define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE & 0x0F) << 0) |\
26+
((PUPD & 0x07) << 4) |\
27+
((AFNUM & 0x0F) << 7)))
28+
29+
#define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((MODE & 0x0F) << 0) |\
30+
((PUPD & 0x07) << 4) |\
31+
((AFNUM & 0x0F) << 7) |\
32+
((CHANNEL & 0x1F) << 11) |\
33+
((INVERTED & 0x01) << 16)))
34+
35+
#define STM_PIN_MODE(X) (((X) >> 0) & 0x0F)
36+
#define STM_PIN_PUPD(X) (((X) >> 4) & 0x07)
37+
#define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F)
4538
#define STM_PIN_CHANNEL(X) (((X) >> 11) & 0x1F)
4639
#define STM_PIN_INVERTED(X) (((X) >> 16) & 0x01)
40+
4741
#define STM_MODE_INPUT (0)
4842
#define STM_MODE_OUTPUT_PP (1)
4943
#define STM_MODE_OUTPUT_OD (2)
@@ -97,6 +91,7 @@ typedef enum {
9791
PB_8 = 0x18,
9892
PB_9 = 0x19,
9993
PB_10 = 0x1A,
94+
PB_11 = 0x1B,
10095
PB_12 = 0x1C,
10196
PB_13 = 0x1D,
10297
PB_14 = 0x1E,
@@ -119,7 +114,73 @@ typedef enum {
119114
PC_14 = 0x2E,
120115
PC_15 = 0x2F,
121116

117+
PD_0 = 0x30,
118+
PD_1 = 0x31,
122119
PD_2 = 0x32,
120+
PD_3 = 0x33,
121+
PD_4 = 0x34,
122+
PD_5 = 0x35,
123+
PD_6 = 0x36,
124+
PD_7 = 0x37,
125+
PD_8 = 0x38,
126+
PD_9 = 0x39,
127+
PD_10 = 0x3A,
128+
PD_11 = 0x3B,
129+
PD_12 = 0x3C,
130+
PD_13 = 0x3D,
131+
PD_14 = 0x3E,
132+
PD_15 = 0x3F,
133+
134+
PE_0 = 0x40,
135+
PE_1 = 0x41,
136+
PE_2 = 0x42,
137+
PE_3 = 0x43,
138+
PE_4 = 0x44,
139+
PE_5 = 0x45,
140+
PE_6 = 0x46,
141+
PE_7 = 0x47,
142+
PE_8 = 0x48,
143+
PE_9 = 0x49,
144+
PE_10 = 0x4A,
145+
PE_11 = 0x4B,
146+
PE_12 = 0x4C,
147+
PE_13 = 0x4D,
148+
PE_14 = 0x4E,
149+
PE_15 = 0x4F,
150+
151+
PF_0 = 0x50,
152+
PF_1 = 0x51,
153+
PF_2 = 0x52,
154+
PF_3 = 0x53,
155+
PF_4 = 0x54,
156+
PF_5 = 0x55,
157+
PF_6 = 0x56,
158+
PF_7 = 0x57,
159+
PF_8 = 0x58,
160+
PF_9 = 0x59,
161+
PF_10 = 0x5A,
162+
PF_11 = 0x5B,
163+
PF_12 = 0x5C,
164+
PF_13 = 0x5D,
165+
PF_14 = 0x5E,
166+
PF_15 = 0x5F,
167+
168+
PG_0 = 0x60,
169+
PG_1 = 0x61,
170+
PG_2 = 0x62,
171+
PG_3 = 0x63,
172+
PG_4 = 0x64,
173+
PG_5 = 0x65,
174+
PG_6 = 0x66,
175+
PG_7 = 0x67,
176+
PG_8 = 0x68,
177+
PG_9 = 0x69,
178+
PG_10 = 0x6A,
179+
PG_11 = 0x6B,
180+
PG_12 = 0x6C,
181+
PG_13 = 0x6D,
182+
PG_14 = 0x6E,
183+
PG_15 = 0x6F,
123184

124185
PH_0 = 0x70,
125186
PH_1 = 0x71,
@@ -130,47 +191,47 @@ typedef enum {
130191
ADC_VBAT = 0xF2,
131192

132193
// Arduino connector namings
133-
A0 = PA_0,
134-
A1 = PA_1,
135-
A2 = PA_4,
136-
A3 = PB_0,
137-
A4 = PC_1,
138-
A5 = PC_0,
139-
D0 = PA_3,
140-
D1 = PA_2,
141-
D2 = PA_10,
142-
D3 = PB_3,
143-
D4 = PB_5,
144-
D5 = PB_4,
145-
D6 = PB_10,
146-
D7 = PA_8,
147-
D8 = PA_9,
148-
D9 = PC_7,
149-
D10 = PB_6,
194+
A0 = PA_3,
195+
A1 = PC_0,
196+
A2 = PC_3,
197+
A3 = PF_3,
198+
A4 = PF_5,
199+
A5 = PF_10,
200+
D0 = PG_9,
201+
D1 = PG_14,
202+
D2 = PF_15,
203+
D3 = PE_13,
204+
D4 = PF_14,
205+
D5 = PE_11,
206+
D6 = PE_9,
207+
D7 = PF_13,
208+
D8 = PF_12,
209+
D9 = PD_15,
210+
D10 = PD_14,
150211
D11 = PA_7,
151212
D12 = PA_6,
152213
D13 = PA_5,
153214
D14 = PB_9,
154215
D15 = PB_8,
155216

156217
// Generic signals namings
157-
LED1 = PA_5,
158-
LED2 = PA_5,
159-
LED3 = PA_5,
160-
LED4 = PA_5,
218+
LED1 = PB_0,
219+
LED2 = PB_7,
220+
LED3 = PB_14,
221+
LED4 = LED1,
161222
LED_RED = LED1,
162223
USER_BUTTON = PC_13,
163-
SERIAL_TX = PA_2,
164-
SERIAL_RX = PA_3,
165-
USBTX = PA_2,
166-
USBRX = PA_3,
167-
I2C_SCL = PB_8,
168-
I2C_SDA = PB_9,
169-
SPI_MOSI = PA_7,
170-
SPI_MISO = PA_6,
171-
SPI_SCK = PA_5,
172-
SPI_CS = PB_6,
173-
PWM_OUT = PB_3,
224+
SERIAL_TX = PD_8,
225+
SERIAL_RX = PD_9,
226+
USBTX = SERIAL_TX,
227+
USBRX = SERIAL_RX,
228+
I2C_SCL = D15,
229+
I2C_SDA = D14,
230+
SPI_MOSI = D11,
231+
SPI_MISO = D12,
232+
SPI_SCK = D13,
233+
SPI_CS = D10,
234+
PWM_OUT = D9,
174235

175236
// Not connected
176237
NC = (int)0xFFFFFFFF

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F412ZG/PortNames.h

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
/* mbed Microcontroller Library
2-
*******************************************************************************
3-
* Copyright (c) 2014, STMicroelectronics
4-
* All rights reserved.
2+
* Copyright (c) 2016 ARM Limited
53
*
6-
* Redistribution and use in source and binary forms, with or without
7-
* modification, are permitted provided that the following conditions are met:
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
87
*
9-
* 1. Redistributions of source code must retain the above copyright notice,
10-
* this list of conditions and the following disclaimer.
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15-
* may be used to endorse or promote products derived from this software
16-
* without specific prior written permission.
8+
* http://www.apache.org/licenses/LICENSE-2.0
179
*
18-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
*******************************************************************************
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.
2915
*/
3016
#ifndef MBED_PORTNAMES_H
3117
#define MBED_PORTNAMES_H

0 commit comments

Comments
 (0)