Skip to content

Commit

Permalink
Merge pull request #15414 from wdx04/stm32h7_ospi
Browse files Browse the repository at this point in the history
Add OSPI support for STM32H7
  • Loading branch information
0xc0170 authored May 8, 2023
2 parents 952c286 + b22d510 commit cc39261
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
22 changes: 22 additions & 0 deletions targets/TARGET_STM/TARGET_STM32H7/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ struct analogin_s {

#if DEVICE_QSPI
struct qspi_s {
#if defined(OCTOSPI1)
OSPI_HandleTypeDef handle;
#else
QSPI_HandleTypeDef handle;
#endif
QSPIName qspi;
PinName io0;
PinName io1;
Expand All @@ -117,6 +121,24 @@ struct qspi_s {
};
#endif

#if DEVICE_OSPI
struct ospi_s {
OSPI_HandleTypeDef handle;
OSPIName ospi;
PinName io0;
PinName io1;
PinName io2;
PinName io3;
PinName io4;
PinName io5;
PinName io6;
PinName io7;
PinName sclk;
PinName ssel;
PinName dqs;
};
#endif

#define GPIO_IP_WITHOUT_BRR

#if defined(DUAL_CORE)
Expand Down
7 changes: 5 additions & 2 deletions targets/TARGET_STM/ospi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,12 @@ static ospi_status_t _ospi_init_direct(ospi_t *obj, const ospi_pinmap_t *pinmap,
pin_function(pinmap->dqs_pin, pinmap->dqs_function);
pin_mode(pinmap->dqs_pin, PullNone);

#if defined(OCTOSPI2)
#if defined(OCTOSPIM)
#if defined(TARGET_STM32H7)
__HAL_RCC_OCTOSPIM_CLK_ENABLE();
#else
__HAL_RCC_OSPIM_CLK_ENABLE();

#endif
OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0};

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

0 comments on commit cc39261

Please sign in to comment.