Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

PWM Example#

Overview#

This sample exercises the PWM HAL with a focus on synchronous multi-channel output, dynamic frequency and duty-cycle changes, and readback verification.

Source file: src/rtsmart/examples/peripheral/pwm/test_pwm.c

Default Setup#

  • Maps PWM0 to PIN42

  • Maps PWM1 to PIN43

Key APIs#

  • drv_pwm_init() / drv_pwm_deinit()

  • drv_pwm_set_freq() / drv_pwm_get_freq()

  • drv_pwm_set_duty() / drv_pwm_get_duty()

  • drv_pwm_enable() / drv_pwm_disable()

  • drv_fpioa_set_pin_func()

Build and Run#

cd src/rtsmart/examples/peripheral/pwm
make
./test_pwm

The sample has no command-line parameters.

Comments list
Comments
Log in