mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-14 17:13:50 +01:00
boards/waveshare-nrf52840-eval-kit: make use of mtd_sdcard_default
This commit is contained in:
parent
4a85d7905e
commit
d2988b00ac
@ -22,11 +22,8 @@ config BOARD_WAVESHARE_NRF52840_EVAL_KIT
|
||||
select HAS_TINYUSB_DEVICE
|
||||
|
||||
select HAVE_SAUL_GPIO
|
||||
select HAVE_SDCARD_SPI
|
||||
select HAVE_MTD_SDCARD
|
||||
|
||||
select HAVE_MTD_SDCARD_DEFAULT
|
||||
select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT
|
||||
select MODULE_MTD if MODULE_VFS_DEFAULT
|
||||
select MODULE_SDCARD_SPI if MODULE_MTD
|
||||
|
||||
source "$(RIOTBOARD)/common/nrf52/Kconfig"
|
||||
|
||||
@ -3,7 +3,7 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||
endif
|
||||
|
||||
ifneq (,$(filter mtd,$(USEMODULE)))
|
||||
USEMODULE += mtd_sdcard
|
||||
USEMODULE += mtd_sdcard_default
|
||||
endif
|
||||
|
||||
# default to using fatfs on SD card
|
||||
|
||||
@ -13,3 +13,4 @@ FEATURES_PROVIDED += periph_usbdev
|
||||
FEATURES_PROVIDED += arduino
|
||||
FEATURES_PROVIDED += arduino_pwm
|
||||
FEATURES_PROVIDED += tinyusb_device
|
||||
FEATURES_PROVIDED += sdcard_spi
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_waveshare_nrf52840_eval_kit
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific definitions for Waveshare nRF52840 Eval Kit
|
||||
*
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*/
|
||||
|
||||
#if defined(MODULE_MTD_SDCARD)
|
||||
|
||||
#include "board.h"
|
||||
#include "kernel_defines.h"
|
||||
|
||||
#include "mtd_sdcard.h"
|
||||
#include "sdcard_spi.h"
|
||||
#include "sdcard_spi_params.h"
|
||||
|
||||
#if defined(MODULE_FATFS_VFS)
|
||||
#include "fs/fatfs.h"
|
||||
#include "vfs_default.h"
|
||||
#endif
|
||||
|
||||
/* this is provided by the sdcard_spi driver see drivers/sdcard_spi/sdcard_spi.c */
|
||||
extern sdcard_spi_t sdcard_spi_devs[ARRAY_SIZE(sdcard_spi_params)];
|
||||
|
||||
mtd_sdcard_t mtd_sdcard_dev = {
|
||||
.base = {
|
||||
.driver = &mtd_sdcard_driver,
|
||||
},
|
||||
.sd_card = &sdcard_spi_devs[0],
|
||||
.params = &sdcard_spi_params[0]
|
||||
};
|
||||
|
||||
mtd_dev_t *mtd0 = (mtd_dev_t *)&mtd_sdcard_dev;
|
||||
|
||||
#if IS_USED(MODULE_FATFS_VFS)
|
||||
VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd_sdcard_dev), VFS_DEFAULT_SD(0), 0);
|
||||
#endif /* MODULE_FATFS_VFS */
|
||||
|
||||
#endif /* MODULE_MTD_SDCARD */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
Loading…
x
Reference in New Issue
Block a user