drv_spi.h 629 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-03-06 BalanceTWK first version
  9. */
  10. #ifndef __SPI_CONFIG_H__
  11. #define __SPI_CONFIG_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <n32g45x.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. struct n32_hw_spi_cs
  19. {
  20. GPIO_Module* module;
  21. uint32_t pin;
  22. };
  23. rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, GPIO_Module *cs_gpiox, uint32_t cs_gpio_pin);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif /* __SPI_CONFIG_H__ */