赞
踩
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2020-04-28 tyustli first version */ #include <rtthread.h> #include <rtdevice.h> #include <board.h> #include "dfs_file.h" #include "drv_spi.h" #include "spi_flash_sfud.h" int main(int argc, char *argv[]) { __HAL_RCC_GPIOB_CLK_ENABLE(); rt_hw_spi_device_attach("spi1", "spi10", GPIOB, GPIO_PIN_14); if (RT_NULL == rt_sfud_flash_probe("W25Q128", "spi10")) { return -RT_ERROR; }; dfs_mkfs("elm", "W25Q128"); if (dfs_mount("W25Q128", "/", "elm", 0, 0) == RT_EOK) { rt_kprintf("onchip elm filesystem mount to '/'\n"); } else { rt_kprintf("onchip elm filesystem mount to '/' failed!\n"); } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。