infrared_protocol_rc6.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "../infrared_i.h"
  3. /***************************************************************************************************
  4. * RC6 protocol description
  5. * https://www.mikrocontroller.net/articles/IRMP_-_english#RC6_.2B_RC6A
  6. ****************************************************************************************************
  7. * Preamble Manchester/biphase Silence
  8. * mark/space Modulation
  9. *
  10. * 2666 889 444/888 - bit (x2 for toggle bit) 2666
  11. *
  12. * ________ __ __ __ __ ____ __ __ __ __ __ __ __ __
  13. * _ _________ ____ __ __ ____ __ __ __ __ __ __ __ __ _______________
  14. * | 1 | 0 | 0 | 0 | 0 | ... | ... | |
  15. * s m2 m1 m0 T address (MSB) command (MSB)
  16. *
  17. * s - start bit (always 1)
  18. * m0-2 - mode (000 for RC6)
  19. * T - toggle bit, twice longer
  20. * address - 8 bit
  21. * command - 8 bit
  22. ***************************************************************************************************/
  23. void* infrared_decoder_rc6_alloc(void);
  24. void infrared_decoder_rc6_reset(void* decoder);
  25. void infrared_decoder_rc6_free(void* decoder);
  26. InfraredMessage* infrared_decoder_rc6_check_ready(void* ctx);
  27. InfraredMessage* infrared_decoder_rc6_decode(void* decoder, bool level, uint32_t duration);
  28. void* infrared_encoder_rc6_alloc(void);
  29. void infrared_encoder_rc6_reset(void* encoder_ptr, const InfraredMessage* message);
  30. void infrared_encoder_rc6_free(void* decoder);
  31. InfraredStatus infrared_encoder_rc6_encode(void* encoder_ptr, uint32_t* duration, bool* polarity);
  32. const InfraredProtocolVariant* infrared_protocol_rc6_get_variant(InfraredProtocol protocol);