Subversion Repositories pentevo

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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