Hi,
I think polling mode is not suitable. Better is to use interrupt mode when you measure time between selected type of edges. An attached example present measurement of period (frequency) between two rising edges. Simple adjustment can be done to measure a period between each type of edges. Just calculation logic has to consider what represents a measured frequency. As an example I can mention principle when frequency of the measured system is not given by frequency between two edges but for example by duty cycle in some period. In this case we have to measure period between two given edges. For example if the frequency is given by period between two edges in given order then you have to measure only this period. If it is given by dutycycle within undefined period then you have to measure period between all edges and create calculation logic.
I have also attached a main.c functio for another type of MCU where I adjuste calculation method. It fixes some problems in method used in the XEP frequency measurement example.
Unfortunately, there is no application note published. I believe the examples are readable and easy to understand.
Some more examples you can find at: https://community.nxp.com/docs/DOC-329209
Best regards,
Ladislav