STM32F407 跑馬燈實驗

2022-08-18 21:39:15 字數 984 閱讀 6115

1、庫函式版本呼叫的函式有哪些?對應的原始檔/標頭檔案是哪個?

庫函式

原始檔

標頭檔案

rcc_ahb1periphclockcmd(rcc_ahb1periph_gpiof, enable)

stm32f4xx_rcc.c

stm32f4xx_rcc.h

gpio_init(gpiof, &gpio_initstruct)

stm32f4xx_gpio.c

stm32f4xx_gpio.h

gpio_setbits(gpiof,gpio_pin_9 | gpio_pin_10)

stm32f4xx_gpio.c

stm32f4xx_gpio.h

gpio_resetbits(gpiof,gpio_pin_9)

stm32f4xx_gpio.c

stm32f4xx_gpio.h

2、暫存器版本需要呼叫的暫存器?

暫存器

原始檔

標頭檔案

rcc->ahb1enr |= 1<<5;

stm32f4xx.h

gpiof->moder &= ~(3<<9*2);

stm32f4xx.h

gpiof->otyper &=~(1<<9);

stm32f4xx.h

gpiof->ospeedr &= ~(3<<9*2);

stm32f4xx.h

gpiof->pupdr &= ~(3<<9*2);

stm32f4xx.h

gpiof->odr &= ~(1<<9);

stm32f4xx.h

stm32_clock_init(336,8,2,7);

sys.c

sys.h

STM32F407 多功能跑馬燈

自律即自強!1 完成多功能跑馬燈專案。2 預習中斷。多功能跑馬燈 include sys.h include delay.h include usart.h include led.h include beep.h include key.h alientek 探索者stm32f407開發板 實驗3...

STM32F407 串列埠顯示跑馬燈狀態

main.c include sys.h include delay.h include usart.h include led.h include beep.h include key.h include exti.h extern u8 onoff,dir,speed,change,flag e...

STM32F407 跑馬燈 庫函式版 個人筆記

mcu在開發板原理圖的第二頁,led在開發板原理圖的第三頁 由圖可知,pf9 pf10 若輸出低電平則燈亮,高電平則燈滅 選推挽輸出 使能io口時鐘。呼叫函式rcc ahb1periphclockcmd 不同的外設呼叫的時鐘使能函式可能不一樣 初始化io口模式。呼叫函式gpio init 操作io口...