上一篇文章中介绍了STM32F3系列处理器简单项目工程模板的建立方法,本文中将介绍该模板的用法及编写一个简单的流水灯测试程序:
#include "stm32f30x.h" #include "core_cm4.h"//包含此头文件之后才可以使用SysTick? static __IO uint32_t TimingDelay; void Delay(__IO uint32_t nTime); int main(void) { /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f30x.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f30x.c file */ u8 i; RCC_ClocksTypeDef RCC_Clocks; GPIO_InitTypeDef GPIO_InitStructure; RCC_GetClocksFreq(&RCC_Clocks); SysTick_Config(RCC_Clocks.HCLK_Frequency / 10); RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOE, ENABLE); /* STM32F3探索者套件中八个LED灯分别对应PE8~PE15*/ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15; // GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOE, &GPIO_InitStructure); while (1) { for(i=0;i |
å·¥ç¨æ¨¡æ¿.zip
下载4.44 MB, 下载次数: 601, 下载积分: ST金币 -1
STM32F3 硬件I2C 驱动OLED 求助!!
STM32F303使用定时器触发双ADC常规同步采样模式
哪位大哥传下STM32F334 Nucleo的工程模板给我下
STM32F334 不能串口下载
关于STM32F334的HRTIM分辨率问题
STM32F303+LCD1602程序问题,不只为什么点不亮?
STM32F334的ADC使用问题
STM32F334 HRTIM形成移相全桥波形问题
有用过STM32F373VC的板子么 iic 例程不好使
STM32F3 ADC外部触发采样达不到7.2MSPS
RE:STM32F3探索者套件学习之路之第一个测试程序:永恒的流水灯