123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #ifndef __STM8S_ITC_H
- #define __STM8S_ITC_H
- #include "stm8s.h"
- typedef enum {
- ITC_IRQ_TLI = (uint8_t)0,
- ITC_IRQ_AWU = (uint8_t)1,
- ITC_IRQ_CLK = (uint8_t)2,
- ITC_IRQ_PORTA = (uint8_t)3,
- ITC_IRQ_PORTB = (uint8_t)4,
- ITC_IRQ_PORTC = (uint8_t)5,
- ITC_IRQ_PORTD = (uint8_t)6,
- ITC_IRQ_PORTE = (uint8_t)7,
-
- #if defined(STM8S208) || defined(STM8AF52Ax)
- ITC_IRQ_CAN_RX = (uint8_t)8,
- ITC_IRQ_CAN_TX = (uint8_t)9,
- #endif
- #if defined(STM8S903) || defined(STM8AF622x)
- ITC_IRQ_PORTF = (uint8_t)8,
- #endif
- ITC_IRQ_SPI = (uint8_t)10,
- ITC_IRQ_TIM1_OVF = (uint8_t)11,
- ITC_IRQ_TIM1_CAPCOM = (uint8_t)12,
-
- #if defined(STM8S903) || defined(STM8AF622x)
- ITC_IRQ_TIM5_OVFTRI = (uint8_t)13,
- ITC_IRQ_TIM5_CAPCOM = (uint8_t)14,
- #else
- ITC_IRQ_TIM2_OVF = (uint8_t)13,
- ITC_IRQ_TIM2_CAPCOM = (uint8_t)14,
- #endif
- ITC_IRQ_TIM3_OVF = (uint8_t)15,
- ITC_IRQ_TIM3_CAPCOM = (uint8_t)16,
- #if defined(STM8S208) ||defined(STM8S207) || defined (STM8S007) || defined(STM8S103) || \
- defined(STM8S003) ||defined(STM8S903) || defined (STM8AF52Ax) || defined (STM8AF62Ax)
- ITC_IRQ_UART1_TX = (uint8_t)17,
- ITC_IRQ_UART1_RX = (uint8_t)18,
- #endif
- #if defined(STM8AF622x)
- ITC_IRQ_UART4_TX = (uint8_t)17,
- ITC_IRQ_UART4_RX = (uint8_t)18,
- #endif
-
- ITC_IRQ_I2C = (uint8_t)19,
-
- #if defined(STM8S105) || defined(STM8S005) || defined(STM8AF626x)
- ITC_IRQ_UART2_TX = (uint8_t)20,
- ITC_IRQ_UART2_RX = (uint8_t)21,
- #endif
- #if defined(STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8AF52Ax) || defined(STM8AF62Ax)
- ITC_IRQ_UART3_TX = (uint8_t)20,
- ITC_IRQ_UART3_RX = (uint8_t)21,
- ITC_IRQ_ADC2 = (uint8_t)22,
- #endif
- #if defined(STM8S105) || defined(STM8S005) || defined(STM8S103) || defined(STM8S003) || defined(STM8S903) || defined(STM8AF626x) || defined(STM8AF622x)
- ITC_IRQ_ADC1 = (uint8_t)22,
- #endif
- #if defined(STM8S903) || defined(STM8AF622x)
- ITC_IRQ_TIM6_OVFTRI = (uint8_t)23,
- #else
- ITC_IRQ_TIM4_OVF = (uint8_t)23,
- #endif
- ITC_IRQ_EEPROM_EEC = (uint8_t)24
- } ITC_Irq_TypeDef;
- typedef enum {
- ITC_PRIORITYLEVEL_0 = (uint8_t)0x02,
- ITC_PRIORITYLEVEL_1 = (uint8_t)0x01,
- ITC_PRIORITYLEVEL_2 = (uint8_t)0x00,
- ITC_PRIORITYLEVEL_3 = (uint8_t)0x03
- } ITC_PriorityLevel_TypeDef;
- #define CPU_SOFT_INT_DISABLED ((uint8_t)0x28)
- #define IS_ITC_IRQ_OK(IRQ) ((IRQ) <= (uint8_t)24)
- #define IS_ITC_PRIORITY_OK(PriorityValue) \
- (((PriorityValue) == ITC_PRIORITYLEVEL_0) || \
- ((PriorityValue) == ITC_PRIORITYLEVEL_1) || \
- ((PriorityValue) == ITC_PRIORITYLEVEL_2) || \
- ((PriorityValue) == ITC_PRIORITYLEVEL_3))
- #define IS_ITC_INTERRUPTS_DISABLED (ITC_GetSoftIntStatus() == CPU_SOFT_INT_DISABLED)
- uint8_t ITC_GetCPUCC(void);
- void ITC_DeInit(void);
- uint8_t ITC_GetSoftIntStatus(void);
- void ITC_SetSoftwarePriority(ITC_Irq_TypeDef IrqNum, ITC_PriorityLevel_TypeDef PriorityValue);
- ITC_PriorityLevel_TypeDef ITC_GetSoftwarePriority(ITC_Irq_TypeDef IrqNum);
- #endif
|