Skip to content

Commit c40b642

Browse files
Merge pull request #4650 from catiedev/master
NUCLEO_L496ZG: Add new Platform
2 parents 9dfbf22 + c476a60 commit c40b642

File tree

24 files changed

+23894
-1
lines changed

24 files changed

+23894
-1
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2017, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
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.
17+
*
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+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PERIPHERALNAMES_H
31+
#define MBED_PERIPHERALNAMES_H
32+
33+
#include "cmsis.h"
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
typedef enum {
40+
ADC_1 = (int)ADC1_BASE,
41+
ADC_2 = (int)ADC2_BASE,
42+
ADC_3 = (int)ADC3_BASE
43+
} ADCName;
44+
45+
typedef enum {
46+
DAC_1 = (int)DAC_BASE
47+
} DACName;
48+
49+
typedef enum {
50+
UART_1 = (int)USART1_BASE,
51+
UART_2 = (int)USART2_BASE,
52+
UART_3 = (int)USART3_BASE,
53+
UART_4 = (int)UART4_BASE,
54+
UART_5 = (int)UART5_BASE,
55+
LPUART_1 = (int)LPUART1_BASE
56+
} UARTName;
57+
58+
#define STDIO_UART_TX SERIAL_TX
59+
#define STDIO_UART_RX SERIAL_RX
60+
#define STDIO_UART LPUART_1
61+
62+
typedef enum {
63+
SPI_1 = (int)SPI1_BASE,
64+
SPI_2 = (int)SPI2_BASE,
65+
SPI_3 = (int)SPI3_BASE
66+
} SPIName;
67+
68+
typedef enum {
69+
I2C_1 = (int)I2C1_BASE,
70+
I2C_2 = (int)I2C2_BASE,
71+
I2C_3 = (int)I2C3_BASE,
72+
I2C_4 = (int)I2C4_BASE
73+
} I2CName;
74+
75+
typedef enum {
76+
PWM_1 = (int)TIM1_BASE,
77+
PWM_2 = (int)TIM2_BASE,
78+
PWM_3 = (int)TIM3_BASE,
79+
PWM_4 = (int)TIM4_BASE,
80+
PWM_5 = (int)TIM5_BASE,
81+
PWM_8 = (int)TIM8_BASE,
82+
PWM_15 = (int)TIM15_BASE,
83+
PWM_16 = (int)TIM16_BASE,
84+
PWM_17 = (int)TIM17_BASE
85+
} PWMName;
86+
87+
typedef enum {
88+
CAN_1 = (int)CAN1_BASE,
89+
CAN_2 = (int)CAN2_BASE
90+
} CANName;
91+
92+
#ifdef __cplusplus
93+
}
94+
#endif
95+
96+
#endif

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_NUCLEO_L496ZG/PeripheralPins.c

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

0 commit comments

Comments
 (0)