_pwm.py 979 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. def pwm_start(pin: int, frequency: int, duty: int) -> bool:
  2. """
  3. Start or change the PWM signal on the corresponding GPIO pin.
  4. :param pin: The pin to read (e.g. :const:`GPIO_PIN_PA7`).
  5. :param frequency: The frequency to set in Hz.
  6. :param duty: The duty cycle per period in percent.
  7. :returns: :const:`True` on success, :const:`False` otherwise.
  8. .. versionadded:: 1.3.0
  9. .. warning::
  10. You don't have to initialize the pin first.
  11. """
  12. pass
  13. def pwm_stop(pin: int) -> None:
  14. """
  15. Stop the PWM signal on the corresponding GPIO pin.
  16. :param pin: The pin to use (e.g. :const:`GPIO_PIN_PA7`).
  17. .. versionadded:: 1.3.0
  18. """
  19. pass
  20. def pwm_is_running(pin: int) -> bool:
  21. """
  22. Check if the corresponding GPIO pin has a PWM signal output.
  23. :param pin: The pin to check (e.g. :const:`GPIO_PIN_PA7`).
  24. :returns: :const:`True` on success, :const:`False` otherwise.
  25. .. versionadded:: 1.3.0
  26. """
  27. pass