Does anyone have an example of using pinctrl and pwm on a Nordic device using Zephyr for a motor driver or something like that?
All the examples appear to NOT use the pinctrl, even though there are messages all over that not using pinctrl is deprecated. Also, they all seem to use pwm-leds, which appears to duplicate the pinctrl information and make pinctrl basically worthless.
In particular, if I set things up like this:
&pinctrl {
/* boost pwm drive pin */
boost_pwm_default: boost_pwm_default {
group1 {
// Put boost drive output onto LED1 for now
psels = <NRF_PSEL(PWM_OUT0, 0, 14)>;
};
};
/* make sure sleeping does not alter pinout */
boost_pwm_sleep: boost_pwm_sleep {
group1 {
// Put boost drive output onto LED1 for now
psels = <NRF_PSEL(PWM_OUT0, 0, 14)>;
};
};
};
// Get this using a dt label of boostpwm
boostpwm: &pwm0 {
status = "okay";
pinctrl-0 = <&boost_pwm_default>;
pinctrl-1 = <&boost_pwm_sleep>; // make sure sleeping does not change pinout
};
How do I call pwm_pin_set_cycles()? I need to provide it a device controller, a pin, and flags. All the examples use macros that
go through pwm-leds, like DT_PWMS_CTLR, DT_PWMS_CHANNEL and DT_PWMS_FLAGS. But these macros don't appear to work without pwm-leds.
Are there equivalent macros using pinctrl?
Or should I be using a different API?