Страница 1 из 1

помигать светодиодом coocox

Добавлено: 02 фев 2018, 14:24
admin

Код: Выбрать все

typedef unsigned long int unit32_t;

#define RCC_AHBENHR (*(volatile unsigned long*)0x40021014)
#define GIPIOE_MODER (*(volatile unsigned long*)0x48001000)
#define GPIOE_ODR (*(volatile unsigned long*)0x48001014)

void _delay(unit32_tindex);




void main()
{

   RCC_AHBENHR  |=1<<21;///port clock enable
   GIPIOE_MODER |=(0<<31|1<<30);//out mode


   GPIOE_ODR |=1<<15;////pe_15 HIGH


    while(1){

       GPIOE_ODR |=1<<15;////pe_15 HIGH

       _delay(1000000);

       GPIOE_ODR &=~(1<<15);////pe_15 LOW
       _delay(1000000);



    }



}

void _delay(unit32_t index){

   while(index--);

}