Just got NRFX_QDEC driver implementation to work after some issues (using SDK 15.0.0). Thought I might share my experience, maybe help someone else, and give input Nordic for future driver improvements.
1. Since using SDK15, the legacy layer messes things up a bit. Setting NRFX_QDEC_<x> settings in sdk_config.h does not help since they are undefined and replaced by the QDEC_DRIVER_<x> settings. This is a more general issue, not a specific issue to QDEC I think. It's odd that you have to do your settings in legacy layer parts when this has been replaced by NRFX. Anyway, just make sure to change in the right place.
2. I'm not in need of the LED output. However, there is no obvious way of turning that off. The driver occupies a GPIO pin for this and reconfigures it to its liking. After reading posts here at the forum, the workaround was to give value 0xFFFFFFFF as pin number. Doing this will indeed disable that output, but it triggers an assertion in the driver which is not that pretty. Also, the driver assumes you have external pull-ups for your decoder inputs and disables internal pull-ups even though you might have set this before.
The workaround I used that solves all issues mentioned in 2 is to comment out lines that configures gpio from nrfx_qdec.c:
... //nrf_gpio_cfg_input(p_config->pselled, NRF_GPIO_PIN_NOPULL); //nrf_gpio_cfg_input(p_config->psela, NRF_GPIO_PIN_NOPULL); //nrf_gpio_cfg_input(p_config->pselb, NRF_GPIO_PIN_NOPULL); nrf_qdec_pio_assign(p_config->psela, p_config->pselb, p_config->pselled); ...
psela, pselb pins is configured outside driver instead, in my case using internal pull-ups. I think the best solution would be that information about pull-up/down as well as which pins are used would be provided in nrfx_qdec_config_t.
3. Even though the LED output now is assumed to be disabled, the LEDPRE setting is not disabled and will affect the setting used in SAMPLEPER (too long LEDPRE compared to SAMPLEPER time will block any pulses to be registered it seems). Just trying something, I ended up using LEDPRE=5 since I wanted a short sample time (SAMPLEPER = 0 => 128us)
Regards
Ola