The rotary encoder handling is a port of this arduino code to use libopencm3.
The Makefile
is derived from the examples for stm32F0 disco board from libopencm3-examples.
make -C libopencm3 # onece, to build the libopencm3 library
make -C src flash