 class BitBangedSPI {
 public:
   void begin() {
-    digitalWrite(SCK, LOW);
-    digitalWrite(MOSI, LOW);
-    pinMode(SCK, OUTPUT);
-    pinMode(MOSI, OUTPUT);
-    pinMode(MISO, INPUT);
+    digitalWrite(PIN_SCK, LOW);
+    digitalWrite(PIN_MOSI, LOW);
+    pinMode(PIN_SCK, OUTPUT);
+    pinMode(PIN_MOSI, OUTPUT);
+    pinMode(PIN_MISO, INPUT);
   }
 
   void beginTransaction(SPISettings settings) {

//
// Pin 10 is used to reset the target microcontroller.
//
// The MISO, MOSI and SCK pins are used to communicate with the target,
// on all Arduinos, these pins can be found on the ICSP header:
//
//               MISO °. . 5V (!) Avoid this pin on Due, Zero...
//               SCK   . . MOSI


  // See avr datasheets, chapter "SERIAL_PRG Programming Algorithm":

  // Pulse RESET after PIN_SCK is low:
  digitalWrite(PIN_SCK, LOW);
  delay(20); // discharge PIN_SCK, value arbitrally chosen
  reset_target(false);
  // Pulse must be minimum 2 target CPU clock cycles
  // so 100 usec is ok for CPU speeds above 20KHz
