Created
January 12, 2017 14:40
-
-
Save notthetup/547ca290ffddf839ce7528eef0c0970a to your computer and use it in GitHub Desktop.
STM32 Pin Toggle
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
// Enable GPIO D | |
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE); | |
// Initialize GPIO for PD15 (DAC Clear Pin) | |
GPIO_InitTypeDef GPIO_InitStructure; | |
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; | |
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; | |
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; | |
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; | |
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; | |
GPIO_Init(GPIOD, &GPIO_InitStructure); | |
GPIO_SetBits(GPIOD, GPIO_Pin_15); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment