Created
November 17, 2014 22:32
-
-
Save ChuckM/fb367961f0444cb4f0d5 to your computer and use it in GitHub Desktop.
This is a sample GIST, toggle code for STM32L0
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
#include <libopencm3/stm32/rcc.h> | |
#include <libopencm3/stm32/gpio.h> | |
void setup_clock(void) { | |
rcc_clock_setup_in_hsi_out_48mhz(); | |
} | |
void setup_gpio(void) { | |
gpio_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUSHPULL_NONE, GPIO5); | |
} | |
void | |
main() { | |
setup_clock(); | |
setup_gpio(); | |
while (1) { | |
gpio_toggle(GPIOA, GPIO5); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment