|
|
@ -75,11 +75,13 @@ static int stm32f0_spi_tx_rx(struct spi_dev *dev, void *rx_buf, size_t rx_len, |
|
|
|
gpio_clear(GPIOA, GPIO4); |
|
|
|
gpio_clear(GPIOA, GPIO4); |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < tx_len; ++i) { |
|
|
|
for (i = 0; i < tx_len; ++i) { |
|
|
|
spi_send8(dev->dev_id, tx ? *tx++ : 0); |
|
|
|
spi_send8(dev->dev_id, *tx++); |
|
|
|
|
|
|
|
(void)spi_read8(dev->dev_id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (rx_buf) { |
|
|
|
if (rx_buf) { |
|
|
|
for (i = 0; i < rx_len; ++i) { |
|
|
|
for (i = 0; i < rx_len; ++i) { |
|
|
|
|
|
|
|
spi_send8(dev->dev_id, 0); |
|
|
|
*rx++ = spi_read8(dev->dev_id); |
|
|
|
*rx++ = spi_read8(dev->dev_id); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|