35
35
#include "em_gpio.h"
36
36
#include "em_ldma.h"
37
37
#include "gpiointerrupt.h"
38
- #include "sl_board_control.h"
39
38
#include "sl_device_init_clocks.h"
40
39
#include "sl_device_init_hfxo.h"
41
40
#include "sl_spidrv_instances.h"
47
46
#include "wfx_host_events.h"
48
47
#include "wfx_rsi.h"
49
48
49
+ #ifdef SL_BOARD_NAME
50
+ #include "sl_board_control.h"
51
+ #endif // SL_BOARD_NAME
52
+
50
53
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT )
51
54
#include "sl_power_manager.h"
52
55
#endif
65
68
#include "sl_mx25_flash_shutdown_usart_config.h"
66
69
#endif // SL_MX25CTRL_MUX
67
70
68
- #if defined(EFR32MG24 )
69
71
#include "em_eusart.h"
70
72
#include "sl_spidrv_eusart_exp_config.h"
71
73
#include "spi_multiplex.h"
72
- #else
73
- #error "Unknown platform"
74
- #endif
75
74
76
- #if defined(EFR32MG24 )
77
75
#define SL_SPIDRV_HANDLE sl_spidrv_eusart_exp_handle
78
76
#define SL_SPIDRV_EXP_BITRATE_MULTIPLEXED SL_SPIDRV_EUSART_EXP_BITRATE
79
- #endif
80
77
81
78
#define CONCAT (A , B ) (A##B)
82
79
#define SPI_CLOCK (N ) CONCAT(cmuClock_USART, N)
@@ -113,10 +110,8 @@ void sl_wfx_host_gpio_init(void)
113
110
// Enable GPIO clock.
114
111
CMU_ClockEnable (cmuClock_GPIO , true);
115
112
116
- #if defined(EFR32MG24 )
117
113
// Set CS pin to high/inactive
118
114
GPIO_PinModeSet (SL_SPIDRV_EUSART_EXP_CS_PORT , SL_SPIDRV_EUSART_EXP_CS_PIN , gpioModePushPull , PINOUT_SET );
119
- #endif // EFR32MG24
120
115
121
116
GPIO_PinModeSet (WFX_RESET_PIN .port , WFX_RESET_PIN .pin , gpioModePushPull , PINOUT_SET );
122
117
GPIO_PinModeSet (WFX_SLEEP_CONFIRM_PIN .port , WFX_SLEEP_CONFIRM_PIN .pin , gpioModePushPull , PINOUT_CLEAR );
@@ -195,9 +190,7 @@ sl_status_t sl_wfx_host_spi_cs_assert(void)
195
190
if (!spi_enabled ) // Reduce sl_spidrv_init_instances
196
191
{
197
192
sl_spidrv_init_instances ();
198
- #if defined(EFR32MG24 )
199
193
GPIO_PinOutClear (SL_SPIDRV_EUSART_EXP_CS_PORT , SL_SPIDRV_EUSART_EXP_CS_PIN );
200
- #endif // EFR32MG24
201
194
spi_enabled = true;
202
195
}
203
196
return SL_STATUS_OK ;
@@ -211,10 +204,8 @@ sl_status_t sl_wfx_host_spi_cs_deassert(void)
211
204
status = SPIDRV_DeInit (SL_SPIDRV_HANDLE );
212
205
if (SL_STATUS_OK == status )
213
206
{
214
- #if defined(EFR32MG24 )
215
207
GPIO_PinOutSet (SL_SPIDRV_EUSART_EXP_CS_PORT , SL_SPIDRV_EUSART_EXP_CS_PIN );
216
208
GPIO -> EUSARTROUTE [SL_SPIDRV_EUSART_EXP_PERIPHERAL_NO ].ROUTEEN = PINOUT_CLEAR ;
217
- #endif // EFR32MG24
218
209
spi_enabled = false;
219
210
}
220
211
}
0 commit comments