1、stm8S的中断向量表
/*----------------------------------------------------
* Interrupt vector numbers
*---------------------------------------------------*/
#define AWU_vector 0x03
#define CLK_CSS_vector 0x04
#define CLK_SWITCH_vector 0x04
#define beCAN_FMP_vector 0x0A
#define beCAN_FULL_vector 0x0A
#define beCAN_FOVR_vector 0x0A
#define beCAN_EWGF_vector 0x0B
#define beCAN_EPVF_vector 0x0B
#define beCAN_BOFF_vector 0x0B
#define beCAN_LEC0_vector 0x0B
#define beCAN_LEC1_vector 0x0B
#define beCAN_LEC2_vector 0x0B
#define beCAN_RQCP0_vector 0x0B
#define beCAN_RQCP1_vector 0x0B
#define beCAN_RQCP2_vector 0x0B
#define beCAN_WKUI_vector 0x0B
#define SPI_TXE_vector 0x0C
#define SPI_RXNE_vector 0x0C
#define SPI_WKUP_vector 0x0C
#define SPI_MODF_vector 0x0C
#define SPI_OVR_vector 0x0C
#define SPI_CRCERR_vector 0x0C
#define TIM1_OVR_UIF_vector 0x0D
#define TIM1_CAPCOM_BIF_vector 0x0D
#define TIM1_CAPCOM_TIF_vector 0x0D
#define TIM1_CAPCOM_CC1IF_vector 0x0E
#define TIM1_CAPCOM_CC2IF_vector 0x0E
#define TIM1_CAPCOM_CC3IF_vector 0x0E
#define TIM1_CAPCOM_CC4IF_vector 0x0E
#define TIM1_CAPCOM_COMIF_vector 0x0E
#define TIM2_OVR_UIF_vector 0x0F
#define TIM2_CAPCOM_TIF_vector 0x10
#define TIM2_CAPCOM_CC1IF_vector 0x10
#define TIM2_CAPCOM_CC2IF_vector 0x10
#define TIM2_CAPCOM_CC3IF_vector 0x10
#define TIM3_OVR_UIF_vector 0x11
#define TIM3_CAPCOM_TIF_vector 0x12
#define TIM3_CAPCOM_CC1IF_vector 0x12
#define TIM3_CAPCOM_CC2IF_vector 0x12
#define TIM3_CAPCOM_CC3IF_vector 0x12
#define UART1_T_TXE_vector 0x13
#define UART1_T_TC_vector 0x13
#define UART1_R_RXNE_vector 0x14
#define UART1_R_OR_vector 0x14
#define UART1_R_IDLE_vector 0x14
#define UART1_R_PE_vector 0x14
#define UART1_R_LBDF_vector 0x14
#define I2C_SB_vector 0x15
#define I2C_ADDR_vector 0x15
#define I2C_ADD10_vector 0x15
#define I2C_STOPF_vector 0x15
#define I2C_BTF_vector 0x15
#define I2C_WUFH_vector 0x15
#define I2C_RXNE_vector 0x15
#define I2C_TXE_vector 0x15
#define I2C_BERR_vector 0x15
#define I2C_ARLO_vector 0x15
#define I2C_AF_vector 0x15
#define I2C_OVR_vector 0x15
#define UART3_T_TXE_vector 0x16
#define UART3_T_TC_vector 0x16
#define UART3_R_RXNE_vector 0x17
#define UART3_R_OR_vector 0x17
#define UART3_R_IDLE_vector 0x17
#define UART3_R_PE_vector 0x17
#define UART3_R_LBDF_vector 0x17
#define UART3_R_LHDF_vector 0x17
#define ADC2_AWDG_vector 0x18
#define ADC2_EOC_vector 0x18
#define TIM4_OVR_UIF_vector 0x19
#define FLASH_EOP_vector 0x1A
#define FLASH_WR_PG_DIS_vector 0x1A
2、中断函数编写(IAR)
//**************************中断函数区域**************************
#pragma vector=0x05
__interrupt void EXTI_PORTA_IRQHandler(void)
{
}
#pragma vector=0x06
__interrupt void EXTI_PORTB_IRQHandler(void)
{
PB_CR2_C20=0;//禁止PB0端口外部中断
while(PB_IDR_IDR0==0);
delay(100);
LED=!LED;
delay(100);
PB_CR2_C20=1;//使能PB0端口外部中断
}
#pragma vector=0x07
__interrupt void EXTI_PORTC_IRQHandler(void)
{
}
#pragma vector=0x08
__interrupt void EXTI_PORTD_IRQHandler(void)
{
}
#pragma vector=0x09
__interrupt void EXTI_PORTE_IRQHandler(void)
{
}