source code for shiftin() function

Hi,

Where could I find the source code for shiftin() function?

Thanks

It’s in “wiring_shift.c”

#include "wiring_private.h"

 

uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) {

 uint8_t value = 0;

 uint8_t i;

 for (i = 0; i < 8; ++i) {

 digitalWrite(clockPin, HIGH);

 if (bitOrder == LSBFIRST)

 value |= digitalRead(dataPin) << i;

 else

 value |= digitalRead(dataPin) << (7 - i);

 digitalWrite(clockPin, LOW);

 }

 return value;

}