19 #ifndef HARDWARE_AVR_BOARD_H 20 #define HARDWARE_AVR_BOARD_H 28 #define GPIO_PIN(port,pin) (((port) << 4) | (pin)) 34 #define GPIO_REG(pin) ((pin) >> 4) 40 #define GPIO_MASK(pin) _BV((pin) & 0xf) 43 #define GPIO_ATOMIC_MAX GPIO_PIN(0x40,0) 51 #define GPIO_ATOMIC(expr) \ 53 if (PIN < GPIO_ATOMIC_MAX) { \ 57 uint8_t sreg = SREG; \ 58 __asm__ __volatile__("cli" ::: "memory"); \ 61 __asm__ __volatile__("" ::: "memory"); \ 65 #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) 136 #elif defined(__AVR_ATmega32U4__) 223 #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) 359 #elif defined(__AVR_ATtiny24__) \ 360 || defined(__AVR_ATtiny44__) \ 361 || defined(__AVR_ATtiny84__) 399 #elif defined(__AVR_ATtiny25__) \ 400 || defined(__AVR_ATtiny45__) \ 401 || defined(__AVR_ATtiny85__) 432 #error Board.h: avr mcu not supported
#define GPIO_PIN(port, pin)
SPI Master Input Slave Output.
SPI Master Output Slave Input.