summaryrefslogtreecommitdiff
path: root/bsp/at32/libraries/rt_drivers/drv_qspi.h
blob: 11cafaf4016f84895d1a4f4d1129fa95c876e435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-03-29     shelton      first version
 */

#ifndef __DRV_QSPI_H__
#define __DRV_QSPI_H__

#include <rtthread.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef BSP_USING_QSPI1
#define QSPI1_BUS_CONFIG                                       \
    {                                                          \
        .qspi_x                 = QSPI1,                       \
        .bus_name               = "qspi1",                     \
    }
#endif /* BSP_USING_QSPI1 */

#ifdef BSP_USING_QSPI2
#define QSPI2_BUS_CONFIG                                       \
    {                                                          \
        .qspi_x                 = QSPI2,                       \
        .bus_name               = "qspi2",                     \
    }
#endif /* BSP_USING_QSPI2 */

rt_err_t rt_hw_qspi_device_attach(const char *bus_name, const char *device_name, rt_base_t cs_pin, rt_uint8_t data_line_width, void (*enter_qspi_mode)(), void (*exit_qspi_mode)());

#ifdef __cplusplus
}
#endif

#endif /* __DRV_QSPI_H__ */