Setup Input Capture in Zephyr

Hello, can you please provide more information and instructions on how we configure the input capture on nrf52840 dev board using zephyr? All sample examples only cover pwm output. I have a square signal that I would like to capture the time associated with its rising and falling edges. According to the zephyr PWM driver documentation, I could do this by configuring the capture feature using the following function:

static inline int pwm_pin_configure_capture(const struct device *dev, uint32_t pwm, pwm_flags_t flags, pwm_capture_callback_handler_t cb, void * user_data)

In the function, I would use PWM_CAPTURE_TYPE_BOTH and PWM_CAPTURE_MODE_CONTINUOUS flags. However, it is not clear to me how do I configure which pin is the capture pin. I am assuming I need to create a DTS overlay file but not sure about the content. Thank you.