發表文章

目前顯示的是 1月, 2018的文章

STM32 NVIC

在 ST 所提供的範例我們可以看到三大設定, RCC 、 NVIC 、 GPIO ,如下所示: /* System Clocks Configuration */   RCC_Configuration();          /* NVIC configuration */   NVIC_Configuration();   /* Configure the GPIO ports */   GPIO_Configuration(); RCC 和 GPIO 己略介紹過,而 NVIC 在本章將簡單介紹一下。 NVIC 是對中斷優先的管理,首先看在 ST 所提供的範例 USART 中的 DMA_Polling 中 void NVIC_Configuration(void) {  #ifdef  VECT_TAB_RAM    /* Set the Vector Table base location at 0x20000000 */   NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); #else  /* VECT_TAB_FLASH  */   /* Set the Vector Table base location at 0x08000000 */   NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);   #endif } 接著看 USART  Interrupt 的範例中 NVIC 副程式 void NVIC_Configuration(void) {   NVIC_InitTypeDef NVIC_InitStructure; #ifdef  VECT_TAB_RAM    /* Set the Vector Table base location at 0x20000000 */   NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); #else  /* VECT_TAB_FLASH  */   /* Set the Vector Table base location at 0x08000000 */