Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. /*
  2. * Very simple blink function which will
  3. * blink an LED on the Nucleo board.
  4. */
  5.  
  6. #include <stdint.h>
  7. #include <loc3util/stm32/pins.h>
  8. #include <loc3util/stm32/clock.h>
  9.  
  10.  
  11. int
  12. main( void )
  13. {
  14. /* set up the max clock for F411 using HSI */
  15. clock_setup(96000000, 0);
  16.  
  17. /* make PC0, PC1, PB0, and PA4 output pins */
  18. pin_output(PC0, PC1, PB0, PA4, PXX);
  19.  
  20. /* Set two of them to the 'high' state */
  21. pin_set(PC1, PA4, PXX);
  22. while (1) {
  23. /* alternately blink them */
  24. pin_toggle(PC0, PC1, PB0, PA4, PXX);
  25. msleep(100);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement