avr: Configure spi transfer in spi_prepare()

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-07-11 19:34:19 -04:00
parent f60b0093b7
commit d9f960fb0c
1 changed files with 4 additions and 4 deletions

View File

@ -438,17 +438,17 @@ spi_setup(uint32_t bus, uint8_t mode, uint32_t rate)
return config;
}
void spi_prepare(struct spi_config config)
void
spi_prepare(struct spi_config config)
{
SPCR = config.spcr;
SPSR = config.spsr;
}
void
spi_transfer(struct spi_config config, uint8_t receive_data
, uint8_t len, uint8_t *data)
{
SPCR = config.spcr;
SPSR = config.spsr;
if (receive_data) {
while (len--) {
SPDR = *data;