PWM capture mode

  • Hello, the capture mode of PWM is enabled by default. After inputting the PWM signal to the pin, you can view it by using the command.

    Code: Select all

    # X should be adjusted according to the actual situation 
    echo 0 > /sys/class/pwm/pwmchipX/export 
    cat /sys/class/pwm/pwmchipX/pwm0/capture
    
    Note: Once the "enable" setting is set to 1, the system will enter the output mode and will no longer be able to capture.

    Code: Select all

    echo 1 >  /sys/class/pwm/pwmchipX/pwm0/enable
    
  • Thanks!!!