欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: STM32的Template工程模板源碼下載 [打印本頁]

作者: DearSairoz    時(shí)間: 2018-5-26 14:10
標(biāo)題: STM32的Template工程模板源碼下載
大一,開始接觸STM32開發(fā)板了
加入了實(shí)驗(yàn)室,實(shí)驗(yàn)室老師要求我們掌握嵌入式,聽說學(xué)單片機(jī)嵌入式先學(xué)51單片機(jī)再學(xué)STM32更好,是嗎


STM32單片機(jī)源程序如下:
  1. #include "stm32f4xx.h"
  2. #include "usart.h"
  3. #include "delay.h"


  4. int main(void)
  5. {
  6.         u32 t=0;
  7.         uart_init(115200);
  8.         delay_init(84);
  9.         
  10.   while(1){
  11.     printf("t:%d\r\n",t);
  12.                 delay_ms(500);
  13.                 t++;
  14.         }
  15. }

  16. /*
  17. 手冊中講解到步驟15的時(shí)候的main.c源碼如下:
  18. #include "stm32f4xx.h"
  19.   
  20. void Delay(__IO uint32_t nCount);

  21. void Delay(__IO uint32_t nCount)
  22. {
  23.   while(nCount--){}
  24. }

  25. int main(void)
  26. {

  27.   GPIO_InitTypeDef  GPIO_InitStructure;
  28.   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);

  29.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;
  30.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  31.   GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  32.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  33.   GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  34.   GPIO_Init(GPIOF, &GPIO_InitStructure);

  35.   while(1){
  36.                 GPIO_SetBits(GPIOF,GPIO_Pin_9|GPIO_Pin_10);
  37.                 Delay(0x7FFFFF);
  38.                 GPIO_ResetBits(GPIOF,GPIO_Pin_9|GPIO_Pin_10);
  39.                 Delay(0x7FFFFF);
  40.         
  41.         }
  42. }
  43. */


復(fù)制代碼

所有資料51hei提供下載:
實(shí)驗(yàn)0 Template工程模板.zip (497.18 KB, 下載次數(shù): 18)



作者: zlkj    時(shí)間: 2018-5-29 22:04
感謝分享!請求發(fā)個電路圖




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1