mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-25 23:47:22 +08:00
76e123d8ca
* -更新芯片型号和板子型号 * -天空星目前只有青春版(没有贴外部flash),高配版(有贴外部flash)正在生产,所贴的SPI FLASH 从GD25Q32升级为W25Q128。
34 lines
676 B
C
34 lines
676 B
C
/*
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Change Logs:
|
|
* Date Author Notes
|
|
* 2018-11-27 SummerGift add spi flash port file
|
|
*/
|
|
|
|
#include <rtthread.h>
|
|
#include "spi_flash.h"
|
|
#include "spi_flash_sfud.h"
|
|
#include <drv_spi.h>
|
|
#include <drv_gpio.h>
|
|
|
|
#if defined(BSP_USING_SPI_FLASH)
|
|
|
|
static int rt_hw_spi_flash_init(void)
|
|
{
|
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
|
rt_hw_spi_device_attach("spi1", "spi10", GET_PIN(A, 4));
|
|
|
|
if (RT_NULL == rt_sfud_flash_probe("W25Q128", "spi10"))
|
|
{
|
|
return -RT_ERROR;
|
|
}
|
|
|
|
return RT_EOK;
|
|
}
|
|
INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);
|
|
#endif
|
|
|