drv_spi.h 911 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * File : gd32f20x_40x_spi.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009 RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 20012-01-01 aozima first implementation.
  13. */
  14. #ifndef gd32F20X_40X_SPI_H_INCLUDED
  15. #define gd32F20X_40X_SPI_H_INCLUDED
  16. #include <rtthread.h>
  17. #include <drivers/spi.h>
  18. #include "gd32f4xx.h"
  19. struct gd32f4_spi
  20. {
  21. uint32_t spi_periph;
  22. rcu_periph_enum spi_clk;
  23. struct rt_spi_bus *spi_bus;
  24. };
  25. struct gd32_spi_cs
  26. {
  27. uint32_t GPIOx;
  28. uint32_t GPIO_Pin;
  29. };
  30. /* public function */
  31. rt_err_t gd32_spi_bus_register(uint32_t spi_periph,
  32. //struct gd32_spi_bus * gd32_spi,
  33. const char * spi_bus_name);
  34. #endif // gd32F20X_40X_SPI_H_INCLUDED