What does PA1 do in this schematic?
I can be wrong but it's like current protection.

R22 is a current shunt. You can say that this is a current sensor.
Q11 and Q12 Current protection. And Q12 is necessary for the latch effect. If the current is exceeded, the IGBT will no longer be able to open. Most likely the GPIO of the PA1 works as a logical input and fixes the overcurrent event.

D12 is necessary to prevent the current from flowing through the dumping microcontroller diodes.The microcontroller itself most likely a pull-up to 5V PA1.