Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. //basic headers
  2. #include "stm32f4xx.h"
  3. #include "stm32f4xx_gpio.h"
  4. #include "stm32f4xx_rcc.h"
  5.  
  6. int main(void)
  7. {
  8. //Peripherial clock setup
  9. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  10.  
  11. RCC_LSEConfig(RCC_LSE_OFF);
  12.  
  13. GPIO_InitTypeDef gpio;
  14.  
  15. gpio.GPIO_Pin = GPIO_Pin_14;
  16. gpio.GPIO_OType = GPIO_OType_PP;
  17. gpio.GPIO_Mode = GPIO_Mode_OUT;
  18. gpio.GPIO_PuPd = GPIO_PuPd_NOPULL;
  19. gpio.GPIO_Speed = GPIO_Speed_100MHz;
  20.  
  21. GPIO_Init(GPIOC, &gpio);
  22.  
  23. volatile int i;
  24.  
  25. while(1)
  26. {
  27. // Led On
  28. GPIO_ToggleBits(GPIOC, GPIO_Pin_14);
  29. for(i=0; i < 500000; i++);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement