找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2102|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

STM32F103C8T6

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:902006 發(fā)表于 2021-4-7 19:22 | 只看該作者 回帖獎勵 |正序瀏覽 |閱讀模式
一些STM32最小系統(tǒng)的核心板的學(xué)習(xí)資料,一些測試程序
//頭文件
#include "stm32f10x.h"
#include "usart.h"
#include "led.h"
#include "RTC_Time.h"
#include <stdio.h>
//=============================================================================
//函數(shù)名稱:Delay
//功能概要:延時函數(shù)
//參數(shù)說明:無
//函數(shù)返回:無
//=============================================================================
void  Delay (uint32_t nCount)
{
  for(; nCount != 0; nCount--);
}
//=============================================================================
//函數(shù)名稱:main
//功能概要:主函數(shù)
//參數(shù)說明:無
//函數(shù)返回:int
//=============================================================================
int main(void)
{
  
  LED_GPIO_Config();//初始化LED
    USART1_Config();
    printf("*****************************************************************\r\n");
    printf("*                                                               *\r\n");
    printf("*      STM32最小系統(tǒng)板RTC測試后循環(huán)點亮PC13端的LED!          ^_^  *\r\n");
    printf("*                                                               *\r\n");
    printf("*****************************************************************\r\n");

    RTC_Init();

    while (1)
    {
    }
}

/*********************************************************************************************************
      END FILE
*********************************************************************************************************/






//頭文件
#include "stm32f10x.h"
#include "GPIOLIKE51.h"
//函數(shù)聲明
void GPIO_Configuration(void);
//=============================================================================
//文件名稱:Delay
//功能概要:延時
//參數(shù)說明:nCount:延時長短
//函數(shù)返回:無
//=============================================================================
void Delay(uint32_t nCount)
{
  for(; nCount != 0; nCount--);
}

//=============================================================================
//文件名稱:main
//功能概要:主函數(shù)
//參數(shù)說明:無
//函數(shù)返回:int
//=============================================================================
int main(void)
{
   GPIO_Configuration();
    while (1)
{
  PCout(13)=1;
  Delay(0xfffff);
//  Delay(0xfffff);
//  Delay(0xfffff);
//  Delay(0xfffff);
  PCout(13)=0;
  Delay(0xfffff);
//  Delay(0xfffff);
//  Delay(0xfffff);
//  Delay(0xfffff);  
    }
}
//=============================================================================
//文件名稱:GPIO_Configuration
//功能概要:GPIO初始化
//參數(shù)說明:無
//函數(shù)返回:無
//=============================================================================
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);
}


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表