Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bsp/stm32/libraries/HAL_Drivers/drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ if GetDepend(['RT_USING_SPI']):
if GetDepend(['RT_USING_QSPI']):
src += ['drv_qspi.c']

if GetDepend(['RT_USING_OSPI']):
src += ['drv_ospi.c']

if GetDepend(['RT_USING_I2C']):
if GetDepend('BSP_USING_HARD_I2C1') or GetDepend('BSP_USING_HARD_I2C2') or GetDepend('BSP_USING_HARD_I2C3') or GetDepend('BSP_USING_HARD_I2C4'):
src += ['drv_hard_i2c.c']
Expand Down
68 changes: 68 additions & 0 deletions bsp/stm32/libraries/HAL_Drivers/drivers/config/l4/ospi_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2006-2026, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2026-08-17 CliffLL first version
*/

#ifndef __OSPI_CONFIG_H__
#define __OSPI_CONFIG_H__

#include <rtthread.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef BSP_USING_OSPI
#ifndef OSPI_INSTANCE
#define OSPI_INSTANCE OCTOSPI1
#endif

#ifndef OSPI_MEMORY_TYPE
#define OSPI_MEMORY_TYPE HAL_OSPI_MEMTYPE_MACRONIX
#endif

#ifndef OSPI_CLK_PORT
#define OSPI_CLK_PORT 1U
#endif

#ifndef OSPI_DQS_PORT
#define OSPI_DQS_PORT 1U
#endif

#ifndef OSPI_NCS_PORT
#define OSPI_NCS_PORT 1U
#endif

#ifndef OSPI_IO_LOW_PORT
#define OSPI_IO_LOW_PORT HAL_OSPIM_IOPORT_1_LOW
#endif

#ifndef OSPI_IO_HIGH_PORT
#define OSPI_IO_HIGH_PORT HAL_OSPIM_IOPORT_1_HIGH
#endif

#ifndef OSPI_BUS_CONFIG
#define OSPI_BUS_CONFIG \
{ \
.Instance = OSPI_INSTANCE, \
.Init.FifoThreshold = 4, \
.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE, \
.Init.ChipSelectHighTime = 2, \
.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE, \
.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE, \
.Init.ChipSelectBoundary = 0, \
.Init.MemoryType = OSPI_MEMORY_TYPE, \
}
#endif /* OSPI_BUS_CONFIG */
#endif /* BSP_USING_OSPI */

#ifdef __cplusplus
}
#endif

#endif /* __OSPI_CONFIG_H__ */
2 changes: 2 additions & 0 deletions bsp/stm32/libraries/HAL_Drivers/drivers/drv_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Date Author Notes
* 2018-10-30 SummerGift first version
* 2020-10-14 PeakRacing Porting for stm32wbxx
* 2026-08-18 CliffLL add l4/ospi_config.h
*/

#ifndef __DRV_CONFIG_H__
Expand Down Expand Up @@ -88,6 +89,7 @@ extern "C" {
#include "l4/uart_config.h"
#include "l4/spi_config.h"
#include "l4/qspi_config.h"
#include "l4/ospi_config.h"
#include "l4/adc_config.h"
#include "l4/adc_config_v2.h"
#include "l4/dac_config.h"
Expand Down
Loading
Loading