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

Function pinModeFlagsDevice

wiringPi/wiringPi.c:1941–1964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1939}
1940
1941void pinModeFlagsDevice (int pin, int mode, const unsigned int flags) {
1942 unsigned int lflag = flags;
1943 if (wiringPiDebug) {
1944 printf ("pinModeFlagsDevice: pin:%d mode:%d, flags: %u\n", pin, mode, flags) ;
1945 }
1946 lflag &= ~(WPI_FLAG_INPUT | WPI_FLAG_OUTPUT);
1947 switch(mode) {
1948 default:
1949 fprintf(stderr, "pinMode: invalid mode request (only input und output supported)\n");
1950 return;
1951 case INPUT:
1952 lflag |= WPI_FLAG_INPUT;
1953 break;
1954 case OUTPUT:
1955 lflag |= WPI_FLAG_OUTPUT;
1956 break;
1957 case PM_OFF:
1958 pinModeFlagsDevice(pin, INPUT, 0);
1959 releaseLine(pin);
1960 return;
1961 }
1962
1963 requestLineV2(pin, lflag);
1964}
1965
1966void pinModeDevice (int pin, int mode) {
1967 pinModeFlagsDevice(pin, mode, lineFlags[pin]);

Callers 2

pinModeDeviceFunction · 0.85
pullUpDnControlDeviceFunction · 0.85

Calls 2

releaseLineFunction · 0.85
requestLineV2Function · 0.85

Tested by

no test coverage detected