Skip to content

Instantly share code, notes, and snippets.

@ozturkib
Last active October 14, 2019 07:09
Show Gist options
  • Save ozturkib/9cd05a883219ed92cf757d2ceb5d8c9c to your computer and use it in GitHub Desktop.
Save ozturkib/9cd05a883219ed92cf757d2ceb5d8c9c to your computer and use it in GitHub Desktop.
'''
Created on 11 Oct 2019
@author: Ibrahim Ozturk
@link : http://oku.ozturkibrahim.com/
STM32F4DISCOVERY kitindeki 4 pine bagli 4 ledin öncül tanımlamalarına ait fonksiyon içeriği
'''
void GPIO_Ayarla(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* cevresel birimi clock yoluna bagla */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
/* GPIOD Configuration: PD12, 13, 14 ve 15 cikislarini konfigure etme*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; /*Giris icin, GPIO_Mode_IN*/
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; /* push/pull */
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; /* pull up/down */
GPIO_Init(GPIOD, &GPIO_InitStructure);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment