|
#include"stdint.h"
#define GPIOC_CRL *(unsigned int*)(0x40010c00)
#define GPIOC_ODR *(unsigned int*)(0x40010c0c)
#define RCC_AFB2ENR *(unsigned int*)(0x40021018)
#define SPEED 1000
void delay(unsigned int a)
{
unsigned int i;
while(--a !=0)
{
for(i=1;i<600;i++);
}
}
int main(void)
{
while(1)
{
RCC_AFB2ENR |= 0x00000008;
GPIOC_CRL |= 0x00100011;
GPIOC_ODR &= ~(0x00000023);
GPIOC_ODR |= 0x00000002;
delay(SPEED);
RCC_AFB2ENR |= 0x00000008;
GPIOC_CRL |= 0x00100011;
GPIOC_ODR &= ~(0x00000023);
GPIOC_ODR |= 0x00000001;
delay(SPEED);
RCC_AFB2ENR |= 0x00000008;
GPIOC_CRL |= 0x00100011;
GPIOC_ODR &= ~(0x00000023);
GPIOC_ODR |= 0x000000020;
delay(SPEED);
RCC_AFB2ENR |= 0x00000008;
GPIOC_CRL |= 0x00100011;
GPIOC_ODR &= ~(0x00000023);
GPIOC_ODR |= 0x00000000;
delay(SPEED);
RCC_AFB2ENR |= 0x00000008;
GPIOC_CRL |= 0x00100011;
GPIOC_ODR &= ~(0x00000023);
GPIOC_ODR |= 0x000000023;
delay(SPEED);
}
}
void SystemInit(void)
{
}
|
|