2020-07-01 23:44:57 +08:00
|
|
|
/*
|
2021-03-21 22:23:24 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2020-07-01 23:44:57 +08:00
|
|
|
*
|
|
|
|
* 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__
|
2020-06-24 19:54:42 +08:00
|
|
|
|
|
|
|
#include <rtdevice.h>
|
|
|
|
#include <rthw.h>
|
|
|
|
#include "drivers/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;
|
2020-07-01 23:44:57 +08:00
|
|
|
char *bus_name;
|
2020-06-24 19:54:42 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
};
|
|
|
|
|
2020-07-01 23:44:57 +08:00
|
|
|
#endif /*__DRV_SPI_H__ */
|
2020-06-24 19:54:42 +08:00
|
|
|
|
2021-03-21 22:23:24 +08:00
|
|
|
/************************** end of file ******************/
|