Skip to content

Commit 8f9a838

Browse files
chirag-silabsmkardous-silabs
authored andcommitted
Merge SiWx917 and EFR32 uart source file
1 parent af00f18 commit 8f9a838

File tree

4 files changed

+117
-212
lines changed

4 files changed

+117
-212
lines changed

examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp

+41-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#include <stdlib.h>
2020
#include <string.h>
2121

22+
#if (SL_MATTER_GN_BUILD == 0)
23+
#include "sl_matter_wifi_config.h"
24+
#endif // SL_MATTER_GN_BUILD
25+
2226
#include "sl_status.h"
2327
#include <app/icd/server/ICDServerConfig.h>
2428
#include <inet/IPAddress.h>
@@ -52,9 +56,15 @@ extern "C" {
5256
#include "sl_si91x_m4_ps.h"
5357
}
5458

59+
namespace {
5560
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
5661
#define BUTTON_PRESSED 1
5762
bool btn0_pressed = false;
63+
64+
#ifdef ENABLE_CHIP_SHELL
65+
bool ps_requirement_added = false;
66+
#endif // ENABLE_CHIP_SHELL
67+
} // namespace
5868
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
5969

6070
#include "dhcp_client.h"
@@ -288,6 +298,26 @@ void sl_si91x_invoke_btn_press_event()
288298
{
289299
btn0_pressed = false;
290300
}
301+
302+
#ifdef ENABLE_CHIP_SHELL
303+
// Checking the UULP PIN 1 status to reinit the UART and not allow the device to go to sleep
304+
if (RSI_NPSSGPIO_GetPin(RTE_UULP_GPIO_1_PIN))
305+
{
306+
if (!ps_requirement_added)
307+
{
308+
sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS4);
309+
ps_requirement_added = true;
310+
}
311+
}
312+
else
313+
{
314+
if (ps_requirement_added)
315+
{
316+
sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS4);
317+
ps_requirement_added = false;
318+
}
319+
}
320+
#endif // ENABLE_CHIP_SHELL
291321
}
292322

293323
/******************************************************************
@@ -426,6 +456,16 @@ static sl_status_t wfx_rsi_init(void)
426456
ChipLogError(DeviceLayer, "sl_si91x_m4_ta_secure_handshake failed: 0x%lx", static_cast<uint32_t>(status));
427457
return status;
428458
}
459+
#ifdef ENABLE_CHIP_SHELL
460+
// While using the matter shell with the ICD server, the GPIO 1 is used to check the UULP PIN 1 status
461+
// since UART doesn't act as a wakeup source in the UULP mode
462+
/*Configuring the NPS GPIO 1*/
463+
RSI_NPSSGPIO_SetPinMux(RTE_UULP_GPIO_1_PIN, 0);
464+
/*Configure the NPSS GPIO direction to input */
465+
RSI_NPSSGPIO_SetDir(RTE_UULP_GPIO_1_PIN, 1);
466+
/*Enable the REN*/
467+
RSI_NPSSGPIO_InputBufferEn(RTE_UULP_GPIO_1_PIN, 1);
468+
#endif // ENABLE_CHIP_SHELL
429469
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
430470
#endif /* SLI_SI91X_MCU_INTERFACE */
431471

@@ -647,7 +687,7 @@ static sl_status_t wfx_rsi_do_join(void)
647687
case WFX_SEC_WPA3:
648688
ap.security = SL_WIFI_WPA3_TRANSITION;
649689
#else
650-
ap.security = SL_WIFI_WPA_WPA2_MIXED;
690+
ap.security = SL_WIFI_WPA_WPA2_MIXED;
651691
#endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION
652692
break;
653693
case WFX_SEC_NONE:

examples/platform/silabs/SiWx917/uart.cpp

-169
This file was deleted.

0 commit comments

Comments
 (0)