A complete SPI tutorial?

Hi there

I never used SPI method of communication. I want to learn and practice that. Is there a complete sample C codes for SPI communication? The codes and the Atmel documents that I have seen so far, has only the initialization, and transmision function, and NOT receive fuction. For example, to comunicate using RS-232, you use two functions, trasmit(), and receive(); but for SPI I have not seen receive() function. Thanks

Regards

SPI is normally a duplex protocol - you send and receive data at the same time. If you just want to receive a byte, you send a dummy byte.

Leon