1
1
/* mbed Microcontroller Library
2
- *******************************************************************************
3
- * Copyright (c) 2018, STMicroelectronics
2
+ * SPDX-License-Identifier: BSD-3-Clause
3
+ ******************************************************************************
4
+ *
5
+ * Copyright (c) 2016-2021 STMicroelectronics.
4
6
* All rights reserved.
5
7
*
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
8
+ * This software component is licensed by ST under BSD 3-Clause license,
9
+ * the "License"; You may not use this file except in compliance with the
10
+ * License. You may obtain a copy of the License at:
11
+ * opensource.org/licenses/BSD-3-Clause
8
12
*
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.
13
+ ******************************************************************************
17
14
*
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
- *******************************************************************************
15
+ * Automatically generated from STM32CubeMX/db/mcu/STM32F303K(6-8)Tx.xml
29
16
*/
30
17
31
18
/* MBED TARGET LIST: NUCLEO_F303K8 */
@@ -43,58 +30,55 @@ extern "C" {
43
30
typedef enum {
44
31
ALT0 = 0x100 ,
45
32
ALT1 = 0x200 ,
46
- ALT2 = 0x300 ,
47
- ALT3 = 0x400
48
33
} ALTx ;
49
34
50
35
typedef enum {
51
- PA_0 = 0x00 ,
52
- PA_1 = 0x01 ,
53
- PA_2 = 0x02 ,
54
- PA_3 = 0x03 ,
55
- PA_4 = 0x04 ,
56
- PA_5 = 0x05 ,
57
- PA_6 = 0x06 ,
58
- PA_6_ALT0 = PA_6 | ALT0 ,
59
- PA_7 = 0x07 ,
60
- PA_7_ALT0 = PA_7 | ALT0 ,
61
- PA_7_ALT1 = PA_7 | ALT1 ,
62
- PA_8 = 0x08 ,
63
- PA_9 = 0x09 ,
64
- PA_10 = 0x0A ,
65
- PA_11 = 0x0B ,
66
- PA_11_ALT0 = PA_11 | ALT0 ,
67
- PA_12 = 0x0C ,
68
- PA_12_ALT0 = PA_12 | ALT0 ,
69
- PA_13 = 0x0D ,
70
- PA_14 = 0x0E ,
71
- PA_15 = 0x0F ,
72
-
73
- PB_0 = 0x10 ,
74
- PB_0_ALT0 = PB_0 | ALT0 ,
75
- PB_1 = 0x11 ,
76
- PB_1_ALT0 = PB_1 | ALT0 ,
77
- PB_3 = 0x13 ,
78
- PB_4 = 0x14 ,
79
- PB_4_ALT0 = PB_4 | ALT0 ,
80
- PB_5 = 0x15 ,
81
- PB_5_ALT0 = PB_5 | ALT0 ,
82
- PB_6 = 0x16 ,
83
- PB_7 = 0x17 ,
84
- PB_7_ALT0 = PB_7 | ALT0 ,
85
-
86
- PF_0 = 0x50 ,
87
- PF_1 = 0x51 ,
88
-
89
- // ADC internal channels
90
- ADC_TEMP = 0xF0 ,
91
- ADC_VREF1 = 0xF1 ,
92
- ADC_VREF2 = 0xF2 ,
93
- ADC_VREF = ADC_VREF1 ,
94
- ADC_VBAT = 0xF3 ,
95
- ADC_VOPAMP2 = 0xF4 ,
96
-
97
- // Arduino connector namings
36
+ PA_0 = 0x00 ,
37
+ PA_1 = 0x01 ,
38
+ PA_2 = 0x02 ,
39
+ PA_3 = 0x03 ,
40
+ PA_4 = 0x04 ,
41
+ PA_5 = 0x05 ,
42
+ PA_6 = 0x06 ,
43
+ PA_6_ALT0 = PA_6 | ALT0 , // same pin used for alternate HW
44
+ PA_7 = 0x07 ,
45
+ PA_7_ALT0 = PA_7 | ALT0 , // same pin used for alternate HW
46
+ PA_7_ALT1 = PA_7 | ALT1 , // same pin used for alternate HW
47
+ PA_8 = 0x08 ,
48
+ PA_9 = 0x09 ,
49
+ PA_10 = 0x0A ,
50
+ PA_11 = 0x0B ,
51
+ PA_11_ALT0 = PA_11 | ALT0 , // same pin used for alternate HW
52
+ PA_12 = 0x0C ,
53
+ PA_12_ALT0 = PA_12 | ALT0 , // same pin used for alternate HW
54
+ PA_13 = 0x0D ,
55
+ PA_14 = 0x0E ,
56
+ PA_15 = 0x0F ,
57
+ PB_0 = 0x10 ,
58
+ PB_0_ALT0 = PB_0 | ALT0 , // same pin used for alternate HW
59
+ PB_1 = 0x11 ,
60
+ PB_1_ALT0 = PB_1 | ALT0 , // same pin used for alternate HW
61
+ PB_3 = 0x13 ,
62
+ PB_4 = 0x14 ,
63
+ PB_4_ALT0 = PB_4 | ALT0 , // same pin used for alternate HW
64
+ PB_5 = 0x15 ,
65
+ PB_5_ALT0 = PB_5 | ALT0 , // same pin used for alternate HW
66
+ PB_6 = 0x16 ,
67
+ PB_7 = 0x17 ,
68
+ PB_7_ALT0 = PB_7 | ALT0 , // same pin used for alternate HW
69
+ PF_0 = 0x50 ,
70
+ PF_1 = 0x51 ,
71
+
72
+ /**** ADC internal channels ****/
73
+
74
+ ADC_TEMP = 0xF0 , // Internal pin virtual value
75
+ ADC_VREF1 = 0xF1 , // Internal pin virtual value
76
+ ADC_VREF2 = 0xF2 , // Internal pin virtual value
77
+ ADC_VREF = ADC_VREF1 , // Internal pin virtual value
78
+ ADC_VBAT = 0xF3 , // Internal pin virtual value
79
+ ADC_VOPAMP2 = 0xF4 , // Internal pin virtual value
80
+
81
+ // Arduino Nano pins
98
82
A0 = PA_0 ,
99
83
A1 = PA_1 ,
100
84
A2 = PA_3 ,
@@ -103,6 +87,7 @@ typedef enum {
103
87
A5 = PA_6 ,
104
88
A6 = PA_7 ,
105
89
A7 = PA_2 ,
90
+
106
91
D0 = PA_10 ,
107
92
D1 = PA_9 ,
108
93
D2 = PA_12 ,
@@ -120,36 +105,16 @@ typedef enum {
120
105
121
106
// STDIO for console print
122
107
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
123
- STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX ,
108
+ CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX ,
124
109
#else
125
- STDIO_UART_TX = PA_2 ,
110
+ CONSOLE_TX = PA_2 ,
126
111
#endif
127
112
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
128
- STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX ,
113
+ CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX ,
129
114
#else
130
- STDIO_UART_RX = PA_15 ,
115
+ CONSOLE_RX = PA_15 ,
131
116
#endif
132
117
133
- // Generic signals namings
134
- LED1 = PB_3 ,
135
- LED2 = PB_3 ,
136
- LED3 = PB_3 ,
137
- LED4 = PB_3 ,
138
- USER_BUTTON = 0x20 , // no user button on the board
139
- // Standardized button names
140
- BUTTON1 = USER_BUTTON ,
141
- SERIAL_TX = STDIO_UART_TX ,
142
- SERIAL_RX = STDIO_UART_RX ,
143
- CONSOLE_TX = STDIO_UART_TX ,
144
- CONSOLE_RX = STDIO_UART_RX ,
145
- I2C_SCL = PB_6 ,
146
- I2C_SDA = PB_7 ,
147
- SPI_MOSI = PB_5 ,
148
- SPI_MISO = PB_4 ,
149
- SPI_SCK = PB_3 ,
150
- SPI_CS = PA_11 ,
151
- PWM_OUT = PA_8 ,
152
-
153
118
/**** OSCILLATOR pins ****/
154
119
RCC_OSC_IN = PF_0 ,
155
120
RCC_OSC_OUT = PF_1 ,
@@ -166,6 +131,9 @@ typedef enum {
166
131
NC = (int )0xFFFFFFFF
167
132
} PinName ;
168
133
134
+ // Standardized LED and button names
135
+ #define LED1 PB_3
136
+
169
137
#ifdef __cplusplus
170
138
}
171
139
#endif
0 commit comments