1 /*
2  * Copyright (c) 2006-2023, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2016/5/20      bernard      the first version
9  * 2020/1/7       redoc        add include
10  */
11 
12 #ifndef __DEV_SPI_FLASH_H__
13 #define __DEV_SPI_FLASH_H__
14 
15 #include <rtdevice.h>
16 
17 struct spi_flash_device
18 {
19     struct rt_device                flash_device;
20     struct rt_device_blk_geometry   geometry;
21     struct rt_spi_device *          rt_spi_device;
22     struct rt_mutex                 lock;
23     void *                          user_data;
24 };
25 
26 typedef struct spi_flash_device *rt_spi_flash_device_t;
27 
28 #ifdef RT_USING_MTD_NOR
29 struct spi_flash_mtd
30 {
31     struct rt_mtd_nor_device            mtd_device;
32     struct rt_spi_device *              rt_spi_device;
33     struct rt_mutex                     lock;
34     void *                              user_data;
35 };
36 #endif
37 
38 #endif
39