rt-thread-official/bsp/gd32450z-eval/drivers/drv_spi.h

39 lines
776 B
C
Raw Normal View History

2017-08-29 19:30:21 +08:00
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
2017-08-29 19:30:21 +08:00
*
* SPDX-License-Identifier: Apache-2.0
2017-08-29 19:30:21 +08:00
*
* Change Logs:
* Date Author Notes
* 20012-01-01 aozima first implementation.
*/
2017-08-30 15:30:38 +08:00
#ifndef gd32F20X_40X_SPI_H_INCLUDED
#define gd32F20X_40X_SPI_H_INCLUDED
2017-08-29 19:30:21 +08:00
#include <rtthread.h>
#include <drivers/spi.h>
#include "gd32f4xx.h"
2017-08-30 15:30:38 +08:00
struct gd32f4_spi
2017-08-29 19:30:21 +08:00
{
uint32_t spi_periph;
rcu_periph_enum spi_clk;
struct rt_spi_bus *spi_bus;
};
2017-08-30 15:30:38 +08:00
struct gd32_spi_cs
2017-08-29 19:30:21 +08:00
{
uint32_t GPIOx;
uint32_t GPIO_Pin;
};
/* public function */
2017-08-30 15:30:38 +08:00
rt_err_t gd32_spi_bus_register(uint32_t spi_periph,
2021-03-12 00:03:36 +08:00
//struct gd32_spi_bus * gd32_spi,
const char * spi_bus_name);
2017-08-29 19:30:21 +08:00
2017-08-30 15:30:38 +08:00
#endif // gd32F20X_40X_SPI_H_INCLUDED