Pin numbers don't match b/w datasheet and variant.h!

The pin number in the variant file is the Arduino pin number. This is just an arbitrary identifier number assigned to each pin that makes it easy to use, e.g.:

digitalWrite(20, HIGH);

sets pin PA22 HIGH.

The Arduino pin number itself doesn't mean anything.

I'm guessing the datasheet you're referring to is the manufacturer's datasheet for the microcontroller? If so then the pin number you're seeing listed there is likely the physical pin number on the chip, which is completely different from the Arduino pin number. If you think about it a little bit you'll see why, it would not be practical for Arduino pin numbers to match physical pin numbers, since every physical pin is numbered rather than just the I/O pins.