找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 2176|回復(fù): 0
收起左側(cè)

STM32F103C8T6

[復(fù)制鏈接]
ID:902006 發(fā)表于 2021-4-7 19:22 | 顯示全部樓層 |閱讀模式
一些STM32最小系統(tǒng)的核心板的學(xué)習(xí)資料,一些測(cè)試程序
//頭文件
#include "stm32f10x.h"
#include "usart.h"
#include "led.h"
#include "RTC_Time.h"
#include <stdio.h>
//=============================================================================
//函數(shù)名稱:Delay
//功能概要:延時(shí)函數(shù)
//參數(shù)說(shuō)明:無(wú)
//函數(shù)返回:無(wú)
//=============================================================================
void  Delay (uint32_t nCount)
{
  for(; nCount != 0; nCount--);
}
//=============================================================================
//函數(shù)名稱:main
//功能概要:主函數(shù)
//參數(shù)說(shuō)明:無(wú)
//函數(shù)返回:int
//=============================================================================
int main(void)
{
  
  LED_GPIO_Config();//初始化LED
    USART1_Config();
    printf("*****************************************************************\r\n");
    printf("*                                                               *\r\n");
    printf("*      STM32最小系統(tǒng)板RTC測(cè)試后循環(huán)點(diǎ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í)
//參數(shù)說(shuō)明:nCount:延時(shí)長(zhǎng)短
//函數(shù)返回:無(wú)
//=============================================================================
void Delay(uint32_t nCount)
{
  for(; nCount != 0; nCount--);
}

//=============================================================================
//文件名稱:main
//功能概要:主函數(shù)
//參數(shù)說(shuō)明:無(wú)
//函數(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ù)說(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);
}


回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

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

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

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