_infrared.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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(signal: List[int], repeat: int = 1, use_external_pin: bool = False, frequency: int = 38000, duty: float = 0.33) -> bool:
  13. '''
  14. Transmit an infrared signal. This is a blocking method.
  15. The method blocks until the whole signal is sent.
  16. The signal list has the same format as the return value
  17. of :func:`infrared_receive`. Hence you can directly re-send
  18. a received signal without any further processing.
  19. :param signal: The signal to use.
  20. :param repeat: How many times the signal should be sent.
  21. :param use_external_pin: :const:`True` to use an external IR LED on GPIO pin :const:`flipperzero.GPIO_PIN_PA7`.
  22. :param frequency: The frequency to use for the PWM signal.
  23. :param duty: The duty cycle to use for the PWM signal.
  24. :returns: :const:`True` on success, :const:`False` otherwise.
  25. .. versionadded:: 1.3.0
  26. '''
  27. pass
  28. def infrared_is_busy() -> bool:
  29. '''
  30. Check if the infrared subsystem is busy.
  31. :returns: :const:`True` if occupied, :const:`False` otherwise.
  32. .. versionadded:: 1.3.0
  33. '''
  34. pass