drv_spi.h 714 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2017-11-02 勤为本 first version
  9. */
  10. #ifndef LS1C_DRV_SPI_H
  11. #define LS1C_DRV_SPI_H
  12. #include "../libraries/ls1c_spi.h"
  13. struct ls1c_spi
  14. {
  15. unsigned char SPIx; // LS1C_SPI_0 or LS1C_SPI_1
  16. };
  17. struct ls1c_spi_cs
  18. {
  19. unsigned char cs; // LS1C_SPI_CS_0, LS1C_SPI_CS_1, LS1C_SPI_CS_2 or LS1C_SPI_CS_3
  20. };
  21. /*
  22. * 初始化并注册龙芯1c的spi总线
  23. * @SPI SPI总线,比如LS1C_SPI_0, LS1C_SPI_1
  24. * @spi_bus_name 总线名字
  25. * @ret
  26. */
  27. rt_err_t ls1c_spi_bus_register(rt_uint8_t SPI, const char *spi_bus_name);
  28. #endif