MiLightRadioConfig.h 839 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <Arduino.h>
  2. #include <MiLightConstants.h>
  3. #include <Size.h>
  4. #ifndef _MILIGHT_RADIO_CONFIG
  5. #define _MILIGHT_RADIO_CONFIG
  6. #define MILIGHT_MAX_PACKET_LENGTH 9
  7. class MiLightRadioConfig {
  8. public:
  9. static const size_t NUM_CHANNELS = 3;
  10. MiLightRadioConfig(
  11. const uint16_t syncword0,
  12. const uint16_t syncword3,
  13. const size_t packetLength,
  14. const uint8_t channel0,
  15. const uint8_t channel1,
  16. const uint8_t channel2
  17. )
  18. : syncword0(syncword0),
  19. syncword3(syncword3),
  20. packetLength(packetLength)
  21. {
  22. channels[0] = channel0;
  23. channels[1] = channel1;
  24. channels[2] = channel2;
  25. }
  26. const uint16_t syncword0;
  27. const uint16_t syncword3;
  28. uint8_t channels[3];
  29. const size_t packetLength;
  30. static const size_t NUM_CONFIGS = 4;
  31. static MiLightRadioConfig ALL_CONFIGS[NUM_CONFIGS];
  32. };
  33. #endif