Advertisement
demoss

main.c_ver1

Jul 23rd, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stm32f10x.h>
  2. #include <stm32f10x_rcc.h>
  3. #include <stm32f10x_gpio.h>
  4. void delay(volatile uint32_t nCount) {
  5.     for (; nCount != 0; nCount--);
  6. }
  7. void main(void)
  8. {
  9.   RCC->APB2ENR|=RCC_APB2ENR_IOPCEN;
  10.   GPIOC->CRH=0x80200000;
  11.   if(GPIOC->IDR&GPIO_IDR_IDR15)GPIOC->BRR|=GPIO_BSRR_BR13;
  12.   else
  13.     GPIOC->BSRR=GPIO_BSRR_BS13;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement