infrared_protocol_samsung.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "infrared_protocol_samsung_i.h"
  2. const InfraredCommonProtocolSpec infrared_protocol_samsung32 = {
  3. .timings =
  4. {
  5. .preamble_mark = INFRARED_SAMSUNG_PREAMBLE_MARK,
  6. .preamble_space = INFRARED_SAMSUNG_PREAMBLE_SPACE,
  7. .bit1_mark = INFRARED_SAMSUNG_BIT1_MARK,
  8. .bit1_space = INFRARED_SAMSUNG_BIT1_SPACE,
  9. .bit0_mark = INFRARED_SAMSUNG_BIT0_MARK,
  10. .bit0_space = INFRARED_SAMSUNG_BIT0_SPACE,
  11. .preamble_tolerance = INFRARED_SAMSUNG_PREAMBLE_TOLERANCE,
  12. .bit_tolerance = INFRARED_SAMSUNG_BIT_TOLERANCE,
  13. .silence_time = INFRARED_SAMSUNG_SILENCE,
  14. .min_split_time = INFRARED_SAMSUNG_MIN_SPLIT_TIME,
  15. },
  16. .databit_len[0] = 32,
  17. .no_stop_bit = false,
  18. .decode = infrared_common_decode_pdwm,
  19. .encode = infrared_common_encode_pdwm,
  20. .interpret = infrared_decoder_samsung32_interpret,
  21. .decode_repeat = infrared_decoder_samsung32_decode_repeat,
  22. .encode_repeat = infrared_encoder_samsung32_encode_repeat,
  23. };
  24. static const InfraredProtocolVariant infrared_protocol_variant_samsung32 = {
  25. .name = "Samsung32",
  26. .address_length = 8,
  27. .command_length = 8,
  28. .frequency = INFRARED_COMMON_CARRIER_FREQUENCY,
  29. .duty_cycle = INFRARED_COMMON_DUTY_CYCLE,
  30. .repeat_count = INFRARED_SAMSUNG_REPEAT_COUNT_MIN,
  31. };
  32. const InfraredProtocolVariant* infrared_protocol_samsung32_get_variant(InfraredProtocol protocol) {
  33. if(protocol == InfraredProtocolSamsung32)
  34. return &infrared_protocol_variant_samsung32;
  35. else
  36. return NULL;
  37. }