$ 0 0 just have a look at the included CDC demo. And then replace the uart routines by SPI routines. but you can best begin with the CDC sample.