这是程序,新手所以希望说的通透一点,十分感谢。。。
#include "stm32f4xx_hal.h"
void Delay(__IO uint32_t nCount);
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC->AHB1ENR=0x0080;
GPIO_InitStructure.Pin = GPIO_PIN_0 | GPIO_PIN_1 ;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_OD;
GPIO_InitStructure.Speed = GPIO_SPEED_FAST;
HAL_GPIO_Init(GPIOI, &GPIO_InitStructure);
while(1)
{
GPIOI->ODR=0xfffe;
Delay(0xfffff);
GPIOI->ODR=0xffff;
Delay(0xfffff);
GPIOI->ODR=0xfffd;
Delay(0xfffff);
GPIOI->ODR=0xffff;
Delay(0xfffff);
}
}
void Delay(__IO uint32_t nCount)
{
while(nCount--)
{
}
} |