mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-28 08:37:57 +08:00
Merge pull request #2563 from lymzzyh/stm32
[BSP][STM32] 对F4系列增加USB驱动支持和QSPI驱动支持
This commit is contained in:
5 files changed
+331
-4
No files matched your search
@@ -24,10 +24,7 @@ if GetDepend(['RT_USING_SPI']):
|
||||
src += ['drv_spi.c']
|
||||
|
||||
if GetDepend(['RT_USING_QSPI']):
|
||||
src += ['drv_qspi.c']
|
||||
|
||||
if GetDepend(['RT_USING_USB_DEVICE']):
|
||||
src += ['drv_usb.c']
|
||||
src += ['drv_qspi.c']
|
||||
|
||||
if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
|
||||
src += ['drv_soft_i2c.c']
|
||||
@@ -71,6 +68,9 @@ if GetDepend(['BSP_USING_WDT']):
|
||||
if GetDepend(['BSP_USING_SDIO']):
|
||||
src += ['drv_sdio.c']
|
||||
|
||||
if GetDepend(['BSP_USING_USBD_FS']):
|
||||
src += ['drv_usbd_fs.c']
|
||||
|
||||
src += ['drv_common.c']
|
||||
|
||||
path = [cwd]
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-22 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __QSPI_CONFIG_H__
|
||||
#define __QSPI_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_QSPI
|
||||
#ifndef QSPI_BUS_CONFIG
|
||||
#define QSPI_BUS_CONFIG \
|
||||
{ \
|
||||
.Instance = QUADSPI, \
|
||||
.Init.FifoThreshold = 4, \
|
||||
.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE, \
|
||||
.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_5_CYCLE, \
|
||||
}
|
||||
#endif /* QSPI_BUS_CONFIG */
|
||||
#endif /* BSP_USING_QSPI */
|
||||
|
||||
#ifdef BSP_QSPI_USING_DMA
|
||||
#ifndef QSPI_DMA_CONFIG
|
||||
#define QSPI_DMA_CONFIG \
|
||||
{ \
|
||||
.Instance = QSPI_DMA_INSTANCE, \
|
||||
.Init.Channel = QSPI_DMA_CHANNEL, \
|
||||
.Init.Direction = DMA_PERIPH_TO_MEMORY, \
|
||||
.Init.PeriphInc = DMA_PINC_DISABLE, \
|
||||
.Init.MemInc = DMA_MINC_ENABLE, \
|
||||
.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE, \
|
||||
.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE, \
|
||||
.Init.Mode = DMA_NORMAL, \
|
||||
.Init.Priority = DMA_PRIORITY_LOW \
|
||||
}
|
||||
#endif /* QSPI_DMA_CONFIG */
|
||||
#endif /* BSP_QSPI_USING_DMA */
|
||||
|
||||
#define QSPI_IRQn QUADSPI_IRQn
|
||||
#define QSPI_IRQHandler QUADSPI_IRQHandler
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __QSPI_CONFIG_H__ */
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2019-04-10 ZYH first version
|
||||
*/
|
||||
#ifndef __USBD_FS_CONFIG_H__
|
||||
#define __USBD_FS_CONFIG_H__
|
||||
|
||||
#define USBD_FS_IRQ_HANDLER OTG_FS_IRQHandler
|
||||
#define USBD_INSTANCE USB_OTG_FS
|
||||
#endif
|
||||
@@ -37,6 +37,8 @@ extern "C" {
|
||||
#include "f4/dma_config.h"
|
||||
#include "f4/uart_config.h"
|
||||
#include "f4/spi_config.h"
|
||||
#include "f4/qspi_config.h"
|
||||
#include "f4/usbd_fs_config.h"
|
||||
#include "f4/adc_config.h"
|
||||
#include "f4/tim_config.h"
|
||||
#include "f4/sdio_config.h"
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user