adafruit / ArduinoCore-samd

116 stars 119 forks source link

SercomUartTxPad enum is specific to SAMD21, incorrect for SAMD51 #368

Closed SRGDamia1 closed 2 months ago

SRGDamia1 commented 3 months ago

The enum for the UART Tx pad is only correct for a 21 device:

https://github.com/adafruit/ArduinoCore-samd/blob/ce20340620bfd9c545649ee5c4873888ee0475d0/cores/arduino/SERCOM.h#L92-L91

From the manual for the 51, only PAD0 is available for Tx and the other pins have different meaning depending on the value:

TXPO TxD Pin Location XCK Pin Location (When Applicable) RTS/TE CTS
0x0 SERCOM PAD[0] SERCOM PAD[1] N/A N/A
0x1 Reserved
0x2 SERCOM PAD[0] N/A SERCOM PAD[2] SERCOM PAD[3]
0x3 SERCOM_PAD[0] SERCOM_PAD[1] SERCOM_PAD[2] N/A
hathach commented 2 months ago

it is a shared enum and is fine as long as samd51 does not use that. Or maybe I miss something, can you elaborate what should be changed.