MiLightRadioConfig.h 989 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include <Arduino.h>
  2. #ifndef _MILIGHT_RADIO_CONFIG
  3. #define _MILIGHT_RADIO_CONFIG
  4. class MiLightRadioConfig {
  5. public:
  6. MiLightRadioConfig(const uint16_t syncword0,
  7. const uint16_t syncword3,
  8. const size_t packetLength,
  9. const uint8_t* channels,
  10. const size_t numChannels)
  11. : syncword0(syncword0),
  12. syncword3(syncword3),
  13. packetLength(packetLength),
  14. channels(channels),
  15. numChannels(numChannels)
  16. {}
  17. const uint16_t syncword0;
  18. const uint16_t syncword3;
  19. const size_t packetLength;
  20. const uint8_t* channels;
  21. const size_t numChannels;
  22. };
  23. const uint8_t RGBW_CHANNELS[] = {9, 40, 71};
  24. static MiLightRadioConfig MilightRgbwConfig(
  25. 0x147A, 0x258B, 7, RGBW_CHANNELS, 3
  26. );
  27. const uint8_t CCT_CHANNELS[] = {4, 39, 74};
  28. static MiLightRadioConfig MilightCctConfig(
  29. 0x050A, 0x55AA, 7, CCT_CHANNELS, 3
  30. );
  31. const uint8_t RGBWCCT_CHANNELS[] = {70, 39, 8};
  32. static MiLightRadioConfig MilightRgbwCctConfig(
  33. 0x7236, 0x1809, 8, RGBWCCT_CHANNELS, 3
  34. );
  35. #endif