+ #ifndef __ASSEMBLER__
+ #include <avr/io.h>
+ #endif
+ #define PORT_SHIFTER 4 // this may be 4 for all AVR chips
+
+ // If you want to add more to this list, reference the PINx definitions in these header
+ // files: https://github.com/vancegroup-mirrors/avr-libc/tree/master/avr-libc/include/avr
+
+ #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
+ #define ADDRESS_BASE 0x00
+ #define PINB_ADDRESS 0x3
+ #define PINC_ADDRESS 0x6
+ #define PIND_ADDRESS 0x9
+ #define PINE_ADDRESS 0xC
+ #define PINF_ADDRESS 0xF
+ #elif defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__)
+ #define ADDRESS_BASE 0x00
+ #define PINB_ADDRESS 0x3
+ #define PINC_ADDRESS 0x6
+ #define PIND_ADDRESS 0x9
+ #elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__)
+ #define ADDRESS_BASE 0x00
+ #define PINA_ADDRESS 0x0
+ #define PINB_ADDRESS 0x3
+ #define PINC_ADDRESS 0x6
+ #define PIND_ADDRESS 0x9
+ #define PINE_ADDRESS 0xC
+ #define PINF_ADDRESS 0xF
+ #elif defined(__AVR_ATmega32A__)
+ #define ADDRESS_BASE 0x10
+ #define PIND_ADDRESS 0x0
+ #define PINC_ADDRESS 0x3
+ #define PINB_ADDRESS 0x6
+ #define PINA_ADDRESS 0x9
+ #elif defined(__AVR_ATmega328P__)
+ #define ADDRESS_BASE 0x00
+ #define PINB_ADDRESS 0x3
+ #define PINC_ADDRESS 0x6
+ #define PIND_ADDRESS 0x9
+ #else
+ #error "Pins are not defined"
+ #endif
+