Skip to content

Instantly share code, notes, and snippets.

@NikiSchlifke
NikiSchlifke / spi_ws2811.c
Created May 2, 2018 18:50
Trying to use SPI to control ws2811 led driver chips
#include "stdint.h"
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/f1/rcc.h>
#include <libopencm3/stm32/f1/gpio.h>
#include <libopencm3/stm32/f1/timer.h>
#include <libopencm3/stm32/f1/nvic.h>
#include <libopencm3/cm3/systick.h>
#include <libopencm3/stm32/f1/dma.h>
@NikiSchlifke
NikiSchlifke / main.c
Last active April 24, 2018 14:38
Trying to get all 16 pwm outputs on a stm32f103rb
/**
* Trying to get all 16 pwm outputs on a stm32f103rb
*/
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/f1/gpio.h>
#include <libopencm3/stm32/f1/timer.h>
#define MOTOR1_PHASE_A1 GPIO8 // PA8 fixed
#define MOTOR1_PHASE_A2 GPIO9 // PA9 fixed