I have I2C connected to an Itsy Bitsy M0. I want to use 5 consecutive pins for switches. I want to address the port as 8bits and mask the bits I am interested in. I currently have pins A0, A1, A2, A3 and A4 for switch inputs (in my mind anyway). Defining each as pullup, switch goes to ground.
What is the port name in the IDE such that I can read the A pins? On Nano you can do PIND which is the upper 8bits of portB.
I suggest you look at the implementation of digitalRead() in Adafruit's SAMD21 Arduino core (in wiring_digital.c). It would also be good to look at the SAMD21 datasheet to learn which processor GPIO pins belong to which GPIO register. Finally, check the Adafruit board's schematic to see which processor GPIO pins map to which "Arduino" pins.
Ports on the SAMD21 are 32bits wide...
A1, A2, and A5 on on PortB: PORT->Group[1].IN.reg (bits 8, 9, and 2)
A0, A3, and A4 are on PortA: PORT->Group[0].IN.reg (bits 2, 4, and 5)
On SAMD, reading the ports directly does not have as much of an advantage as on an AVR. (reading directly is slower (~3 instructions), and digitalRead() is faster.)
On Nano you can do PIND which is the upper 8bits of portB.
On Nano, the Analog pins are on PINC, which is ... portC. Unless you meant the Nano Every, which has some pins on portD and some on portF.