LED_ATY.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @file LED_ATY.h
  3. *
  4. * @param Project DEVICE_GENERAL_ATY_LIB
  5. *
  6. * @author ATY
  7. *
  8. * @copyright
  9. * - Copyright 2017 - 2023 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 LED for all embedded device
  20. *
  21. * @version
  22. * - 1_01_220901 > ATY
  23. * -# Preliminary version, first Release
  24. ********************************************************************************
  25. */
  26. #ifndef __LED_ATY_H
  27. #define __LED_ATY_H
  28. #include "INCLUDE_ATY.h"
  29. /******************************* For user *************************************/
  30. // todo: add in struct
  31. // for breath
  32. // ms when cycle is 1ms // 3000 at 1ms cycle, 60000 at 24MHz main while cycle
  33. // #define FLOW_CYCLE_COUNT ((uint32_t)60000)
  34. // #define FLOW_CYCLE_COUNT (3000)
  35. // led brghtness split // 10 at 1ms cycle, 1000 at 24MHz main while cycle
  36. // #define ONE_PULSE_COUNT (60)
  37. // #define ONE_PULSE_COUNT (10)
  38. /******************************************************************************/
  39. struct LED_ATY_Dev
  40. {
  41. uint32_t ledBlinkStep;
  42. uint8_t ledBlinkType;
  43. void (*ioSet)(uint8_t level);
  44. uint8_t longSteps;
  45. uint32_t flowCycleCount; // optional
  46. uint8_t onePulseCount; // optional
  47. uint8_t lock;
  48. uint8_t debugEnable;
  49. void (*LOG)(const char*, ...);
  50. };
  51. uint8_t SysLedBlink(struct LED_ATY_Dev *dev);
  52. #endif /* __LED_ATY_H */
  53. /******************************** End Of File *********************************/