summaryrefslogtreecommitdiff
path: root/bsp/tm4c123bsp/libraries/Drivers/drv_spi.h
blob: c58a71381c40a9f27930ca3e65a119778d39d2ea (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
43
44
45
46
47
48
49
50
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-06-27     AHTYDHD      the first version
 */

#ifndef __DRV_SPI_H__
#define __DRV_SPI_H__

#include <stdint.h>
#include <rtdevice.h>
#include <rthw.h>
#include "drivers/dev_spi.h"

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);

struct tm4c123_hw_spi_cs
{
    uint32_t portbase;
    uint32_t GPIO_Pin;
};

struct tm4c123_spi_config
{
    uint32_t   base;
    char      *bus_name;
};

/* tm4c123 spi dirver class */
struct tm4c123_spi
{
    struct tm4c123_spi_config *config;
    struct rt_spi_configuration *cfg;
    struct rt_spi_bus spi_bus;
};

struct tm4c123_spi_device
{
    rt_uint32_t pin;
    char *bus_name;
    char *device_name;
};

#endif /*__DRV_SPI_H__ */

/************************** end of file ******************/