Created
March 11, 2015 03:22
-
-
Save ChuckM/f67cd68bfeca7645ff90 to your computer and use it in GitHub Desktop.
Example of using my utilities with the existing LOC3 library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Very simple blink function which will | |
* blink an LED on the Nucleo board. | |
*/ | |
#include <stdint.h> | |
#include <loc3util/stm32/pins.h> | |
#include <loc3util/stm32/clock.h> | |
int | |
main( void ) | |
{ | |
/* set up the max clock for F411 using HSI */ | |
clock_setup(96000000, 0); | |
/* make PC0, PC1, PB0, and PA4 output pins */ | |
pin_output(PC0, PC1, PB0, PA4, PXX); | |
/* Set two of them to the 'high' state */ | |
pin_set(PC1, PA4, PXX); | |
while (1) { | |
/* alternately blink them */ | |
pin_toggle(PC0, PC1, PB0, PA4, PXX); | |
msleep(100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment