hx710a.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @file hx710a.h
  3. *
  4. * @param Project DEVICE_GENERAL_ATY_LIB
  5. *
  6. * @author ATY
  7. *
  8. * @copyright
  9. * - Copyright 2017 - 2026 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 functions of HX710A for C platform
  20. *
  21. * @version
  22. * - 1_01_251112 > ATY
  23. * -# Add Dev-style interface aligned to LED_ATY
  24. ********************************************************************************
  25. */
  26. #ifndef __HX710A_H
  27. #define __HX710A_H
  28. #include "INCLUDE_ATY.h"
  29. /******************************* For user *************************************/
  30. /******************************************************************************/
  31. struct HX710A_ATY_Dev
  32. {
  33. void (*sckSet)(uint8_t level);
  34. uint8_t (*doutRead)(void);
  35. void (*delay_ms)(uint16_t ms); // optional
  36. uint8_t lock;
  37. uint8_t debugEnable;
  38. void (*LOG)(const char*, ...);
  39. };
  40. uint8_t HX710A_InitDev(struct HX710A_ATY_Dev* dev);
  41. uint8_t HX710A_IsReadyDev(struct HX710A_ATY_Dev* dev);
  42. uint8_t HX710A_ReadRawDev(uint8_t p, uint32_t* raw, struct HX710A_ATY_Dev* dev);
  43. #endif /* __HX710A_H */
  44. /******************************** End Of File *********************************/