#include<stm32f10x.h>int main(){#if 0 //APIOA 时钟初始化unsigned int * p=(unsigned int*)0x40021018;*p |= 0x1<<2;//A0 推挽输出p=(unsigned int*)0x40010800;*p = *p & ~0xf | 0x1;//A0低电平p=(unsigned int*)0x4001080c;*p &= ~0x1;#endifRCC->APB2ENR |= 0x1<<2;GPIOA->CRL = GPIOA->CRL & ~0xF | 0x1;GPIOA->ODR &= ~0x1;while(1);return 0;}
#include<stm32f10x.h>int main(){GPIO_InitTypeDef GPIOA_INIT_DEF;RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);//RCC->APB2ENR |= 0x1<<2;GPIOA_INIT_DEF.GPIO_Mode = GPIO_Mode_Out_PP;GPIOA_INIT_DEF.GPIO_Pin = GPIO_Pin_0;GPIOA_INIT_DEF.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOA,&GPIOA_INIT_DEF);while(1);return 0;
}

