How to use digitalPinToPort() in sketch

What did you try, and what results did you get?

You can refer to the source to digitalRead/digitialWrite in wiring_digital.c to see how they are used.