Skip to content

Commit 8bf9e08

Browse files
committed
STM32F4: move common files
1 parent ab88dcd commit 8bf9e08

File tree

93 files changed

+197
-5140
lines changed

Some content is hidden

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

93 files changed

+197
-5140
lines changed
Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* mbed Microcontroller Library
22
*******************************************************************************
3-
* SPDX-License-Identifier: BSD-3-Clause
4-
* Copyright (c) 2014, STMicroelectronics
3+
* Copyright (c) 2016, STMicroelectronics
54
* All rights reserved.
65
*
76
* Redistribution and use in source and binary forms, with or without
@@ -39,68 +38,144 @@ extern "C" {
3938

4039
typedef enum {
4140
ADC_1 = (int)ADC1_BASE,
41+
#if defined ADC2_BASE
4242
ADC_2 = (int)ADC2_BASE,
43+
#endif
44+
#if defined ADC3_BASE
4345
ADC_3 = (int)ADC3_BASE
46+
#endif
4447
} ADCName;
4548

49+
#if defined DAC_BASE
4650
typedef enum {
4751
DAC_1 = (int)DAC_BASE
4852
} DACName;
53+
#endif
4954

5055
typedef enum {
5156
UART_1 = (int)USART1_BASE,
57+
#if defined USART2_BASE
5258
UART_2 = (int)USART2_BASE,
59+
#endif
60+
#if defined USART3_BASE
5361
UART_3 = (int)USART3_BASE,
62+
#endif
63+
#if defined UART4_BASE
5464
UART_4 = (int)UART4_BASE,
65+
#endif
66+
#if defined UART5_BASE
5567
UART_5 = (int)UART5_BASE,
68+
#endif
69+
#if defined USART6_BASE
5670
UART_6 = (int)USART6_BASE,
71+
#endif
72+
#if defined UART7_BASE
5773
UART_7 = (int)UART7_BASE,
58-
UART_8 = (int)UART8_BASE
74+
#endif
75+
#if defined UART8_BASE
76+
UART_8 = (int)UART8_BASE,
77+
#endif
78+
#if defined UART9_BASE
79+
UART_9 = (int)UART9_BASE,
80+
#endif
81+
#if defined UART10_BASE
82+
UART_10 = (int)UART10_BASE,
83+
#endif
5984
} UARTName;
6085

6186
#define DEVICE_SPI_COUNT 6
6287
typedef enum {
6388
SPI_1 = (int)SPI1_BASE,
89+
#if defined SPI2_BASE
6490
SPI_2 = (int)SPI2_BASE,
91+
#endif
92+
#if defined SPI3_BASE
6593
SPI_3 = (int)SPI3_BASE,
94+
#endif
95+
#if defined SPI4_BASE
6696
SPI_4 = (int)SPI4_BASE,
97+
#endif
98+
#if defined SPI5_BASE
6799
SPI_5 = (int)SPI5_BASE,
100+
#endif
101+
#if defined SPI6_BASE
68102
SPI_6 = (int)SPI6_BASE
103+
#endif
69104
} SPIName;
70105

71106
typedef enum {
72107
I2C_1 = (int)I2C1_BASE,
108+
#if defined I2C2_BASE
73109
I2C_2 = (int)I2C2_BASE,
74-
I2C_3 = (int)I2C3_BASE
110+
#endif
111+
#if defined I2C3_BASE
112+
I2C_3 = (int)I2C3_BASE,
113+
#endif
114+
#if defined FMPI2C1_BASE
115+
FMPI2C_1 = (int)FMPI2C1_BASE
116+
#endif
75117
} I2CName;
76118

77119
typedef enum {
78120
PWM_1 = (int)TIM1_BASE,
121+
#if defined TIM2_BASE
79122
PWM_2 = (int)TIM2_BASE,
123+
#endif
124+
#if defined TIM3_BASE
80125
PWM_3 = (int)TIM3_BASE,
126+
#endif
127+
#if defined TIM4_BASE
81128
PWM_4 = (int)TIM4_BASE,
129+
#endif
130+
#if defined TIM5_BASE
82131
PWM_5 = (int)TIM5_BASE,
132+
#endif
133+
#if defined TIM8_BASE
83134
PWM_8 = (int)TIM8_BASE,
135+
#endif
136+
#if defined TIM9_BASE
84137
PWM_9 = (int)TIM9_BASE,
138+
#endif
139+
#if defined TIM10_BASE
85140
PWM_10 = (int)TIM10_BASE,
141+
#endif
142+
#if defined TIM11_BASE
86143
PWM_11 = (int)TIM11_BASE,
144+
#endif
145+
#if defined TIM12_BASE
87146
PWM_12 = (int)TIM12_BASE,
147+
#endif
148+
#if defined TIM13_BASE
88149
PWM_13 = (int)TIM13_BASE,
150+
#endif
151+
#if defined TIM14_BASE
89152
PWM_14 = (int)TIM14_BASE
153+
#endif
90154
} PWMName;
91155

156+
#if DEVICE_CAN
92157
typedef enum {
93158
CAN_1 = (int)CAN1_BASE,
94-
CAN_2 = (int)CAN2_BASE
159+
#if defined CAN2_BASE
160+
CAN_2 = (int)CAN2_BASE,
161+
#endif
162+
#if defined CAN3_BASE
163+
CAN_3 = (int)CAN3_BASE
164+
#endif
95165
} CANName;
166+
#endif
96167

168+
#if defined QSPI_R_BASE
97169
typedef enum {
98170
QSPI_1 = (int)QSPI_R_BASE,
99171
} QSPIName;
172+
#endif
100173

101174
typedef enum {
102175
USB_FS = (int)USB_OTG_FS_PERIPH_BASE,
176+
#if defined USB_OTG_HS_PERIPH_BASE
103177
USB_HS = (int)USB_OTG_HS_PERIPH_BASE
178+
#endif
104179
} USBName;
105180

106181
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/objects.h

Lines changed: 0 additions & 63 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralNames.h

Lines changed: 0 additions & 82 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/objects.h

Lines changed: 0 additions & 63 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ uint8_t SetSysClock_PLL_HSI(void);
5757
* @retval None
5858
*/
5959

60-
void SetSysClock(void)
60+
MBED_WEAK void SetSysClock(void)
6161
{
6262
#if ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC)
6363
/* 1- Try to start with HSE and external clock */
@@ -89,7 +89,7 @@ void SetSysClock(void)
8989
/******************************************************************************/
9090
/* PLL (clocked by HSE) used as System clock source */
9191
/******************************************************************************/
92-
uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
92+
MBED_WEAK uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
9393
{
9494
RCC_OscInitTypeDef RCC_OscInitStruct;
9595
RCC_ClkInitTypeDef RCC_ClkInitStruct;

0 commit comments

Comments
 (0)