MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / ToBCMPin

Function ToBCMPin

wiringPi/wiringPi.c:680–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678
679
680int ToBCMPin(int* pin) {
681 if (*pin<0 || *pin>63) {
682 return FALSE;
683 }
684 switch(wiringPiMode) {
685 case WPI_MODE_PINS:
686 *pin = pinToGpio[*pin];
687 break;
688 case WPI_MODE_PHYS:
689 *pin = physToGpio[*pin];
690 break;
691 case WPI_MODE_GPIO:
692 return TRUE;
693 default:
694 return FALSE;
695 }
696 if (piRP1Model() && *pin>27) {
697 return FALSE;
698 }
699 return TRUE;
700}
701
702
703#define RETURN_ON_MODEL5 if (piRP1Model()) { if (wiringPiDebug) printf("Function not supported on Pi5\n"); return; }

Callers 8

setPadDrivePinFunction · 0.85
getAltFunction · 0.85
gpioClockSetFunction · 0.85
pinModeAltFunction · 0.85
pwmWriteFunction · 0.85
waitForInterrupt2Function · 0.85
wiringPiISRStopFunction · 0.85
wiringPiISRInternalFunction · 0.85

Calls 1

piRP1ModelFunction · 0.85

Tested by

no test coverage detected