#include "stm32f4xx.h"
void Delay(__IO uint32_t nCount);
void Delay(__IO uint32_t nCount)
{
while(nCount--){}
}
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOF, &GPIO_InitStructure);
while(1)
{
GPIO_SetBits(GPIOF,GPIO_Pin_9|GPIO_Pin_10);
Delay(0x7FFFFF);
GPIO_ResetBits(GPIOF,GPIO_Pin_9|GPIO_Pin_10);
Delay(0x7FFFFF);
}
}
/**
******************************************************************************
* @file Project/STM32F4xx_StdPeriph_Templates/main.c
* @author MCD Application Team
* @version V1.8.0
* @date 04-November-2016
* @brief Main program body
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/** @addtogroup Template_Project
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static __IO uint32_t uwTimingDelay;
RCC_ClocksTypeDef RCC_Clocks;
/* Private function prototypes -----------------------------------------------*/
static void Delay(__IO uint32_t nTime);
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/*!< At this stage the microcontroller clock setting is already configured,
this is done through SystemInit() function which is called from startup
files before to branch to application main.
To reconfigure the default setting of SystemInit() function,
refer to system_stm32f4xx.c file */
/* SysTick end of count event each 10ms */
RCC_GetClocksFreq(&RCC_Clocks);
SysTick_Config(RCC_Clocks.HCLK_Frequency / 100);
/* Add your application code here */
/* Insert 50 ms delay */
Delay(5);
/* Output HSE clock on MCO1 pin(PA8) ****************************************/
/* Enable the GPIOA peripheral */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
/* Configure MCO1 pin(PA8) in alternate function */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* HSE clock selected to output on MCO1 pin(PA8)*/
RCC_MCO1Config(RCC_MCO1Source_HSE, RCC_MCO1Div_1);
/* Output SYSCLK/4 clock on MCO2 pin(PC9) ***********************************/
/* Enable the GPIOACperipheral */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
/* Configure MCO2 pin(PC9) in alternate function */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* SYSCLK/4 clock selected to output on MCO2 pin(PC9)*/
RCC_MCO2Config(RCC_MCO2Source_SYSCLK, RCC_MCO2Div_4);
/* Infinite loop */
while (1)
{
}
}
/**
* @brief Inserts a delay time.
* @param nTime: specifies the delay time length, in milliseconds.
* @retval None
*/
void Delay(__IO uint32_t nTime)
{
uwTimingDelay = nTime;
while(uwTimingDelay != 0);
}
/**
* @brief Decrements the TimingDelay variable.
* @param None
* @retval None
*/
void TimingDelay_Decrement(void)
{
if (uwTimingDelay != 0x00)
{
uwTimingDelay--;
}
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
没有合适的资源?快使用搜索试试~ 我知道了~
STM32F411RET6-nucleo工程
共294个文件
d:56个
h:56个
c:55个
需积分: 10 15 下载量 155 浏览量
2018-08-10
12:54:32
上传
评论 1
收藏 11.73MB ZIP 举报
温馨提示
之前拿到F411RET6 -nucleo 的开发板,在一些论坛上没有找到直接就能编译通过并且下到这个开发板上就能用的工程,于是自己就上官网上找数据手册等资料,参照原子哥的F407的资料自己改,并且自己也下到板子上测试过,例程中包含配置好的两个定时器,两个pwm输出,八个外部中断等,以及板载的USER按键,LED灯等,分享给大家,一起学习,一起进步.
资源推荐
资源详情
资源评论
收起资源包目录
STM32F411RET6-nucleo工程 (294个子文件)
DEMOPOJ.uvguix.13675 168KB
DEMOPOJ.axf 352KB
DEMOPOJ_sct.Bak 479B
stm32f4xx_rcc.c 134KB
stm32f4xx_tim.c 122KB
stm32f4xx_rtc.c 101KB
stm32f4xx_dfsdm.c 85KB
stm32f4xx_adc.c 67KB
stm32f4xx_can.c 65KB
stm32f4xx_flash.c 62KB
stm32f4xx_fmc.c 61KB
stm32f4xx_dsi.c 61KB
system_stm32f4xx.c 60KB
stm32f4xx_cryp_aes.c 57KB
stm32f4xx_fmpi2c.c 57KB
stm32f4xx_usart.c 57KB
stm32f4xx_i2c.c 53KB
stm32f4xx_dma.c 52KB
stm32f4xx_spi.c 52KB
stm32f4xx_sai.c 48KB
stm32f4xx_fsmc.c 45KB
stm32f4xx_pwr.c 42KB
stm32f4xx_ltdc.c 39KB
stm32f4xx_sdio.c 38KB
stm32f4xx_cryp.c 35KB
stm32f4xx_lptim.c 34KB
stm32f4xx_qspi.c 32KB
stm32f4xx_dma2d.c 27KB
stm32f4xx_dac.c 26KB
stm32f4xx_hash.c 26KB
stm32f4xx_gpio.c 25KB
stm32f4xx_cec.c 24KB
stm32f4xx_dcmi.c 18KB
stm32f4xx_spdifrx.c 17KB
stm32f4xx_syscfg.c 17KB
stm32f4xx_rng.c 14KB
misc.c 11KB
stm32f4xx_cryp_tdes.c 11KB
stm32f4xx_wwdg.c 10KB
stm32f4xx_cryp_des.c 10KB
stm32f4xx_exti.c 10KB
stm32f4xx_hash_sha1.c 10KB
stm32f4xx_hash_md5.c 9KB
stm32f4xx_iwdg.c 9KB
exti.c 8KB
delay.c 8KB
stm32f4xx_dbgmcu.c 7KB
stm32f4xx_flash_ramfunc.c 5KB
usart.c 5KB
stm32f4xx_it.c 4KB
pwm.c 4KB
stm32f4xx_crc.c 4KB
timer.c 3KB
main.c 1KB
key.c 1KB
sys.c 1KB
beep.c 671B
led.c 668B
stm32f4xx_fsmc.crf 441KB
stm32f4xx_cryp_aes.crf 390KB
stm32f4xx_tim.crf 389KB
stm32f4xx_rtc.crf 387KB
stm32f4xx_can.crf 387KB
stm32f4xx_ltdc.crf 384KB
stm32f4xx_cryp.crf 382KB
stm32f4xx_sai.crf 381KB
stm32f4xx_dma2d.crf 379KB
stm32f4xx_rcc.crf 379KB
stm32f4xx_cryp_tdes.crf 378KB
stm32f4xx_cryp_des.crf 378KB
stm32f4xx_it.crf 377KB
stm32f4xx_dac.crf 377KB
main.crf 377KB
pwm.crf 376KB
stm32f4xx_adc.crf 376KB
stm32f4xx_flash.crf 376KB
stm32f4xx_dma.crf 376KB
usart.crf 376KB
stm32f4xx_hash.crf 375KB
stm32f4xx_dcmi.crf 375KB
stm32f4xx_i2c.crf 375KB
stm32f4xx_usart.crf 375KB
stm32f4xx_hash_sha1.crf 374KB
stm32f4xx_hash_md5.crf 374KB
stm32f4xx_spi.crf 374KB
stm32f4xx_sdio.crf 374KB
exti.crf 373KB
stm32f4xx_pwr.crf 373KB
stm32f4xx_gpio.crf 372KB
timer.crf 371KB
key.crf 371KB
delay.crf 371KB
beep.crf 370KB
led.crf 370KB
system_stm32f4xx.crf 370KB
stm32f4xx_exti.crf 370KB
sys.crf 370KB
stm32f4xx_syscfg.crf 370KB
stm32f4xx_wwdg.crf 370KB
misc.crf 370KB
共 294 条
- 1
- 2
- 3
资源评论
yyh1367521395
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功