1#ifndef STC15_INTERRUPTSH
2#define STC15_INTERRUPTSH
108#define enable_mcu_interrupts() (EA = 1)
119#define disable_mcu_interrupts() (EA = 0)
128#define is_mcu_interrupts_enabled() (EA == 1)
137#define enable_low_voltage_interrupt() (ELVD = 1)
146#define disable_low_voltage_interrupt() (ELVD = 0)
156#define is_low_voltage_interrupt_enabled() (ELVD == 1 && is_mcu_interrupts_enabled())
165#define enable_adc_interrupt() (EADC = 1)
174#define disable_adc_interrupt() (EADC = 0)
184#define is_adc_interrupt_enabled() (EADC == 1 && is_mcu_interrupts_enabled())
193#define enable_uart1_interrupt() (ES = 1)
202#define disable_uart1_interrupt() (ES = 0)
212#define is_uart1_interrupt_enabled() (ES == 1 && is_mcu_interrupts_enabled())
221#define enable_int0_interrupt() (EX0 = 1)
230#define disable_int0_interrupt() (EX0 = 0)
240#define is_int0_interrupt_enabled() (EX0 == 1 && is_mcu_interrupts_enabled())
249#define enable_int1_interrupt() (EX1 = 1)
258#define disable_int1_interrupt() (EX1 = 0)
268#define is_int1_interrupt_enabled() (EX1 == 1 && is_mcu_interrupts_enabled())
277#define enable_int2_interrupt() (bit_set(INT_CLKO, SBIT4))
286#define disable_int2_interrupt() (bit_clr(INT_CLKO, CBIT4))
296#define is_int2_interrupt_enabled() (test_if_bit_set(INT_CLKO, SBIT4) && is_mcu_interrupts_enabled())
305#define enable_int3_interrupt() (bit_set(INT_CLKO, SBIT5))
314#define disable_int3_interrupt() (bit_clr(INT_CLKO, CBIT5))
324#define is_int3_interrupt_enabled() (test_if_bit_set(INT_CLKO, SBIT5) && is_mcu_interrupts_enabled())
333#define enable_int4_interrupt() (bit_set(INT_CLKO, SBIT6))
342#define disable_int4_interrupt() (bit_clr(INT_CLKO, CBIT6))
352#define is_int4_interrupt_enable() (test_if_bit_set(INT_CLKO, SBIT6) && is_mcu_interrupts_enabled())
361#define enable_timer0_interrupt() (ET0 = 1)
370#define disable_timer0_interrupt() (ET0 = 0)
380#define is_timer0_interrupt_enabled() (ET0 == 0 && is_mcu_interrupts_enabled())
389#define enable_timer2_interrupt() (bit_set(IE2, SBIT2))
398#define disable_timer2_interrupt() (bit_clr(IE2, CBIT2))
408#define is_timer2_interrupt_enabled() (test_if_bit_set(IE2, SBIT2) && is_mcu_interrupts_enabled())
417#define enable_spi_interrupt() (bit_set(IE2, SBIT1))
426#define disable_spi_interrupt() (bit_clr(IE2, CBIT1))
436#define is_spi_interrupt_enabled() (test_if_bit_set(IE2, SBIT1) && is_mcu_interrupts_enabled())
445#define set_pca_interrupt_priority(priority) (PPCA = priority)
454#define get_pca_interrupt_priority() (PPCA)
463#define set_low_voltage_interrupt_priority(priority) (PLVD = priority)
472#define get_low_voltage_interrupt_priority() (PVLD)
481#define set_adc_interrupt_priority(priority) (PADC = priority)
490#define get_adc_interrupt_priority() (PADC)
498#define set_uart1_interrupt_priority(priority) (PS = priority)
507#define get_uart1_interrupt_priority() (PS)
515#define set_int0_interrupt_priority(priority) (PX0 = priority)
524#define get_int0_interrupt_priority() (PX0)
533#define set_int1_interrupt_priority(priority) (PX1 = priority)
542#define get_int1_interrupt_priority() (PX1)
551#define set_timer0_interrupt_priority(priority) (PT0 = priority)
560#define get_timer0_interrupt_priority() (PT0)
569#define set_spi_interrupt_priority(priority) (priority == HIGH ? bit_set(IP2, SBIT1) : bit_clr(IP2, CBIT1))
578#define get_spi_interrupt_priority() (test_if_bit_set(IP2, SBIT1))
587#define set_int0_interrupt_trigger(trigger) ( IT0 = trigger)
597#define get_int0_interrupt_trigger() (IT0)
606#define set_int1_interrupt_trigger(trigger) (IT1 = trigger)
616#define get_int1_interrupt_trigger() (IT1)
external_interrupt_trigger_t
Definition: interrupt.h:92
interrupt_priority_t
Definition: interrupt.h:79
@ ONLY_FALLING_EDGE
Generate interrupt only on fallign edge.
Definition: interrupt.h:96
@ RAISING_OR_FALLING_EDGE
Generate interrupt on both raise and falling edges.
Definition: interrupt.h:94
@ HIGH
High priority.
Definition: interrupt.h:83
@ LOW
Low priority.
Definition: interrupt.h:81