ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
Loading...
Searching...
No Matches
stm32f091nucleo64_blink.c
1#include <libopencm3/stm32/gpio.h>
2#include <libopencm3/stm32/rcc.h>
3
4#define PORT_LED GPIOA
5#define PIN_LED GPIO5
6#define RCC_GPIO_LED RCC_GPIOA
7
8static void gpio_setup(void) {
9 rcc_periph_clock_enable(RCC_GPIO_LED);
10
11 gpio_mode_setup(PORT_LED, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, PIN_LED);
12}
13
14int main(void) {
15 int i;
16
17 gpio_setup();
18
19 while (1) {
20 gpio_toggle(PORT_LED, PIN_LED);
21 for (i = 0; i < 1000000; i++) {
22 __asm__("nop");
23 }
24 }
25
26 return 0;
27}