Merge pull request #1170 from liu2guang/master

[Bsp] add sdcard drive | 添加sd卡驱动.
This commit is contained in:
ZYH
2018-01-16 18:45:53 +08:00
committed by GitHub
5 changed files with 372 additions and 3 deletions
+13
View File
@@ -182,3 +182,16 @@ if RT_USING_SPI
default n
endif
if RT_USING_DEVICE_IPC && (STM32F103RC || STM32F103RD || STM32F103RE || STM32F103RF || STM32F103RG ||STM32F103VC || STM32F103VD || STM32F103VE || STM32F103VF || STM32F103VG ||STM32F103ZC || STM32F103ZD || STM32F103ZE || STM32F103ZF || STM32F103ZG)
config RT_USING_SDCARD
bool "Using sdcard with sdio"
default n
config USING_SD_RX_DMA
bool "SDCARD Rx Using Dma Mode"
default y
depends on RT_USING_SDCARD
config USING_SD_TX_DMA
bool "SDCARD Tx Using Dma Mode"
default n
depends on RT_USING_SDCARD
endif
+2 -2
View File
@@ -18,8 +18,8 @@ if GetDepend(['RT_USING_SPI']):
src += ['drv_spi.c']
if GetDepend(['RT_USING_USB_DEVICE']):
src += ['drv_usb.c']
if GetDepend(['RT_USING_SDCARD']):
src += ['drv_sdcard.c']
CPPPATH = [cwd]
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
/*
* File : drv_sdcard.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2018-01-13 Liu2guang the first version.
*/
#ifndef __DRV_SDCARD_H_
#define __DRV_SDCARD_H_
int rt_hw_sdcard_init(void);
#endif
@@ -80,7 +80,9 @@
#define HAL_PWR_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
// #define HAL_RTC_MODULE_ENABLED
// #define HAL_SD_MODULE_ENABLED
#ifdef RT_USING_SDCARD
#define HAL_SD_MODULE_ENABLED
#endif
// #define HAL_SMARTCARD_MODULE_ENABLED
#ifdef RT_USING_SPI
#define HAL_SPI_MODULE_ENABLED