Hi,
Thank you so much for your interest in our products and for using our community.
In the KV3x page, there is the application note AN12374 PMSM Field-Oriented Control on FRDMKV31F with Hall and Encoder Sensors with its respective SW file. In the code you can check the initialization and operation of the FTM2, which performs hall sensors signal processing.

Hope it helps you.
Have a nice day!