nrf52 spi: build fixes and a missing register setting (polarity)

This commit is contained in:
Matias N 2021-01-16 19:31:08 -03:00 committed by Brennan Ashton
parent ebe596bcd1
commit e1b3374bce

View File

@ -854,6 +854,8 @@ static void nrf52_spi_setmode(FAR struct spi_dev_s *dev,
}
}
nrf52_spi_putreg(priv, NRF52_SPIM_CONFIG_OFFSET, regval);
/* According to manual we have to set SCK pin output
* value the same as CPOL value
*/
@ -1155,7 +1157,7 @@ static void nrf52_spi_exchange(FAR struct spi_dev_s *dev,
if (nrf52_spi_getreg(priv, NRF52_SPIM_TXDAMOUNT_OFFSET) !=
transfer_size)
{
spierr("Incomplete transfer wrote %" PRId32 " expected %d\n",
spierr("Incomplete transfer wrote %" PRId32 " expected %zu\n",
regval, nwords);
}
@ -1291,13 +1293,13 @@ static int nrf52_spi_pm_prepare(FAR struct pm_callback_s *cb, int domain,
active |= nrf52_spi_getreg(&g_spi0dev, SPIM_EVENTS_STARTED);
#endif
#ifdef CONFIG_NRF52_SPI1_MASTER
active |= nrf52_spi_getreg(&g_spi0dev, SPIM_EVENTS_STARTED);
active |= nrf52_spi_getreg(&g_spi1dev, SPIM_EVENTS_STARTED);
#endif
#ifdef CONFIG_NRF52_SPI2_MASTER
active |= nrf52_spi_getreg(&g_spi0dev, SPIM_EVENTS_STARTED);
active |= nrf52_spi_getreg(&g_spi2dev, SPIM_EVENTS_STARTED);
#endif
#ifdef CONFIG_NRF52_SPI3_MASTER
active |= nrf52_spi_getreg(&g_spi0dev, SPIM_EVENTS_STARTED);
active |= nrf52_spi_getreg(&g_spi3dev, SPIM_EVENTS_STARTED);
#endif
if (active)