Nano 33 BLE nrf52840 Quadrature decoder

I am trying to develop a stepper controller with quadrature speed feedback & 5 input buttons.
I would like to use the nrf52840's quadrature decoder hardware.
Has anyone used this before or got some example code that I could look at?
thanks for your time,