1 /*
2  * Copyright (c) 2006-2024 RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2024-10-08     wumingzi      first implementation
9  */
10 
11 #ifndef __DRV_SPI_H__
12 #define __DRV_SPI_H__
13 
14 #include <rthw.h>
15 #include <rtthread.h>
16 #include <board.h>
17 #include "driver/spi_common.h" /*bsp/ESP32_C3/packages/ESP-IDF-latest/components/driver/include/driver/spi_common.h*/
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 /* esp32 spi dirver class */
23 struct esp32_spi
24 {
25     char *bus_name;
26     struct rt_spi_bus *spi_bus;
27     spi_bus_config_t* esp32_spi_bus_cfg;
28 };
29 
30 rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, rt_base_t cs_pin);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif /* __DRV_SPI_H__ */
37