27 #if defined(__AVR__) && !defined(ARDUINO) 29 #if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) 36 #elif defined(__AVR_ATmega328P__) 44 static uint8_t s_stub;
46 #define G0_PORT s_stub 48 #define G1_PORT s_stub 50 #define G2_PORT s_stub 53 void digitalWrite(
int pin,
int level)
55 uint8_t mask = (1<<(pin & 0x7));
58 if (level == HIGH) G0_PORT |= mask;
else G0_PORT &= ~mask;
62 if (level == HIGH) G1_PORT |= mask;
else G1_PORT &= ~mask;
66 if (level == HIGH) G2_PORT |= mask;
else G2_PORT &= ~mask;
70 void pinMode(
int pin,
int mode)
72 uint8_t mask = (1<<(pin & 0x7));
75 if (mode == OUTPUT) G0_DIR |= mask;
else G0_DIR &= ~mask;
79 if (mode == OUTPUT) G1_DIR |= mask;
else G1_DIR &= ~mask;
83 if (mode == OUTPUT) G2_DIR |= mask;
else G2_DIR &= ~mask;