diff --git a/examples/platform/silabs/efr32/spi_multiplex.c b/examples/platform/silabs/efr32/spi_multiplex.c index ce81265c6479a9..26e36c4aab7166 100644 --- a/examples/platform/silabs/efr32/spi_multiplex.c +++ b/examples/platform/silabs/efr32/spi_multiplex.c @@ -15,6 +15,8 @@ * limitations under the License. */ +#if defined(EFR32MG24) + #include "dmadrv.h" #include "em_bus.h" #include "em_cmu.h" @@ -41,3 +43,5 @@ void SPIDRV_ReInit(uint32_t baudrate) USART_InitSync(USART0, &usartInit); } + +#endif /* EFR32MG24 */ \ No newline at end of file diff --git a/examples/platform/silabs/efr32/spi_multiplex.h b/examples/platform/silabs/efr32/spi_multiplex.h index 29e304afc61ae7..8a6a175c6db73b 100644 --- a/examples/platform/silabs/efr32/spi_multiplex.h +++ b/examples/platform/silabs/efr32/spi_multiplex.h @@ -17,21 +17,22 @@ #pragma once +#if defined(EFR32MG24) #ifdef __cplusplus extern "C" { #endif #include "FreeRTOS.h" #include "semphr.h" #include "sl_mx25_flash_shutdown_usart_config.h" -#ifdef WF200_WIFI +#if (defined(EFR32MG24) && defined(WF200_WIFI)) #include "sl_spidrv_exp_config.h" -#endif -#ifdef RS911X_WIFI +#endif /* EFR32MG24 && WF200_WIFI */ +#if (defined(EFR32MG24) && defined(RS911X_WIFI)) #include "sl_spidrv_eusart_exp_config.h" -#endif +#endif /* EFR32MG24 && RS911X_WIFI */ #if (defined(EFR32MG24) && defined(WF200_WIFI)) #include "sl_wfx_host_api.h" -#endif +#endif /* EFR32MG24 && WF200_WIFI */ #include "em_eusart.h" #include "spidrv.h" @@ -161,3 +162,4 @@ void sl_wfx_host_post_uart_transfer(void); #ifdef __cplusplus } #endif +#endif /* EFR32MG24 */ \ No newline at end of file diff --git a/examples/platform/silabs/efr32/wf200/efr_spi.c b/examples/platform/silabs/efr32/wf200/efr_spi.c index 0ee3f8baf03ba8..78987eedb72b3a 100644 --- a/examples/platform/silabs/efr32/wf200/efr_spi.c +++ b/examples/platform/silabs/efr32/wf200/efr_spi.c @@ -39,7 +39,6 @@ #include "gpiointerrupt.h" -#include "sl_spidrv_exp_config.h" #include "sl_wfx_board.h" #include "sl_wfx_host.h" #include "sl_wfx_task.h" @@ -49,8 +48,14 @@ #include "sl_power_manager.h" #endif -#if SL_WIFI +#if defined(EFR32MG12) +#include "sl_spidrv_exp_config.h" +extern SPIDRV_Handle_t sl_spidrv_exp_handle; +#define SL_SPIDRV_HANDLE sl_spidrv_exp_handle +#elif defined(EFR32MG24) #include "spi_multiplex.h" +#else +#error "Unknown platform" #endif #define USART SL_WFX_HOST_PINOUT_SPI_PERIPHERAL @@ -133,7 +138,9 @@ sl_status_t sl_wfx_host_spi_cs_assert() { return SL_STATUS_TIMEOUT; } +#if defined(EFR32MG24) SPIDRV_ReInit(SL_BIT_RATE_EXP_HDR); +#endif /* EFR32MG24 */ GPIO_PinOutClear(SL_SPIDRV_EXP_CS_PORT, SL_SPIDRV_EXP_CS_PIN); return SL_STATUS_OK; } @@ -365,6 +372,7 @@ void sl_wfx_host_gpio_init(void) NVIC_SetPriority(GPIO_ODD_IRQn, 5); } +#if defined(EFR32MG24) void sl_wfx_host_spiflash_cs_assert(void) { GPIO_PinOutClear(SL_MX25_FLASH_SHUTDOWN_CS_PORT, SL_MX25_FLASH_SHUTDOWN_CS_PIN); @@ -441,3 +449,4 @@ void sl_wfx_host_post_uart_transfer(void) sl_wfx_host_enable_platform_interrupt(); sl_wfx_enable_irq(); } +#endif /* EFR32MG24 */ \ No newline at end of file