本帖最后由 yzzly 于 2010-5-25 16:26 编辑
过去接触的NXP的ARM和TI的2812都有个向量寄存器存放中断服务函数的入口地址,例如:
LPC2131
VICIntSelect=VICIntSelect&(~(1<<Int_uart0));
VICVectCntl3=Enable_Uart0|Int_uart0;//向量控制寄存器1,b5=1向量IRQ使能,0x06是UART0中断通道号,UART0的优先级是3
VICVectAddr3=(uint32)IRQ_Uart0; //向量地址寄存器,存放UART0中断服务程序入口地址
VICIntEnable=VICIntEnable|(1<<Int_uart0);//中断允许寄存器,每一位对应一个中断源,0x06允许UART0中断,写入0无效
TMS320F2812
PieVectTable.RXAINT =&SCIARX_ISR;
PieCtrl.PIEIER9.bit.INTx1 =1; //允许SCIA接收中断
PieVectTable.TXAINT =&SCIATX_ISR;
PieCtrl.PIEIER9.bit.INTx2 =1; //允许SCIA发送中断
请问香主,
typedef struct
{
uint8_t NVIC_IRQChannel;
uint8_t NVIC_IRQChannelPreemptionPriority;
uint8_t NVIC_IRQChannelSubPriority;
FunctionalState NVIC_IRQChannelCmd;
} NVIC_InitTypeDef;
这个结构内哪个代替了向量地址寄存器的功能?
这样的初始化
NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
是怎么保证中断跳转到函数void USART1_IRQHandler(void)的?谢了! |