1
0

drv_spi.h 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * 2020-06-27 AHTYDHD the first version
  9. */
  10. #ifndef __DRV_SPI_H__
  11. #define __DRV_SPI_H__
  12. #include <stdint.h>
  13. #include <rtdevice.h>
  14. #include <rthw.h>
  15. #include "drivers/spi.h"
  16. rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, uint32_t portindex, uint32_t cs_gpiobase, uint32_t cs_gpio_pin);
  17. struct tm4c123_hw_spi_cs
  18. {
  19. uint32_t portbase;
  20. uint32_t GPIO_Pin;
  21. };
  22. struct tm4c123_spi_config
  23. {
  24. uint32_t base;
  25. char *bus_name;
  26. };
  27. /* tm4c123 spi dirver class */
  28. struct tm4c123_spi
  29. {
  30. struct tm4c123_spi_config *config;
  31. struct rt_spi_configuration *cfg;
  32. struct rt_spi_bus spi_bus;
  33. };
  34. struct tm4c123_spi_device
  35. {
  36. rt_uint32_t pin;
  37. char *bus_name;
  38. char *device_name;
  39. };
  40. #endif /*__DRV_SPI_H__ */
  41. /************************** end of file ******************/