SN74LV245A as level shifter: How to use the DIR pin

The DIR pin on the SN74LV245A defines whether the A pins or the B pins are the input pins.