1.设置STart文件和User文件
该工程目前还没有添加STM32的库函数,还只是一个基于寄存器开发的工程
GPIO都是APB2的外设
#include "stm32f10x.h" // Device header
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_13;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOC,&GPIO_InitStructure);
GPIO_SetBits(GPIOC,GPIO_Pin_13);
// GPIO_ResetBits(GPIOC,GPIO_Pin_13);
while (1)
{
}
}