Hello,
MbedOs provides only PwmOut API, with this it is possible to set and read the set values.
MbedOs does not provide any API for reading PWM, but there exist a simple community library - PwmIn - An interface to read a PWM input signal, using In… | Mbed
PwmIn library, Errorhandling? - Arm Mbed OS support forum
BR, Jan