drivers: pwm: add pwm_dt_spec and associated helpers
drivers: pwm: add pwm_dt_spec and associated helpers

Similar to other APIs, this patch introduces the pwm_dt_spec structure
and associated helpers, e.g. PWM_DT_SPEC_GET() or pwm_set_cycles_dt().

The pwm_dt_spec reduces the boilerplate code needed when using
Devicetree. For example, if we have:

led: led {
    ...
    pwms = <&pwm0 1 PWM_POLARITY_NORMAL>;
    ...
};

One can do now in the application:

struct pwm_dt_spec led = PWM_DT_SPEC_GET(DT_NODELABEL(led));

pwm_set_usec_dt(&led, LED_PERIOD_USEC, LED_PULSE_USEC);

Signed-off-by: Gerard Marull-Paretas <bedb45f43a286e49f4dcda039a436b216ae61ef3@nordicsemi.no>

zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,finikorg/zephyr,finikorg/zephyr