infrared_protocol_rc6.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "infrared_protocol_rc6_i.h"
  2. const InfraredCommonProtocolSpec infrared_protocol_rc6 = {
  3. .timings =
  4. {
  5. .preamble_mark = INFRARED_RC6_PREAMBLE_MARK,
  6. .preamble_space = INFRARED_RC6_PREAMBLE_SPACE,
  7. .bit1_mark = INFRARED_RC6_BIT,
  8. .preamble_tolerance = INFRARED_RC6_PREAMBLE_TOLERANCE,
  9. .bit_tolerance = INFRARED_RC6_BIT_TOLERANCE,
  10. .silence_time = INFRARED_RC6_SILENCE,
  11. .min_split_time = INFRARED_RC6_MIN_SPLIT_TIME,
  12. },
  13. .databit_len[0] =
  14. 1 + 3 + 1 + 8 +
  15. 8, // start_bit + 3 mode bits, + 1 toggle bit (x2 timing) + 8 address + 8 command
  16. .manchester_start_from_space = false,
  17. .decode = infrared_decoder_rc6_decode_manchester,
  18. .encode = infrared_encoder_rc6_encode_manchester,
  19. .interpret = infrared_decoder_rc6_interpret,
  20. .decode_repeat = NULL,
  21. .encode_repeat = NULL,
  22. };
  23. static const InfraredProtocolVariant infrared_protocol_variant_rc6 = {
  24. .name = "RC6",
  25. .address_length = 8,
  26. .command_length = 8,
  27. .frequency = INFRARED_RC6_CARRIER_FREQUENCY,
  28. .duty_cycle = INFRARED_RC6_DUTY_CYCLE,
  29. .repeat_count = INFRARED_RC6_REPEAT_COUNT_MIN,
  30. };
  31. const InfraredProtocolVariant* infrared_protocol_rc6_get_variant(InfraredProtocol protocol) {
  32. if(protocol == InfraredProtocolRC6)
  33. return &infrared_protocol_variant_rc6;
  34. else
  35. return NULL;
  36. }