Skip to content

Commit

Permalink
Adds SPIDRV_ReInit for EUSART
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahay-silabs committed May 23, 2023
1 parent 80a279e commit d06645b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/platform/silabs/efr32/rs911x/hal/efx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ void rsi_hal_board_init(void)
}

#if defined(EFR32MG24)

void SPIDRV_ReInit(uint32_t baudrate)
{
if (EUSART_BaudrateGet(MY_USART) == baudrate)
{
// EUSART synced to baudrate already
return;
}
EUSART_BaudrateSet(MY_USART, 0, baudrate);
}

sl_status_t sl_wfx_host_spi_cs_assert()
{
// SILABS_LOG("%s started.", __func__);
Expand All @@ -181,12 +192,7 @@ sl_status_t sl_wfx_host_spi_cs_assert()
SILABS_LOG("%s errored.", __func__);
return SL_STATUS_TIMEOUT;
}
// if (spi_enabled)
// {
// SPIDRV_DeInit(SL_SPIDRV_HANDLE);
// SILABS_LOG("%s did deinit.", __func__);
// spi_enabled = false;
// }

if (!spi_enabled) // Reduce SPIDRV_Init
{
SPIDRV_Init(SL_SPIDRV_HANDLE, &sl_spidrv_eusart_init_exp);
Expand Down

0 comments on commit d06645b

Please sign in to comment.