Subversion Repositories pentevo

Rev

Rev 94 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. #include <avr/io.h>
  2. #include <avr/interrupt.h>
  3.  
  4. #include "pins.h"
  5. #include "mytypes.h"
  6.  
  7. void spi_init(void)
  8. {
  9.         SPCR = 0b01110000; // prepare SPI
  10.         SPSR = 0b00000001;
  11. }
  12.  
  13. UBYTE spi_send(UBYTE byte)
  14. {
  15.         SPDR = byte;
  16.         while( !( SPSR&(1<<SPIF) ) );
  17.         return SPDR;
  18. }
  19.  
  20.