avr: Configure spi transfer in spi_prepare()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f60b0093b7
commit
d9f960fb0c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue