_infrared.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. from typing import List
  2. def infrared_receive(timeout: int = 1000000) -> List[int]:
  3. """
  4. Receive an infrared signal. This is a blocking method.
  5. The method blocks until a timeout occurs or the internal
  6. signal buffer (capacity is 1024 timings) is filled.
  7. :param timeout: The timeout to use in microseconds.
  8. :returns: A list of timings in microseconds, starting with high.
  9. .. versionadded:: 1.3.0
  10. """
  11. pass
  12. def infrared_transmit(
  13. signal: List[int],
  14. repeat: int = 1,
  15. use_external_pin: bool = False,
  16. frequency: int = 38000,
  17. duty: float = 0.33,
  18. ) -> bool:
  19. """
  20. Transmit an infrared signal. This is a blocking method.
  21. The method blocks until the whole signal is sent.
  22. The signal list has the same format as the return value
  23. of :func:`infrared_receive`. Hence you can directly re-send
  24. a received signal without any further processing.
  25. :param signal: The signal to use.
  26. :param repeat: How many times the signal should be sent.
  27. :param use_external_pin: :const:`True` to use an external IR LED on GPIO pin :const:`flipperzero.GPIO_PIN_PA7`.
  28. :param frequency: The frequency to use for the PWM signal.
  29. :param duty: The duty cycle to use for the PWM signal.
  30. :returns: :const:`True` on success, :const:`False` otherwise.
  31. .. versionadded:: 1.3.0
  32. """
  33. pass
  34. def infrared_is_busy() -> bool:
  35. """
  36. Check if the infrared subsystem is busy.
  37. :returns: :const:`True` if occupied, :const:`False` otherwise.
  38. .. versionadded:: 1.3.0
  39. """
  40. pass