hugllc/samc21_can

Change the constructor to take in the PIN_PXXX macros in the PIN #

Closed this issue · 0 comments

Well to keep the api oblivious to ports you could get the pins group from the wiring:
./wiring_digital.c: uint8_t pinPort = GetPort(ulPin);

Or keep the API the same, but either way you would have to convert the pin's absolute number to its group specific number, like digitalWrite does:
void digitalWrite( uint32_t ulPin, uint32_t ulVal )
{
uint8_t pinPort = GetPort(ulPin);
uint8_t pinNum = GetPin(ulPin);

Thanks again for your efforts.

Originally posted by @naprave in #1 (comment)