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

Function digitalWriteByte

wiringPi/wiringPi.c:2533–2561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2531 */
2532
2533void digitalWriteByte (const int value)
2534{
2535 uint32_t pinSet = 0 ;
2536 uint32_t pinClr = 0 ;
2537 int mask = 1 ;
2538 int pin ;
2539
2540 FailOnModel5("digitalWriteByte");
2541
2542 if (wiringPiMode == WPI_MODE_GPIO_SYS)
2543 {
2544 return ;
2545 }
2546 else
2547 {
2548 for (pin = 0 ; pin < 8 ; ++pin)
2549 {
2550 if ((value & mask) == 0)
2551 pinClr |= (1 << pinToGpio [pin]) ;
2552 else
2553 pinSet |= (1 << pinToGpio [pin]) ;
2554
2555 mask <<= 1 ;
2556 }
2557
2558 *(gpio + gpioToGPCLR [0]) = pinClr ;
2559 *(gpio + gpioToGPSET [0]) = pinSet ;
2560 }
2561}
2562
2563unsigned int digitalReadByte (void)
2564{

Callers 3

doWriteByteFunction · 0.85
sendDataFunction · 0.85
ledPercentFunction · 0.85

Calls 1

FailOnModel5Function · 0.85

Tested by

no test coverage detected