This tool let you setup the SPI unit of a generic AVR microcontroller. You can email the configuration and, in a future version, you will be able to generate C and ASM code.