Using the Hat Carrier with H7

Sorry, I am guessing, that all of this has been covered before and I am just not finding it.

I have been playing around with the Arduino GIGA board and was curious if the H7 Portenta code base and the like was more mature, in some of the areas that I have been investigating on the GIGA.

Things like USB Host (and device),SD Cards, SPI, DMA, Hardware Serial and the like. Along with the Portenta H7 I also purchased a Hat Carrier, as it was the cheapest and has breakouts for most of things I am curious to play with.

First thing I am running into is, How do you map the pin labels on the HAT to what the Arduino pin number is to control it? (or Pin Name)

Example:

How do you map these 20 pins to the Arduino pin numbers.

Note: I have done most of it, by extracting some of the tables from the HAT PDF that shows the PIN numbers of the connectors along with the high denity pin number, and then extracted from the the Portenta H7 PDF what the high density pins go to which Port/Pin on processor, and then at variant.cpp to map those to Arduino pin numbers

And have many of them now in excel:

Pin number Arduino Pin Port Pin Silkscreen Power Net Portenta HD Standard Pin High-Density Pin Interface
PH01 15 PA0_C A0 ANALOG_A0 J2-73
PH02 16 PA1_C A1 ANALOG_A1 J2-75
RPI29 13 PA10 RX1 SERIAL1_RX J1-35 UART 1 RX
PH03 17 PA2_C A2 ANALOG_A2 J2-77
PH04 18 PA3_C A3 ANALOG_A3 J2-79
PH07 21 PA4 A6 ANALOG_A6 J2-78
PH08 22 PA6 A7 ANALOG_A7 J2-80
RPI07 6 PA8 PWM0 PWM_0 J2-59
RPI32 14 PA9 TX1 SERIAL1_TX J1-33 UART 1 TX
RPI35 PB9 I2S WS I2S_WS J1-58 I2S WS
PH12 PC13 PWM4 GPIO_0 J2-46
PH05 19 PC2 A4 ANALOG_A4 J2-74
RPI21 10 PC2 SPI1 CIPO SPI1_MISO J2-40 SPI 1
MISO
PH06 20 PC3 A5 ANALOG_A5 J2-76
RPI19 8 PC3 SPI1 COPI SPI1_MOSI J2-42 SPI 1
MOSI
RPI22 5 PC6 PWM1 PWM_1 J2-61
RPI26 4 PC7 PWM2 PWM_2 J2-63
RPI12 PD3 I2S CK I2S_CK J1-56 I2S CK
RPI11 PD4 GPIO2 GPIO2 J2-50
RPI13 PG10 GPIO6 GPIO_6 J2-58
PH14 PG14 TX2 SERIAL2_TX J2-26 UART 2 TX
RPI31 3 PG7 PWM3 PWM_3 J2-65
PH16 PG9 RX2 SERIAL2_RX J2-28 UART 2 RX
RPI05 PH11 I2C2 SCL I2C2_SCL J2-47 I2C 2 SCL
RPI03 PH12 I2C2 SDA J2-45 I2C 2 SDA
RPI37 0 PH15 PWM6 PWM_6 J2-62
RPI28 PH7 I2C0 SCL I2C0_SCL J1-46 I2C 0 SCL
RPI27 11 PH8 I2C0 SDA I2C0_SDA J1-44 I2C 0 SDA
RPI24 7 PI0 SPI1 CE SPI1_CS J2-36 SPI 1 CS
RPI23 9 PI1 SPI1 SCK SPI1_CK J2-38 SPI 1 CK
RPI38 PI2 I2S SDI I2S_SDI J1-60 I2S SDI
RPI40 PI3 I2S SDO I2S_SDO J1-62 I2S SDO
RPI16 PI5 SAI CK SAI_CK J2-49 SAI CK
RPI15 PI6 SAI D0 SAI_D0 J2-53 SAI D0
RPI18 12 PI7 SAI FS SAI_FS J2-51 SAI FS
PH10 PJ10 PWM8 PWM_8 J2-66
RPI33 2 PJ11 PWM4 PWM_4 J2-67
PH09 PJ7 PWM7 PWM_7 J2-64
RPI08 SERIAL3_TX PJ8 TX3 SERIAL3_TX J2-25 UART 3 TX
RPI10 SERIAL3_RX PJ9 RX3 SERIAL3_RX J2-27 UART 3 RX
RPI36 1 PK1 PWM5 PWM_5 J2-60
PH11 LICELL LICELL J2-7 RTC Power
Source

Where the first column starting with PH is the Pin Header, and RPI is the 40 pin connector... There are still several of the RPI pins that don't easily direct back to an Arduino pin number. Yes I know in many cases like pinMode, you can use pin names, but for example suppose I am porting my GIGA version of the ILI9341 display driver to this board, and which to use an Adafruit ILI9341 display, which has the old RPI2 26 pin type connector and use the pins like:
image

Luckily I think the CS and DC pins are actually on pins I have pin numbers for, but otherwise,
I would probably need to compute one:

Like the first blank one has pin name PB9 So might work with current tables like:
26 + 16*1 + 9 or 51... for after the first 26 entries, there are entries for A0-A15, B0-B15, C....

But is this what everyone does? Or is there some other table or picture that simply shows for each of the Standard Arduino Hats/breakout boards, These are the pins for this processor...

Just wondering.

Again just getting started...

Then it is off to seeing if this uses the same library for USBHost as the GIGA? I think so, and does it have the same problems and limitations? For example, does not use DMA, Probably does not support USB LS (without using my fork/branch), ...

Will be interesting to see if it is easier to debug on this board?

Now back to playing