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

Function wiringPiGpioDeviceGetFd

wiringPi/wiringPi.c:1772–1786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1770}
1771
1772int wiringPiGpioDeviceGetFd() {
1773 if (chipFd<0) {
1774 piBoard();
1775 if (piRP1Model()) {
1776 chipFd = OpenAndCheckGpioChip(0, "rp1", 54); // /dev/gpiochip0 @ Pi5 since Kernel 6.6.47
1777 if (chipFd<0) {
1778 chipFd = OpenAndCheckGpioChip(4, "rp1", 54); // /dev/gpiochip4 @ Pi5 with older kernel
1779 }
1780 } else {
1781 // not all Pis have same number of lines: Pi0, Pi1, Pi3, 54 lines, Pi4, 58 lines (CM ?), see #280, so this check is disabled
1782 chipFd = OpenAndCheckGpioChip(0, "bcm", 0);
1783 }
1784 }
1785 return chipFd;
1786}
1787
1788void releaseLine(int pin) {
1789

Callers 7

doVersionFunction · 0.85
requestLineV1Function · 0.85
waitForInterruptInitV1Function · 0.85
requestLineV2Function · 0.85
waitForInterrupt2Function · 0.85
interruptHandlerInitFunction · 0.85
wiringPiSetupGpioDeviceFunction · 0.85

Calls 3

piBoardFunction · 0.85
piRP1ModelFunction · 0.85
OpenAndCheckGpioChipFunction · 0.85

Tested by

no test coverage detected