Skip to content

Instantly share code, notes, and snippets.

@notthetup
Created January 12, 2017 14:40
Show Gist options
  • Save notthetup/547ca290ffddf839ce7528eef0c0970a to your computer and use it in GitHub Desktop.
Save notthetup/547ca290ffddf839ce7528eef0c0970a to your computer and use it in GitHub Desktop.
STM32 Pin Toggle
// 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