Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Seine2017/control-firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
kierdavis committed Mar 13, 2017
2 parents 3d70af4 + c98c56a commit d3cb988
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
void init_spi_master(void)
{
DDRB = _BV(PB2) | _BV(PB3) | _BV(PB5); //Set Slave Select (/SS), MOSI and SCLK to outputs.
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR0); //Enable SPI, configure this device as master, set F_SCK = F_CPU/16 = 750 kHz.
SPCR = _BV(SPE) | _BV(MSTR); //Enable SPI, configure this device as master, set F_SCK = F_CPU/4 = 4 MHz.
}

void init_spi_slave(void)
Expand Down Expand Up @@ -59,4 +59,4 @@ uint8_t spi_trx(uint8_t b)
SPDR = b; //Write data to the SPI data register. Initiates transmission.
while(!(SPSR & _BV(SPIF))); //Wait for SPIF to go high, indicates transfer complete.
return SPDR; //Read received data from SPI data register, return it to be used.
}
}

0 comments on commit d3cb988

Please sign in to comment.