Don't trust many of these examples yet... A lot of them are a work in progress... A good source of examples is in the libopencm3 sources: http://sourceforge.net/projects/libopencm3/