EdgePulse.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // // ******************************************************************
  2. // // /\ /| @File EdgePulse.cpp
  3. // // \ V/ @Brief
  4. // // | "") @Author lijinwen, ghz005@uni-trend.com.cn
  5. // // / | @Creation 2024-3-14
  6. // // / \\ @Modified 2024-5-13
  7. // // *(__\_\
  8. // // ******************************************************************
  9. #include "EdgePulse.h"
  10. namespace Protocol
  11. {
  12. // int32_t EdgePulse::GetLength() const
  13. // {
  14. // return EndIndex > StartIndex && StartIndex > 0 ? EndIndex - StartIndex : 0;
  15. // }
  16. // TwoLevelEdgePulse::TwoLevelEdgePulse(TwoLevelEdgePulseStatusType current)
  17. // {
  18. // CurrentLevel = current;
  19. // }
  20. ThreeLevelEdgePulseStatusType ThreeLevelEdgePulse::ConvertToStatus(const bool highLevel, const bool lowLoglevel)
  21. {
  22. return static_cast<ThreeLevelEdgePulseStatusType>((highLevel ? 1 : 0) << 1 | (lowLoglevel ? 1 : 0));
  23. }
  24. ThreeLevelEdgePulse::ThreeLevelEdgePulse(ThreeLevelEdgePulseStatusType current)
  25. {
  26. CurrentLevel = current;
  27. }
  28. }