在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<abbr id="27omo"></abbr>

<menu id="27omo"><dl id="27omo"></dl></menu>
    • <label id="27omo"><tt id="27omo"></tt></label>

      新聞中心

      EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > STM32學(xué)習(xí)筆記—SysTick定時(shí)器

      STM32學(xué)習(xí)筆記—SysTick定時(shí)器

      作者: 時(shí)間:2013-01-24 來源:網(wǎng)絡(luò) 收藏

      void SysTick_Configuration(void)

      {

      /* Select AHB clock(HCLK) as SysTick clock source 設(shè)置AHB時(shí)鐘為SysTick時(shí)鐘*/

      SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);

      /* Set SysTick Priority to 3 設(shè)置SysTicks中斷搶占優(yōu)先級(jí) 3, 從優(yōu)先級(jí)0*/

      NVIC_SystemHandlerPriorityConfig(SystemHandler_SysTick, 3, 0);

      /* SysTick interrupt each 1ms with HCLK equal to 72MHz 每1ms發(fā)生一次SysTick中斷*/

      SysTick_SetReload(72000);

      /* Enable the SysTick Interrupt */

      SysTick_ITConfig(ENABLE);

      }

      延時(shí)函數(shù),需要延時(shí)處調(diào)用:

      view plaincopy to clipboardprint?

      void Delay(u32 nTime)

      {

      /* Enable the SysTick Counter 允許SysTick計(jì)數(shù)器*/

      SysTick_CounterCmd(SysTick_Counter_Enable);

      TimingDelay = nTime;

      while(TimingDelay != 0)

      ; //等待計(jì)數(shù)至0

      /* Disable the SysTick Counter 禁止SysTick計(jì)數(shù)器*/

      SysTick_CounterCmd(SysTick_Counter_Disable);

      /* Clear the SysTick Counter 清零SysTick計(jì)數(shù)器*/

      SysTick_CounterCmd(SysTick_Counter_Clear);

      }

      void Delay(u32 nTime)

      {

      /* Enable the SysTick Counter 允許SysTick計(jì)數(shù)器*/

      SysTick_CounterCmd(SysTick_Counter_Enable);

      TimingDelay = nTime;

      while(TimingDelay != 0)

      ; //等待計(jì)數(shù)至0

      /* Disable the SysTick Counter 禁止SysTick計(jì)數(shù)器*/

      SysTick_CounterCmd(SysTick_Counter_Disable);

      /* Clear the SysTick Counter 清零SysTick計(jì)數(shù)器*/

      SysTick_CounterCmd(SysTick_Counter_Clear);

      }

      中斷函數(shù),定時(shí)器減至零時(shí)調(diào)用,放在stm32f10x_it.c文件中

      view plaincopy to clipboardprint?

      void SysTickHandler(void)

      {

      TimingDelay--;

      }

      塵埃粒子計(jì)數(shù)器相關(guān)文章:塵埃粒子計(jì)數(shù)器原理

      上一頁 1 2 下一頁

      評(píng)論


      相關(guān)推薦

      技術(shù)專區(qū)

      關(guān)閉
      ×

      “芯”朋友见面大会
      珠海|11.14|泰克“芯”朋友见面大会珠海站|泰克带您从测试角度看半导体的整条产业链,快来报名抢位吧>>