Advertisement
jh_elec

Untitled

Jun 23rd, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. uint8_t spiWriteRead( uint8_t data )
  2. {
  3.     /*
  4.     *   Byte in das Senderegister vom SPI schreiben
  5.     */
  6.     SPDR = data;
  7.    
  8.     /*
  9.     *   Warten bis alle Bits raus geschoben wurden sind..
  10.     */
  11.     while( ! ( SPSR & ( 1 << SPIF ) ) );   
  12.    
  13.     /*
  14.     *   Empfangenes Byte zurückgeben
  15.     */
  16.     return SPDR;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement