infrared_protocol_sirc.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "../infrared_i.h"
  3. /***************************************************************************************************
  4. * Sony SIRC protocol description
  5. * https://www.sbprojects.net/knowledge/ir/sirc.php
  6. * http://picprojects.org.uk/
  7. ****************************************************************************************************
  8. * Preamble Preamble Pulse Width Modulation Pause Entirely repeat
  9. * mark space up to period message..
  10. *
  11. * 2400 600 12/15/20 bits (600,1200) ...45000 2400 600
  12. * __________ _ _ _ _ _ _ _ _ _ _ _ _ _ __________ _ _
  13. * ____ __________ _ _ _ __ __ __ _ _ __ __ _ _ ____________________ __________ _
  14. * | command | address |
  15. * SIRC | 7b LSB | 5b LSB |
  16. * SIRC15 | 7b LSB | 8b LSB |
  17. * SIRC20 | 7b LSB | 13b LSB |
  18. *
  19. * No way to determine either next message is repeat or not,
  20. * so recognize only fact message received. Sony remotes always send at least 3 messages.
  21. * Assume 8 last extended bits for SIRC20 are address bits.
  22. ***************************************************************************************************/
  23. void* infrared_decoder_sirc_alloc(void);
  24. void infrared_decoder_sirc_reset(void* decoder);
  25. InfraredMessage* infrared_decoder_sirc_check_ready(void* decoder);
  26. void infrared_decoder_sirc_free(void* decoder);
  27. InfraredMessage* infrared_decoder_sirc_decode(void* decoder, bool level, uint32_t duration);
  28. void* infrared_encoder_sirc_alloc(void);
  29. void infrared_encoder_sirc_reset(void* encoder_ptr, const InfraredMessage* message);
  30. void infrared_encoder_sirc_free(void* decoder);
  31. InfraredStatus infrared_encoder_sirc_encode(void* encoder_ptr, uint32_t* duration, bool* polarity);
  32. const InfraredProtocolVariant* infrared_protocol_sirc_get_variant(InfraredProtocol protocol);