zephyr pwm sequence

In SDK 15 I was able to build a 3 output arbitrary waveform generator using a pwm module in sequence mode. 

Is this possible with the Zephyr pwm API?

If so Is there an example of this somewhere using the Zephyr API?

Or do I need to bypass zephyr and hook into the nrfx device driver directly?

  

Parents Reply Children
  • The interrupt priority comes from the devicetree file. For PWM0 on the nRF52833 you have this section in zephyr/dts/arm/nordic/nrf52833.dtsi (there are also similar for the other PWM instances):

    		pwm0: pwm@4001c000 {
    			compatible = "nordic,nrf-pwm";
    			reg = <0x4001c000 0x1000>;
    			interrupts = <28 NRF_DEFAULT_IRQ_PRIORITY>;
    			status = "disabled";
    			label = "PWM_0";
    			#pwm-cells = <3>;
    		};

    The default priority is 1. If you want to change the interrupt priority, you can make an overlay file for your board where you set a different priority. The PWM related part would then be something like this (here the priority is set to 0, adjust as needed):

    &pwm0 {
    	interrupts = <28 0>;
    };

Related