Arduino/include/interrupt.h

18 lines
428 B
C

//
// Created by servostar on 27.10.23.
//
#ifndef ARDUINO_INTERRUPT_H
#define ARDUINO_INTERRUPT_H
#define LOW 0b00
#define CHANGE 0b01
#define FALLING 0b10
#define RISING 0b11
#define SET_INTERRUPT_MODE(index, mode) EICRA = (EICRA & (252 << (index) * 2)) | (mode) << (index) * 2
#define ENABLE_INTERRUPT(index) SET_BIT(EIMSK, index)
#define DISABLE_INTERRUPT(index) CLR_BIT(EIMSK, index)
#endif //ARDUINO_INTERRUPT_H