2023-05-11 10:25:21 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Email: opensource_embedded@phytium.com.cn
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2023-03-20 zhangyan first version
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DRT_QSPI_H__
|
|
|
|
#define __DRT_QSPI_H__
|
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
#include "rtconfig.h"
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
#ifdef RT_USING_QSPI
|
2023-08-02 13:27:09 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
#include "rtdevice.h"
|
|
|
|
#include "fqspi_flash.h"
|
2023-05-11 10:25:21 +08:00
|
|
|
#define PHYTIUM_QSPI_NAME "qspi"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
rt_uint32_t fqspi_id;
|
|
|
|
rt_uint32_t init; /* 0 is init already */
|
|
|
|
FQspiCtrl fqspi;
|
|
|
|
struct rt_spi_bus qspi_bus;
|
|
|
|
} phytium_qspi_bus;
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
rt_err_t phytium_qspi_bus_attach_device(const char *bus_name, const char *device_name);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif // !DRT_QSPI_H
|
|
|
|
|