drv_spi.h 776 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. * 20012-01-01 aozima first implementation.
  9. */
  10. #ifndef gd32F20X_40X_SPI_H_INCLUDED
  11. #define gd32F20X_40X_SPI_H_INCLUDED
  12. #include <rtthread.h>
  13. #include <drivers/spi.h>
  14. #include "gd32f4xx.h"
  15. struct gd32f4_spi
  16. {
  17. uint32_t spi_periph;
  18. rcu_periph_enum spi_clk;
  19. struct rt_spi_bus *spi_bus;
  20. };
  21. struct gd32_spi_cs
  22. {
  23. uint32_t GPIOx;
  24. uint32_t GPIO_Pin;
  25. };
  26. /* public function */
  27. rt_err_t gd32_spi_bus_register(uint32_t spi_periph,
  28. //struct gd32_spi_bus * gd32_spi,
  29. const char * spi_bus_name);
  30. #endif // gd32F20X_40X_SPI_H_INCLUDED