Activate in usercode.h //#define PWM_DUTYCYCLE_READ_ACTIVE. Here the expected frequency, the resolution and the digital input are defined. Unfortunately, this is only intended for one channel. If you want to use multiple channels you can use the following code in usercode_init ():
os_pwm_duty_read [PWM_DUTYCYCLE_READ_CH] .active = 1;
os_pwm_duty_read [PWM_DUTYCYCLE_READ_CH] .init_freq = PWM_DUTYCYCLE_READ_FREQ;
os_pwm_duty_read [PWM_DUTYCYCLE_READ_CH] .init_res = PWM_DUTYCYCLE_READ_RES;