Advertisement
Guest User

Untitled

a guest
Jul 7th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include <stm32f1xx_ll_bus.h>
  2. #include <stm32f1xx_ll_gpio.h>
  3. #include <stm32f1xx_ll_utils.h>
  4. #include <stdio.h>
  5.  
  6. int main(void)
  7. {
  8.     LL_InitTick(8000000, 1000);
  9.  
  10.     //Warning: if the line below triggers an error, GPIOC is not connected to a AHB1 (Group 1) on this device.
  11.     //In this case, please search the stm32xxxx_ll_bus.h file for 'PERIPH_GPIOC' to find out the correct
  12.     //macro name and use it to replace LL_AHB1_GRP1_PERIPH_$$com.sysprogs.examples.lBedblink.LEDPORT$$ and LL_AHB1_GRP1_EnableClock() below.
  13.     LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);
  14.     LL_GPIO_SetPinMode(GPIOC, LL_GPIO_PIN_13, LL_GPIO_MODE_OUTPUT);
  15.     LL_GPIO_SetPinOutputType(GPIOC, LL_GPIO_PIN_13, LL_GPIO_OUTPUT_PUSHPULL);
  16.     LL_GPIO_SetPinSpeed(GPIOC, LL_GPIO_PIN_13, LL_GPIO_SPEED_FREQ_LOW);
  17.  
  18.     for (;;)
  19.     {
  20.         LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_13);
  21.         LL_mDelay(100);
  22.         LL_GPIO_ResetOutputPin(GPIOC, LL_GPIO_PIN_13);
  23.         LL_mDelay(100);
  24.        
  25.         printf("hello\n");
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement