1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2020-06-27     AHTYDHD      the first version
9  */
10 
11 #ifndef __DRV_SPI_H__
12 #define __DRV_SPI_H__
13 
14 #include <stdint.h>
15 #include <rtdevice.h>
16 #include <rthw.h>
17 #include "drivers/dev_spi.h"
18 
19 rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, uint32_t portindex, uint32_t  cs_gpiobase, uint32_t cs_gpio_pin);
20 
21 struct tm4c123_hw_spi_cs
22 {
23     uint32_t portbase;
24     uint32_t GPIO_Pin;
25 };
26 
27 struct tm4c123_spi_config
28 {
29     uint32_t   base;
30     char      *bus_name;
31 };
32 
33 /* tm4c123 spi dirver class */
34 struct tm4c123_spi
35 {
36     struct tm4c123_spi_config *config;
37     struct rt_spi_configuration *cfg;
38     struct rt_spi_bus spi_bus;
39 };
40 
41 struct tm4c123_spi_device
42 {
43     rt_uint32_t pin;
44     char *bus_name;
45     char *device_name;
46 };
47 
48 #endif /*__DRV_SPI_H__ */
49 
50 /************************** end of file ******************/
51