You are on page 1of 1

#include <stdio.

h>

#include "STM32F4xx.h"

int main(void)

unsigned int cont;

RCC->AHB1ENR |= (1UL<<3);

GPIOD->MODER &= ~(3UL<<2*12);

GPIOD->MODER |= (1UL<<2*12);

GPIOD->OTYPER &=~(1UL<<12);

GPIOD->OSPEEDR &= ~(3UL<<2*12);

GPIOD->OSPEEDR |= (2UL<<2*12);

GPIOD->PUPDR &= ~(3UL<<2*12);

GPIOD->PUPDR |= (1UL<<2*12);

while (true)

GPIOD->ODR |= (1UL<<12);

for(cont=0;cont<1000000;cont++);

GPIOD->ODR &=~(1UL<<12);

for(cont=0;cont<1000000;cont++);

You might also like