STM32F0 Help setting SPI
This is an example of how to not write code:


  RCC_APB2ENR |= _BV(12); //SPI1EN


You have to remember what bit 12 means, an ususally end up looking in the manual to check. Repeating this for all the other bits takes too much time and errors are very difficult to spot.

Thats why there is a STM32F0xx standard peripherals library. Using this you can write much more readable code:

RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);

I would also expect to find some example code for SPI on the vendors website.