|
源程序文件: main.c
//頭文件
#include "stm32f10x.h"
#include "GPIOLIKE51.h"
//函數(shù)聲明
void GPIO_Configuration(void);
//=============================================================================
//文件名稱(chēng):Delay
//功能概要:延時(shí)
//參數(shù)說(shuō)明:nCount:延時(shí)長(zhǎng)短
//函數(shù)返回:無(wú)
//=============================================================================
void Delay(uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
//=============================================================================
//文件名稱(chēng):main
//功能概要:主函數(shù)
//參數(shù)說(shuō)明:無(wú)
//函數(shù)返回:int
//=============================================================================
int main(void)
{
GPIO_Configuration();
while (1)
{
PCout(13)=1;
Delay(0xfffff);
PCout(13)=0;
Delay(0xfffff);
}
}
//=============================================================================
//文件名稱(chēng):GPIO_Configuration
//功能概要:GPIO初始化
//參數(shù)說(shuō)明:無(wú)
//函數(shù)返回:無(wú)
//=============================================================================
void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOC , ENABLE);
//=============================================================================
//LED -> PC13
//=============================================================================
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
編譯所得HEX.zip
(1.25 KB, 下載次數(shù): 19)
2021-4-18 14:38 上傳
點(diǎn)擊文件名下載附件
|
評(píng)分
-
查看全部評(píng)分
|