HW_SPI_ATY.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @file HW_SPI_ATY.h
  3. *
  4. * @param Project DEVICE_GENERAL_ATY_LIB
  5. *
  6. * @author ATY
  7. *
  8. * @copyright
  9. * - Copyright 2017 - 2025 MZ-ATY
  10. * - This code follows:
  11. * - MZ-ATY Various Contents Joint Statement -
  12. * <a href="https://mengze.top/MZ-ATY_VCJS">
  13. * https://mengze.top/MZ-ATY_VCJS</a>
  14. * - CC 4.0 BY-NC-SA -
  15. * <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
  16. * https://creativecommons.org/licenses/by-nc-sa/4.0/</a>
  17. * - Your use will be deemed to have accepted the terms of this statement.
  18. *
  19. * @brief Familiar functions of SPI for all embedded device
  20. *
  21. * @version
  22. * - 1_01_221028 > ATY
  23. * -# Preliminary version, first Release
  24. * - 1_01_240111 > ATY
  25. * -# add multy addr and channel
  26. * -# add lock
  27. ********************************************************************************
  28. */
  29. #ifndef __HW_SPI_ATY_H
  30. #define __HW_SPI_ATY_H
  31. #include "INCLUDE_ATY.h"
  32. /******************************* For user *************************************/
  33. /******************************************************************************/
  34. struct HW_SPI_ATY_Dev
  35. {
  36. uint8_t hardwareEnable;
  37. uint8_t(*spiProcess)(uint8_t* data_t, uint16_t len, uint8_t rw);
  38. void (*delay)(uint32_t t);
  39. uint8_t lock;
  40. uint8_t debugEnable;
  41. void (*LOG)(const char*, ...);
  42. };
  43. uint8_t SPI_Write(uint8_t* data_t, uint16_t len, struct HW_SPI_ATY_Dev* dev);
  44. uint8_t SPI_Read(uint8_t* data_t, uint16_t len, struct HW_SPI_ATY_Dev* dev);
  45. uint8_t SPI_ReadWrite(uint8_t* data_t, uint16_t len, struct HW_SPI_ATY_Dev* dev);
  46. #endif /* __HW_SPI_ATY_H */
  47. /******************************** End Of File *********************************/