10 pinMode(mosi_pin, OUTPUT);
11 pinMode(sck_pin, OUTPUT);
12 pinMode(miso_pin, INPUT_PULLUP);
13 #ifdef ARDUINO_ARCH_AVR
14 mosi_register = portOutputRegister(getPort(mosi_pin));
15 miso_register = portInputRegister(getPort(miso_pin));
16 sck_register = portOutputRegister(getPort(sck_pin));
17 mosi_bm = digitalPinToBitMask(mosi_pin);
18 miso_bm = digitalPinToBitMask(miso_pin);
19 sck_bm = digitalPinToBitMask(sck_pin);
28 for (uint8_t i=7 ; i>=1 ; i--) {
47 uint16_t returnVal = 0x0000;
48 returnVal |=
transfer((data>>8)&0xFF) << 8;
49 returnVal |=
transfer(data&0xFF) & 0xFF;