#include "stm32f10x.h"
GPIO_InitTypeDef GPIO_InitStructure;
void Delay(__IO uint32_t nCount);
int main(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOF, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 |
GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOF, &GPIO_InitStructure);
while (1)
{
GPIO_ResetBits(GPIOF, GPIO_Pin_9);
GPIO_SetBits(GPIOF, GPIO_Pin_6);
Delay(0xAFFFF);
GPIO_ResetBits(GPIOF, GPIO_Pin_6);
GPIO_SetBits(GPIOF, GPIO_Pin_7);
Delay(0xAFFFF);
GPIO_ResetBits(GPIOF, GPIO_Pin_7);
GPIO_SetBits(GPIOF, GPIO_Pin_8);
Delay(0xAFFFF);
GPIO_ResetBits(GPIOF, GPIO_Pin_8);
GPIO_SetBits(GPIOF, GPIO_Pin_9);
Delay(0xAFFFF);
}
}
void Delay(__IO uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
while (1)
{
}
}
#endif