Skip to content

Commit 9dfc8d0

Browse files
authored
Merge pull request #10775 from jeromecoutant/PR_H7_REFACTOR
STM32H7: refactor TARGET directory
2 parents 42dbcbd + 25e4316 commit 9dfc8d0

File tree

11 files changed

+35
-86
lines changed

11 files changed

+35
-86
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/objects.h

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

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/us_ticker_data.h renamed to targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/us_ticker_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "stm32h7xx.h"
2424
#include "stm32h7xx_ll_tim.h"
2525
#include "cmsis_nvic.h"
26-
26+
2727
#define TIM_MST TIM5
2828
#define TIM_MST_IRQ TIM5_IRQn
2929
#define TIM_MST_RCC __TIM5_CLK_ENABLE()

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/stm32h7xx.h renamed to targets/TARGET_STM/TARGET_STM32H7/device/stm32h7xx.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
#if !defined (STM32H743xx) && !defined (STM32H753xx) && !defined (STM32H750xx) && !defined (STM32H742xx) && \
6262
!defined (STM32H745xx) && !defined (STM32H755xx) && !defined (STM32H747xx) && !defined (STM32H757xx)
6363
/* #define STM32H742xx */ /*!< STM32H742VI, STM32H742ZI, STM32H742AI, STM32H742II, STM32H742BI, STM32H742XI Devices */
64-
// MBED PATCH
65-
#define STM32H743xx /*!< STM32H743VI, STM32H743ZI, STM32H743AI, STM32H743II, STM32H743BI, STM32H743XI Devices */
64+
/* #define STM32H743xx */ /*!< STM32H743VI, STM32H743ZI, STM32H743AI, STM32H743II, STM32H743BI, STM32H743XI Devices */
6665
/* #define STM32H753xx */ /*!< STM32H753VI, STM32H753ZI, STM32H753AI, STM32H753II, STM32H753BI, STM32H753XI Devices */
6766
/* #define STM32H750xx */ /*!< STM32H750V, STM32H750I, STM32H750X Devices */
6867
/* #define STM32H747xx */ /*!< STM32H747ZI, STM32H747AI, STM32H747II, STM32H747BI, STM32H747XI Devices */
@@ -85,11 +84,9 @@
8584
In this case, these drivers will not be included and the application code will
8685
be based on direct access to peripherals registers
8786
*/
88-
#define USE_HAL_DRIVER // MBED PATCH
87+
/*#define USE_HAL_DRIVER */
8988
#endif /* USE_HAL_DRIVER */
9089

91-
#define USE_FULL_LL_DRIVER // MBED PATCH
92-
9390
/**
9491
* @brief CMSIS Device version number V1.5.0
9592
*/

targets/TARGET_STM/TARGET_STM32H7/device/stm32h7xx_hal_rtc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
/* Includes ------------------------------------------------------------------*/
2929
#include "stm32h7xx_hal_def.h"
30-
#include "stm32h7xx_ll_rtc.h" // MBED PATCH
3130

3231
/** @addtogroup STM32H7xx_HAL_Driver
3332
* @{

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/system_stm32h7xx.h renamed to targets/TARGET_STM/TARGET_STM32H7/device/system_stm32h7xx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ extern const uint8_t D1CorePrescTable[16] ; /*!< D1CorePrescTable prescalers ta
8585

8686
extern void SystemInit(void);
8787
extern void SystemCoreClockUpdate(void);
88-
extern void SetSysClock(void); // MBED PATCH
8988
/**
9089
* @}
9190
*/

targets/TARGET_STM/TARGET_STM32H7/common_objects.h renamed to targets/TARGET_STM/TARGET_STM32H7/objects.h

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,39 @@
2727
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
*******************************************************************************
2929
*/
30-
#ifndef MBED_COMMON_OBJECTS_H
31-
#define MBED_COMMON_OBJECTS_H
30+
#ifndef MBED_OBJECTS_H
31+
#define MBED_OBJECTS_H
3232

3333
#include "cmsis.h"
3434
#include "PortNames.h"
3535
#include "PeripheralNames.h"
3636
#include "PinNames.h"
3737
#include "stm32h7xx_ll_usart.h"
38+
#include "stm32h7xx_ll_rtc.h"
3839

3940
#ifdef __cplusplus
4041
extern "C" {
4142
#endif
4243

44+
struct gpio_irq_s {
45+
IRQn_Type irq_n;
46+
uint32_t irq_index;
47+
uint32_t event;
48+
PinName pin;
49+
};
50+
51+
struct port_s {
52+
PortName port;
53+
uint32_t mask;
54+
PinDirection direction;
55+
__IO uint32_t *reg_in;
56+
__IO uint32_t *reg_out;
57+
};
58+
59+
struct trng_s {
60+
RNG_HandleTypeDef handle;
61+
};
62+
4363
struct pwmout_s {
4464
PWMName pwm;
4565
PinName pin;
@@ -154,4 +174,3 @@ struct can_s {
154174
#endif
155175

156176
#endif
157-

targets/TARGET_STM/mbed_rtx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
defined(TARGET_STM32F446RE) ||\
9797
defined(TARGET_STM32F446VE) ||\
9898
defined(TARGET_STM32F446ZE) ||\
99-
defined(TARGET_STM32H743ZI) ||\
100-
defined(TARGET_STM32H753ZI))
99+
defined(TARGET_STM32H743xI) ||\
100+
defined(TARGET_STM32H753xI))
101101
#define INITIAL_SP (0x20020000UL)
102102

103103
#elif (defined(TARGET_STM32F429ZI) ||\

targets/targets.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,11 @@
18531853
"public": false,
18541854
"extra_labels": ["STM"],
18551855
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
1856-
"macros": ["TRANSACTION_QUEUE_SIZE_SPI=2"],
1856+
"macros": [
1857+
"USE_HAL_DRIVER",
1858+
"USE_FULL_LL_DRIVER",
1859+
"TRANSACTION_QUEUE_SIZE_SPI=2"
1860+
],
18571861
"config": {
18581862
"lse_available": {
18591863
"help": "Define if a Low Speed External xtal (LSE) is available on the board (0 = No, 1 = Yes). If Yes, the LSE will be used to clock the RTC, LPUART, ... otherwise the Low Speed Internal clock (LSI) will be used",
@@ -3170,9 +3174,7 @@
31703174
"core": "Cortex-M7FD",
31713175
"extra_labels_add": [
31723176
"STM32H7",
3173-
"STM32H743",
3174-
"STM32H743xI",
3175-
"STM32H743ZI"
3177+
"STM32H743xI"
31763178
],
31773179
"config": {
31783180
"d11_configuration": {
@@ -3196,8 +3198,8 @@
31963198
}
31973199
},
31983200
"macros_add": [
3199-
"MBED_TICKLESS",
3200-
"USE_FULL_LL_DRIVER"
3201+
"STM32H743xx",
3202+
"MBED_TICKLESS"
32013203
],
32023204
"overrides": { "lpticker_delay_ticks": 4 },
32033205
"supported_form_factors": ["ARDUINO"],

0 commit comments

Comments
 (0)