drivers: spi_sifive: Use uint8_t data/buffer types to match spi_context.
spi_context uses uint8_t buffers, and HW rxdata / txdata registers only contain 8 bits of data (along with b31 full / empty flag), so uint8_t is appropriate. Suggested-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no> Signed-off-by: Shawn Nematbakhsh <shawn@rivosinc.com>
This commit is contained in:
parent
168f4d1d18
commit
e17d5ed282
1 changed files with 4 additions and 4 deletions
|
@ -100,7 +100,7 @@ int spi_config(const struct device *dev, uint32_t frequency,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void spi_sifive_send(const struct device *dev, uint16_t frame)
|
||||
void spi_sifive_send(const struct device *dev, uint8_t frame)
|
||||
{
|
||||
while (sys_read32(SPI_REG(dev, REG_TXDATA)) & SF_TXDATA_FULL) {
|
||||
}
|
||||
|
@ -108,20 +108,20 @@ void spi_sifive_send(const struct device *dev, uint16_t frame)
|
|||
sys_write32((uint32_t) frame, SPI_REG(dev, REG_TXDATA));
|
||||
}
|
||||
|
||||
uint16_t spi_sifive_recv(const struct device *dev)
|
||||
uint8_t spi_sifive_recv(const struct device *dev)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
while ((val = sys_read32(SPI_REG(dev, REG_RXDATA))) & SF_RXDATA_EMPTY) {
|
||||
}
|
||||
|
||||
return (uint16_t) val;
|
||||
return (uint8_t) val;
|
||||
}
|
||||
|
||||
void spi_sifive_xfer(const struct device *dev, const bool hw_cs_control)
|
||||
{
|
||||
struct spi_context *ctx = &SPI_DATA(dev)->ctx;
|
||||
uint16_t txd, rxd;
|
||||
uint8_t txd, rxd;
|
||||
|
||||
do {
|
||||
/* Send a frame */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue