I think that routine is not available in the code . But here is an idea on how to detect whether it is PS/2 or USB.
At POR, the D+ and D- pins are in Hi-Z . You can constantly samples the pins to determine the device interface. If both D+ and D- are low for a certain period of time, the interface is USB. Otherwise, it’s PS2.