#ifndef IO_H #define IO_H #include #include /* * Macros */ #define PIN(x) (*(&x - 2)) // Address Of Data Direction Register Of Port x #define DDR(x) (*(&x - 1)) // Address Of Input Register Of Port x /* * Outputs */ #define PORT_BOLZEN PORTB #define PIN_BOLZEN PB0 #define PORT_SCHNAPPER PORTB #define PIN_SCHNAPPER PB1 #define PORT_STATUS PORTB #define PIN_STATUS PB2 /* * Inputs */ #define PORT_BUTTON_LOCK PORTD #define PIN_BUTTON_LOCK PD2 #define PORT_BUTTON_UNLOCK PORTD #define PIN_BUTTON_UNLOCK PD3 #define PORT_EMERGENCY_UNLOCK PORTD #define PIN_EMERGENCY_UNLOCK PD4 static inline bool is_emergency_unlock(void) { return !(PIN(PORT_EMERGENCY_UNLOCK) & (1<