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

Function myPinMode

wiringPi/pcf8574.c:44–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 */
43
44static void myPinMode (struct wiringPiNodeStruct *node, int pin, int mode)
45{
46 int bit, old ;
47
48 bit = 1 << ((pin - node->pinBase) & 7) ;
49
50 old = node->data2 ;
51 if (mode == OUTPUT)
52 old &= (~bit) ; // Write bit to 0
53 else
54 old |= bit ; // Write bit to 1
55
56 wiringPiI2CWrite (node->fd, old) ;
57 node->data2 = old ;
58}
59
60
61

Callers

nothing calls this directly

Calls 1

wiringPiI2CWriteFunction · 0.85

Tested by

no test coverage detected