Skip to content

Commit cc39261

Browse files
authored
Merge pull request ARMmbed#15414 from wdx04/stm32h7_ospi
Add OSPI support for STM32H7
2 parents 952c286 + b22d510 commit cc39261

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

targets/TARGET_STM/TARGET_STM32H7/objects.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ struct analogin_s {
106106

107107
#if DEVICE_QSPI
108108
struct qspi_s {
109+
#if defined(OCTOSPI1)
110+
OSPI_HandleTypeDef handle;
111+
#else
109112
QSPI_HandleTypeDef handle;
113+
#endif
110114
QSPIName qspi;
111115
PinName io0;
112116
PinName io1;
@@ -117,6 +121,24 @@ struct qspi_s {
117121
};
118122
#endif
119123

124+
#if DEVICE_OSPI
125+
struct ospi_s {
126+
OSPI_HandleTypeDef handle;
127+
OSPIName ospi;
128+
PinName io0;
129+
PinName io1;
130+
PinName io2;
131+
PinName io3;
132+
PinName io4;
133+
PinName io5;
134+
PinName io6;
135+
PinName io7;
136+
PinName sclk;
137+
PinName ssel;
138+
PinName dqs;
139+
};
140+
#endif
141+
120142
#define GPIO_IP_WITHOUT_BRR
121143

122144
#if defined(DUAL_CORE)

targets/TARGET_STM/ospi_api.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,12 @@ static ospi_status_t _ospi_init_direct(ospi_t *obj, const ospi_pinmap_t *pinmap,
336336
pin_function(pinmap->dqs_pin, pinmap->dqs_function);
337337
pin_mode(pinmap->dqs_pin, PullNone);
338338

339-
#if defined(OCTOSPI2)
339+
#if defined(OCTOSPIM)
340+
#if defined(TARGET_STM32H7)
341+
__HAL_RCC_OCTOSPIM_CLK_ENABLE();
342+
#else
340343
__HAL_RCC_OSPIM_CLK_ENABLE();
341-
344+
#endif
342345
OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0};
343346

344347
/* The OctoSPI IO Manager OCTOSPIM configuration is supported in a simplified mode in mbed-os

0 commit comments

Comments
 (0)