2016-05-20 14:07:32 +08:00
|
|
|
/*
|
2023-04-18 10:26:23 +08:00
|
|
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
2016-05-20 14:07:32 +08:00
|
|
|
*
|
2018-10-14 19:37:18 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-05-20 14:07:32 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2016/5/20 bernard the first version
|
2021-01-07 16:28:54 +08:00
|
|
|
* 2020/1/7 redoc add include
|
2016-05-20 14:07:32 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPI_FLASH_H__
|
|
|
|
#define SPI_FLASH_H__
|
|
|
|
|
2021-01-07 16:28:54 +08:00
|
|
|
#include <rtdevice.h>
|
|
|
|
|
2016-05-20 14:07:32 +08:00
|
|
|
struct spi_flash_device
|
|
|
|
{
|
|
|
|
struct rt_device flash_device;
|
|
|
|
struct rt_device_blk_geometry geometry;
|
|
|
|
struct rt_spi_device * rt_spi_device;
|
|
|
|
struct rt_mutex lock;
|
2016-10-10 10:24:30 +08:00
|
|
|
void * user_data;
|
2016-05-20 14:07:32 +08:00
|
|
|
};
|
|
|
|
|
2016-10-10 10:24:30 +08:00
|
|
|
typedef struct spi_flash_device *rt_spi_flash_device_t;
|
|
|
|
|
2017-02-13 19:37:53 +08:00
|
|
|
#ifdef RT_USING_MTD_NOR
|
|
|
|
struct spi_flash_mtd
|
|
|
|
{
|
2021-03-08 18:19:04 +08:00
|
|
|
struct rt_mtd_nor_device mtd_device;
|
|
|
|
struct rt_spi_device * rt_spi_device;
|
|
|
|
struct rt_mutex lock;
|
|
|
|
void * user_data;
|
2017-02-13 19:37:53 +08:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2016-05-20 14:07:32 +08:00
|
|
|
#endif
|