nrf54l15 pwm capture on sdk v3.3.1

I have a sensor that outputs PWM that I need to interface to. All I need is an input GPIO pin and using GPIOTE + GPPI + timer capture I would be able to determine the duty cycle ratio.

I found a sample program that gives me an idea on how to go about it. From its README: "Zephyr GPIO driver is disabled to prevent it from registering its own handler for the GPIOTE interrupt."  The driver is disable by placing "CONFIG_GPIO=n" in prj.conf. 

The thing is I do need the GPIO driver to be enabled for other functions. Can it be done with the GPIO driver enabled? Is there an example I could use? If not, documentation?

Thanks

Regards

Sammy

Parents
  • Hi,

    Apologies, my earlier suggestion that simply declaring the instance would automatically share the driver's GPIOTE wasn't correct, and I appreciate you digging in and finding the solution yourself.

    Your approach works and looks good. gpio_nrf_gpiote_by_port_get() returns the GPIOTE instance the GPIO driver set up at boot, so you're using the same instance the driver initialized. I think there is no problem in doing this way.

    Best Regards,
    Syed Maysum

Reply
  • Hi,

    Apologies, my earlier suggestion that simply declaring the instance would automatically share the driver's GPIOTE wasn't correct, and I appreciate you digging in and finding the solution yourself.

    Your approach works and looks good. gpio_nrf_gpiote_by_port_get() returns the GPIOTE instance the GPIO driver set up at boot, so you're using the same instance the driver initialized. I think there is no problem in doing this way.

    Best Regards,
    Syed Maysum

Children
No Data
Related