AD5245_ATY.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * @file AD5245_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 AD5245 for all embedded device
  20. *
  21. * @version
  22. * - 1_01_220927 > ATY
  23. * -# Preliminary version, first Release
  24. * - 1_02_231229 > ATY
  25. * -# add multy addr and channel
  26. * - 1_01_240111 > ATY
  27. * -# add lock
  28. ********************************************************************************
  29. */
  30. #ifndef __AD5245_ATY_H
  31. #define __AD5245_ATY_H
  32. #include "INCLUDE_ATY.h"
  33. /******************************* For user *************************************/
  34. // Set AD0 voltage level for device address
  35. #define AD5245_AD0 1
  36. // 0 1 0 1 1 0 AD0 R/W
  37. #define AD5245_ADDRESS (0x2C | AD5245_AD0)
  38. /******************************************************************************/
  39. struct AD5245_ATY_Dev
  40. {
  41. uint8_t ad0;
  42. uint8_t addr;
  43. uint8_t(*i2cProcess)(uint8_t addr, uint8_t* data_t, uint8_t len, uint8_t rw);
  44. uint8_t lock;
  45. uint8_t debugEnable;
  46. int (*LOG)();
  47. };
  48. uint8_t AD5245_SetValue(uint8_t value, struct AD5245_ATY_Dev* dev);
  49. uint8_t AD5245_GetValue(uint8_t* value, struct AD5245_ATY_Dev* dev);
  50. #endif /* __AD5245_ATY_H */
  51. /******************************** End Of File *********************************/