Created
February 20, 2017 21:21
-
-
Save 2garryn/f274d58cae2738f9283e5e78205b4e98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void btn_init_port_pins(GPIO_TypeDef* GPIOx, uint32_t RCClocking, uint32_t pins) { | |
GPIO_InitTypeDef GPIO_InitStructure; | |
RCC_AHB1PeriphClockCmd(RCClocking, ENABLE); | |
GPIO_InitStructure.GPIO_Pin = pins; | |
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; | |
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; | |
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; | |
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; | |
GPIO_Init(GPIOx, &GPIO_InitStructure); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment