STC15W408AS library 0.9.0
Macros | Enumerations
interrupt.h File Reference
#include <stdbool.h>
#include <sys.h>
#include <bits.h>
Include dependency graph for interrupt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define enable_mcu_interrupts()   (EA = 1)
 Enable interrupts support of MCU. More...
 
#define disable_mcu_interrupts()   (EA = 0)
 Disable interrupts support of MCU. More...
 
#define is_mcu_interrupts_enabled()   (EA == 1)
 
#define enable_low_voltage_interrupt()   (ELVD = 1)
 Enable low voltage interrupt. More...
 
#define disable_low_voltage_interrupt()   (ELVD = 0)
 Disable low voltage interrupt. More...
 
#define is_low_voltage_interrupt_enabled()   (ELVD == 1 && is_mcu_interrupts_enabled())
 Get low voltage interrupt enable status. More...
 
#define enable_adc_interrupt()   (EADC = 1)
 Enable ADC interrupt. More...
 
#define disable_adc_interrupt()   (EADC = 0)
 Disable ADC interrupt. More...
 
#define is_adc_interrupt_enabled()   (EADC == 1 && is_mcu_interrupts_enabled())
 Get ADC interrupt enable status. More...
 
#define enable_uart1_interrupt()   (ES = 1)
 Enable UART1 interrupt. More...
 
#define disable_uart1_interrupt()   (ES = 0)
 Disable UART1 interrupt. More...
 
#define is_uart1_interrupt_enabled()   (ES == 1 && is_mcu_interrupts_enabled())
 Get UART1 interrupt enable status. More...
 
#define enable_int0_interrupt()   (EX0 = 1)
 Enable INT0 interrupt. More...
 
#define disable_int0_interrupt()   (EX0 = 0)
 Disable INT0 interrupt. More...
 
#define is_int0_interrupt_enabled()   (EX0 == 1 && is_mcu_interrupts_enabled())
 Get INT0 interrupt enable status. More...
 
#define enable_int1_interrupt()   (EX1 = 1)
 Enable INT1 interrupt. More...
 
#define disable_int1_interrupt()   (EX1 = 0)
 Disable INT1 interrupt. More...
 
#define is_int1_interrupt_enabled()   (EX1 == 1 && is_mcu_interrupts_enabled())
 Get INT1 interrupt enable status. More...
 
#define enable_int2_interrupt()   (bit_set(INT_CLKO, SBIT4))
 Enable INT2 interrupt. More...
 
#define disable_int2_interrupt()   (bit_clr(INT_CLKO, CBIT4))
 Disable INT2 interrupt. More...
 
#define is_int2_interrupt_enabled()   (test_if_bit_set(INT_CLKO, SBIT4) && is_mcu_interrupts_enabled())
 Get INT2 interrupt enable status. More...
 
#define enable_int3_interrupt()   (bit_set(INT_CLKO, SBIT5))
 Enable INT3 interrupt. More...
 
#define disable_int3_interrupt()   (bit_clr(INT_CLKO, CBIT5))
 Disable INT3 interrupt. More...
 
#define is_int3_interrupt_enabled()   (test_if_bit_set(INT_CLKO, SBIT5) && is_mcu_interrupts_enabled())
 Get INT3 interrupt enable status. More...
 
#define enable_int4_interrupt()   (bit_set(INT_CLKO, SBIT6))
 Enable INT4 interrupt. More...
 
#define disable_int4_interrupt()   (bit_clr(INT_CLKO, CBIT6))
 Disable INT3 interrupt. More...
 
#define is_int4_interrupt_enable()   (test_if_bit_set(INT_CLKO, SBIT6) && is_mcu_interrupts_enabled())
 Get INT4 interrupt enable status. More...
 
#define enable_timer0_interrupt()   (ET0 = 1)
 Enable timer0 interrupt. More...
 
#define disable_timer0_interrupt()   (ET0 = 0)
 Enable timer0 interrupt. More...
 
#define is_timer0_interrupt_enabled()   (ET0 == 0 && is_mcu_interrupts_enabled())
 Get timer0 interrupt enable status. More...
 
#define enable_timer2_interrupt()   (bit_set(IE2, SBIT2))
 Enable timer2 interrupt. More...
 
#define disable_timer2_interrupt()   (bit_clr(IE2, CBIT2))
 Disable timer2 interrupt. More...
 
#define is_timer2_interrupt_enabled()   (test_if_bit_set(IE2, SBIT2) && is_mcu_interrupts_enabled())
 Get timer2 interrupt enable status. More...
 
#define enable_spi_interrupt()   (bit_set(IE2, SBIT1))
 Enable SPI interrupt. More...
 
#define disable_spi_interrupt()   (bit_clr(IE2, CBIT1))
 Disable SPI interrupt. More...
 
#define is_spi_interrupt_enabled()   (test_if_bit_set(IE2, SBIT1) && is_mcu_interrupts_enabled())
 Get SPI interrupt enable status. More...
 
#define set_pca_interrupt_priority(priority)   (PPCA = priority)
 Set programmable counter arrya (PCA) interrupt priority. More...
 
#define get_pca_interrupt_priority()   (PPCA)
 Get programmable counter arrya (PCA) interrupt priority. More...
 
#define set_low_voltage_interrupt_priority(priority)   (PLVD = priority)
 Set low voltage (LVD) interrupt priority. More...
 
#define get_low_voltage_interrupt_priority()   (PVLD)
 Get low voltage interrupt (LVD) priority. More...
 
#define set_adc_interrupt_priority(priority)   (PADC = priority)
 Set analog to digital converter (ADC) interrupt priority. More...
 
#define get_adc_interrupt_priority()   (PADC)
 Get analog to digital converter (ADC) interrupt priority. More...
 
#define set_uart1_interrupt_priority(priority)   (PS = priority)
 Set UART1 interrupt priority. More...
 
#define get_uart1_interrupt_priority()   (PS)
 Get UART1 interrupt priority. More...
 
#define set_int0_interrupt_priority(priority)   (PX0 = priority)
 Set INT0 interrupt priority. More...
 
#define get_int0_interrupt_priority()   (PX0)
 Get INT0 interrupt priority. More...
 
#define set_int1_interrupt_priority(priority)   (PX1 = priority)
 Set INT1 interrupt priority. More...
 
#define get_int1_interrupt_priority()   (PX1)
 Get INT1 interrupt priority. More...
 
#define set_timer0_interrupt_priority(priority)   (PT0 = priority)
 Set timer0 interrupt priority. More...
 
#define get_timer0_interrupt_priority()   (PT0)
 Get timer0 interrupt priority. More...
 
#define set_spi_interrupt_priority(priority)   (priority == HIGH ? bit_set(IP2, SBIT1) : bit_clr(IP2, CBIT1))
 Set SPI interrupt priority. More...
 
#define get_spi_interrupt_priority()   (test_if_bit_set(IP2, SBIT1))
 Get SPI interrupt priority. More...
 
#define set_int0_interrupt_trigger(trigger)   ( IT0 = trigger)
 Set INT0 interrupt trigger. More...
 
#define get_int0_interrupt_trigger()   (IT0)
 Get INT0 interrupt trigger. More...
 
#define set_int1_interrupt_trigger(trigger)   (IT1 = trigger)
 Set INT1 interrupt trigger. More...
 
#define get_int1_interrupt_trigger()   (IT1)
 Get INT1 interrupt trigger. More...
 

Enumerations

enum  interrupt_priority_t { LOW = 0 , HIGH = 1 }
 
enum  external_interrupt_trigger_t { RAISING_OR_FALLING_EDGE = 0 , ONLY_FALLING_EDGE = 1 }