4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-17 03:54:09 +08:00
liu2guang f9e58990ef [BSP][RT1050] fix rt1050 bsp bug and update code. | 修复RT1050 BSP bug并更新代码.
修复以下问题:
1.  修复当配置BSP为野火开发板时, 编译无法通过问题.。
2.  修复ft5406驱动挂载i2c总线到i2c1 bus。
3.  修复spibus时钟分频数错误,并修复所有spi bus都关闭时编译警告。

更新代码:
1. 移除rtgui相关初始化代码.。
2. 导出lcd相关配置参数:HSW/HFP/HBP/VSW/VFP/VBP/Backlight pin/Reset pin/width pixel/height pixel。
3. 当配置BSP为野火板子时, 默认添加sdio驱动。
2018-04-13 10:40:53 +08:00

52 lines
1.3 KiB
C

/*
* File : drv_spi_flash.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006-2013, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2018-04-02 Liuguang the first version.
*/
#include "drv_spi_flash.h"
#include "spi_flash.h"
#include "spi_flash_sfud.h"
#ifndef SPI_FLASH_USING_SPIBUS_NAME
#define SPI_FLASH_USING_SPIBUS_NAME "spi4"
#endif
#ifndef SPI_FLASH_NAME
#define SPI_FLASH_NAME "flash0"
#endif
#ifndef SPI_FLASH_USING_CS_PIN
#define SPI_FLASH_USING_CS_PIN (79)
#endif
int rt_hw_spi_flash_init(void)
{
rt_err_t ret;
extern rt_err_t rt1050_spi_bus_attach_device(const char *bus_name,
const char *device_name, rt_uint32_t pin);
ret = rt1050_spi_bus_attach_device(SPI_FLASH_USING_SPIBUS_NAME,
SPI_FLASH_USING_SPIBUS_NAME "0", SPI_FLASH_USING_CS_PIN);
if(ret != RT_EOK)
{
return ret;
}
if(rt_sfud_flash_probe(SPI_FLASH_NAME, SPI_FLASH_USING_SPIBUS_NAME "0") == RT_NULL)
{
return RT_ERROR;
}
return RT_EOK;
}
INIT_DEVICE_EXPORT(rt_hw_spi_flash_init);