Extend the PWM API with optional API functions for capturing PWM pulse width and period cycles. Fixes #26026. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>