#pragma once #ifndef __AVR__ #error This FastPin Lib works only with Atmel AVR #endif #ifdef ARDUINO #include #else #include #include #include #endif // manche AVR beherrschen en schnelles toggeln von Pins, siehe Datenblatt // die Liste ist unvollständig #if defined(__AVR_ATmega328P__) | defined(__AVR_ATmega328__) | \ defined(__AVR_ATmega168P__) | defined(__AVR_ATmega168__) | \ defined(__AVR_ATmega32U4__) | \ defined(__AVR_ATtiny85__) | defined(__AVR_ATtiny45__) | defined(__AVR_ATtiny25__) #define FAST_TOGGLE #endif #define PARAMETERLIST \ volatile __attribute__((unused)) uint8_t * DDR , \ volatile __attribute__((unused)) uint8_t * PORT, \ volatile __attribute__((unused)) uint8_t * PIN , \ uint8_t pin /* * Benutzung: Pin für die spätere Verwendung deklarieren * #define BuildInLED PINDEF(B,5) // die LED auf einem Arduino UNO */ #define PINDEF(PORTNR,PINNR) &DDR##PORTNR,&PORT##PORTNR,&PIN##PORTNR,PINNR static inline void setPin(PARAMETERLIST) { *PORT |= (1<