From 256bb77c094980316e342fa493df06ec652f060f Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:01:51 +0530 Subject: [PATCH] Adding the autogen and config updated file for the 917 soc (#207) * autogen and config update for power manager addition * adding only sleeptimer defines for icd --- .../BRD4338A/autogen/sl_component_catalog.h | 4 +- .../BRD4338A/autogen/sl_event_handler.c | 13 +- .../BRD4338A/autogen/sl_event_handler.h | 1 + .../autogen/sl_si91x_power_manager_handler.c | 96 +++++ .../autogen/sl_si91x_power_manager_init.h | 51 +++ .../sl_si91x_power_manager_wakeup_handler.c | 37 ++ .../sl_si91x_power_manager_wakeup_handler.h | 44 +++ .../config/sl_si91x_power_manager_config_3.h | 358 ++++++++++++++++++ ...si91x_power_manager_wakeup_source_config.h | 104 +++++ 9 files changed, 705 insertions(+), 3 deletions(-) create mode 100644 matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c create mode 100644 matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_init.h create mode 100644 matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.c create mode 100644 matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.h create mode 100644 matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_config_3.h create mode 100644 matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_wakeup_source_config.h diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_component_catalog.h b/matter/si91x/siwx917/BRD4338A/autogen/sl_component_catalog.h index ae943b3ecb..c8c2836739 100644 --- a/matter/si91x/siwx917/BRD4338A/autogen/sl_component_catalog.h +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_component_catalog.h @@ -24,10 +24,12 @@ #define SL_CATALOG_MEMORY_MANAGER_PRESENT #define SL_CATALOG_NVM3_PRESENT #define SL_CATALOG_SEGGER_RTT_PRESENT -#ifdef DISPLAY_ENABLED +#if defined(DISPLAY_ENABLED) || defined(SL_ICD_ENABLED) #define SL_CATALOG_SLEEPTIMER_PRESENT +#ifdef DISPLAY_ENABLED #define SL_CATALOG_DMD_MEMLCD_PRESENT #define SL_CATALOG_GLIB_PRESENT #endif // DISPLAY_ENABLED +#endif // DISPLAY_ENABLED || SL_ICD_ENABLED #endif // SL_COMPONENT_CATALOG_H diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c b/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c index 402e659ada..d38f61fd8e 100644 --- a/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c @@ -5,6 +5,11 @@ #include "sli_siwx917_soc.h" #include "rsi_board.h" #include "rsi_debug.h" +#if SL_ICD_ENABLED +#include "sl_si91x_power_manager.h" +#include "rsi_wisemcu_hardware_setup.h" +#include "sl_si91x_power_manager_init.h" +#endif // SL_ICD_ENABLED #include "SEGGER_RTT.h" #include "sl_sleeptimer.h" #include "sl_si91x_button_instances.h" @@ -40,9 +45,13 @@ void sl_driver_init(void) void sl_service_init(void) { -#ifdef DISPLAY_ENABLED +#if SL_ICD_ENABLED + sl_si91x_power_manager_init(); + sli_si91x_power_manager_configure_ram_and_peripheral(); +#endif // SL_ICD_ENABLED +#if defined(DISPLAY_ENABLED) || defined(SL_ICD_ENABLED) sl_sleeptimer_init(); -#endif +#endif // DISPLAY_ENABLED || SL_ICD_ENABLED sl_iostream_init_instances(); } diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.h b/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.h index e12b2e3cde..589cd59be2 100644 --- a/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.h +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.h @@ -7,5 +7,6 @@ void sl_driver_init(void); void sl_service_init(void); void sl_stack_init(void); void sl_internal_app_init(void); +void sl_iostream_init_instances(void); #endif // SL_EVENT_HANDLER_H diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c new file mode 100644 index 0000000000..6b5d512cb7 --- /dev/null +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_handler.c @@ -0,0 +1,96 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_handler.c.jinja + * @brief Power Manager Service Handler + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_si91x_power_manager.h" + +/***************************************************************************//** + * Check if the MCU can sleep at that time. This function is called when the system + * is about to go sleeping, with the interrupts disabled. It allows the software to + * cancel going to sleep in case of a last-minute event occurred (window between the + * function call and interrupt disable). + * + * @return True, if the system can go to sleep. + * False, otherwise. + * + * @note This function is called with the interrupt disabled and it MUST NOT be + * re-enabled. + ******************************************************************************/ +__WEAK boolean_t app_is_ok_to_sleep(void) +{ + return true; +} + +/***************************************************************************//** + * Check if the MCU can sleep after an interrupt. This function is called after an + * interrupt occured and was processed. It allows the power manger to know if it must + * go back to sleep or wakeup. + * + * @return SL_SI91X_POWER_MANAGER_IGNORE, if the module did not trigger an ISR and it + * won't to contribute to the decision. + * + * SL_SI91X_POWER_MANAGER_SLEEP, The module was the one that caused the system + * wakeup and the system SHOULD go back to sleep. + * + * SL_SI91X_POWER_MANAGER_WAKEUP, The module was the one that caused the system + * wakeup and the system MUST NOT go back to sleep. + * + * @note This function must not have any side effects. It is not guaranteed to be + * called for every ISR. If a prior hook function requires to wakeup, such + * as a wireless stack, the application hook function won't be called. + ******************************************************************************/ +__WEAK sl_si91x_power_manager_on_isr_exit_t app_sleep_on_isr_exit(void) +{ + return SL_SI91X_POWER_MANAGER_ISR_IGNORE; +} +/***************************************************************************//** + * Mandatory callback that must validate if the MCU can sleep after having + * processed an interrupt when the system was sleeping. + ******************************************************************************/ +boolean_t sl_si91x_power_manager_sleep_on_isr_exit(void) +{ + sl_si91x_power_manager_on_isr_exit_t answer; + boolean_t sleep = false; + boolean_t force_wakeup = false; + + + // Application hook + answer = app_sleep_on_isr_exit(); + if (answer == SL_SI91X_POWER_MANAGER_ISR_WAKEUP) { + force_wakeup = true; + } else if (answer == SL_SI91X_POWER_MANAGER_ISR_SLEEP) { + sleep = true; + } + + if (force_wakeup) { + sleep = false; + } + + return sleep; +} diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_init.h b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_init.h new file mode 100644 index 0000000000..46c4fd1bb5 --- /dev/null +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_init.h @@ -0,0 +1,51 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_init.h.jinja + * @brief Power Manager Service Initialization + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_POWER_MANAGER_INIT_H +#define SL_SI91X_POWER_MANAGER_INIT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_power_manager_config_3.h" + + +__STATIC_INLINE void sli_si91x_power_manager_configure_ram_and_peripheral(void) +{ + sl_si91x_power_manager_remove_peripheral_requirement(&peripheral_config); + sl_si91x_power_manager_configure_ram_retention(&ram_configuration); +} + +#ifdef __cplusplus +} +#endif + +#endif // SL_SI91X_POWER_MANAGER_INIT_H \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.c b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.c new file mode 100644 index 0000000000..fa91ca86a5 --- /dev/null +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.c @@ -0,0 +1,37 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_wakeup_handler.c.jinja + * @brief Power Manager Service Wakeup Handler APIs + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ +#include "sl_si91x_power_manager_wakeup_handler.h" + +sl_status_t sl_si91x_power_manager_wakeup_init(void) +{ + sl_status_t status=SL_STATUS_OK; + + return status; +} \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.h b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.h new file mode 100644 index 0000000000..86b7c5d4dc --- /dev/null +++ b/matter/si91x/siwx917/BRD4338A/autogen/sl_si91x_power_manager_wakeup_handler.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_wakeup_handler.h.jinja + * @brief Power Manager Service Wakeup Handler APIs + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ +#ifndef SL_SI91X_POWER_MANAGER_WAKEUP_HANDLER_H +#define SL_SI91X_POWER_MANAGER_WAKEUP_HANDLER_H + +#include "sl_status.h" + + + +#include "sl_si91x_power_manager_wakeup_source_config.h" + + +sl_status_t sl_si91x_power_manager_wakeup_init(void); + + + +#endif // SL_SI91X_POWER_MANAGER_WAKEUP_HANDLER_H \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_config_3.h b/matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_config_3.h new file mode 100644 index 0000000000..3becf17434 --- /dev/null +++ b/matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_config_3.h @@ -0,0 +1,358 @@ +/***************************************************************************/ /** + * @file sl_si91x_power_manager_config_3.h + * @brief Power Manager Configuration NWP Basic and MCU Advance RAM Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_POWER_MANAGER_CONFIG_3_H +#define SL_SI91X_POWER_MANAGER_CONFIG_3_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_power_manager.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// Peripheral Configuration + +// High Power Peripherals +// M4 DEBUG +// Default: 1 +#define SL_HP_M4_DEBUG_PERIPHERAL 1 + +// QSPI +// Default: 1 +#define SL_HP_QSPI_PERIPHERAL 1 + +// RPDMA +// Default: 1 +#define SL_HP_RPDMA_PERIPHERAL 1 + +// SDIO SPI +// Default: 1 +#define SL_HP_SDIO_SPI_PERIPHERAL 1 +// + +// Low Power Peripherals +// ULP AUX +// Default: 1 +#define SL_ULP_AUX_PERIPHERAL 1 + +// ULP CAPACITIVE TOUCH +// Default: 1 +#define SL_ULP_CAP_PERIPHERAL 1 + +// ULP FIM +// Default: 1 +#define SL_ULP_FIM_PERIPHERAL 1 + +// ULP I2C +// Default: 1 +#define SL_ULP_I2C_PERIPHERAL 1 + +// ULP I2S +// Default: 1 +#define SL_ULP_I2S_PERIPHERAL 1 + +// ULP IR +// Default: 1 +#define SL_ULP_IR_PERIPHERAL 1 + +// ULP SSI +// Default: 1 +#define SL_ULP_SSI_PERIPHERAL 1 + +// ULP UART +// Default: 1 +#define SL_ULP_UART_PERIPHERAL 1 + +// ULP UDMA +// Default: 1 +#define SL_ULP_UDMA_PERIPHERAL 1 +// + +// Ultra Low Power Peripherals +// MCU STORE 1 +// Default: 1 +#define SL_UULP_MCU_STORE1_PERIPHERAL 1 + +// MCU STORE 2 +// Default: 1 +#define SL_UULP_MCU_STORE2_PERIPHERAL 1 + +// MCU STORE 3 +// Default: 1 +#define SL_UULP_MCU_STORE3_PERIPHERAL 1 + +// RTC (CALENDAR) +// Default: 1 +#define SL_UULP_RTC_PERIPHERAL 1 + +// TIME PERIOD +// Default: 1 +#define SL_UULP_TIME_PERIOD_PERIPHERAL 1 + +// UPS +// Default: 1 +#define SL_UULP_UPS_PERIPHERAL 1 + +// UTS +// Default: 1 +#define SL_UULP_UTS_PERIPHERAL 1 + +// WATCHDOG TIMER +// Default: 1 +#define SL_UULP_WDT_PERIPHERAL 1 +// + +// + +// RAM Configuration + +// Configure RAM Banks using Size +#define SL_RAM_RETENTION_USING_SIZE 1 + +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_1 4 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_2 8 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_3 12 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_4 16 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_5 32 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_6 64 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_7 128 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_8 192 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_9 256 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_10 320 +// Low Power Ram Retention Size (in KB) +// 4 KB +// 8 KB +// 12 KB +// 16 KB +// 32 KB +// 64 KB +// 128 KB +// 192 KB +// 256 KB +// 320 KB +// Selection of LP RAM Retention Size +#define SL_LP_RAM_RETENTION_SIZE SL_LP_RAM_RETENTION_USING_SIZE_BANK_10 + +#define SL_ULP_RAM_RETENTION_USING_SIZE_BANK_1 2 +#define SL_ULP_RAM_RETENTION_USING_SIZE_BANK_2 4 +// Ultra Low Power Ram Retention Size (in KB) +// 2 KB +// 4 KB +// Selection of ULP RAM Retention Size +#define SL_ULP_RAM_RETENTION_SIZE SL_ULP_RAM_RETENTION_USING_SIZE_BANK_2 +// + +// Configure RAM Banks using Bank Number +#define SL_RAM_RETENTION_USING_NUMBER 0 +// LOW POWER RAM BANK 1 +// Default: 1 +#define SL_LP_RAM_BANK1 1 + +// LOW POWER RAM BANK 2 +// Default: 1 +#define SL_LP_RAM_BANK2 1 + +// LOW POWER RAM BANK 3 +// Default: 1 +#define SL_LP_RAM_BANK3 1 + +// LOW POWER RAM BANK 4 +// Default: 1 +#define SL_LP_RAM_BANK4 1 + +// LOW POWER RAM BANK 5 +// Default: 1 +#define SL_LP_RAM_BANK5 1 + +// LOW POWER RAM BANK 6 +// Default: 1 +#define SL_LP_RAM_BANK6 1 + +// LOW POWER RAM BANK 7 +// Default: 1 +#define SL_LP_RAM_BANK7 1 + +// LOW POWER RAM BANK 8 +// Default: 1 +#define SL_LP_RAM_BANK8 1 + +// LOW POWER RAM BANK 9 +// Default: 1 +#define SL_LP_RAM_BANK9 1 + +// LOW POWER RAM BANK 10 +// Default: 1 +#define SL_LP_RAM_BANK10 1 + +// ULTRA LOW POWER RAM BANK 2 +// Default: 1 +#define SL_ULP_RAM_BANK2 1 + +// ULTRA LOW POWER RAM BANK 3 +// Default: 1 +#define SL_ULP_RAM_BANK3 1 +// + +// + +// <<< end of configuration section >>> + +sl_power_peripheral_t peripheral_config = { + .m4ss_peripheral = (0 +#if (SL_HP_M4_DEBUG_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_M4_DEBUG +#endif +#if (SL_HP_RPDMA_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_RPDMA +#endif +#if (SL_HP_QSPI_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_QSPI +#endif +#if (SL_HP_SDIO_SPI_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_SDIO_SPI +#endif + ), + .ulpss_peripheral = (0 +#if (SL_ULP_AUX_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_AUX +#endif +#if (SL_ULP_CAP_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_CAP +#endif +#if (SL_ULP_FIM_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_FIM +#endif +#if (SL_ULP_I2C_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_I2C +#endif +#if (SL_ULP_I2S_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_I2S +#endif +#if (SL_ULP_IR_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_IR +#endif +#if (SL_ULP_SSI_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_SSI +#endif +#if (SL_ULP_UART_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_UART +#endif +#if (SL_ULP_UDMA_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_UDMA +#endif + ), + .npss_peripheral = (0 +#if (SL_UULP_MCU_STORE1_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUSTORE1 +#endif +#if (SL_UULP_MCU_STORE2_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUSTORE2 +#endif +#if (SL_UULP_MCU_STORE3_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUSTORE3 +#endif +#if (SL_UULP_RTC_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCURTC +#endif +#if (SL_UULP_TIME_PERIOD_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_TIMEPERIOD +#endif +#if (SL_UULP_UPS_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUPS +#endif +#if (SL_UULP_UTS_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUTS +#endif +#if (SL_UULP_WDT_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUWDT +#endif + ), +}; + +sl_power_ram_retention_config_t ram_configuration = { +#if (SL_RAM_RETENTION_USING_SIZE == 1) + .configure_ram_banks = false, + .m4ss_ram_size_kb = SL_LP_RAM_RETENTION_SIZE, + .ulpss_ram_size_kb = SL_ULP_RAM_RETENTION_SIZE, +#else + .configure_ram_banks = true, + .m4ss_ram_banks = (0 +#if (SL_LP_RAM_BANK1 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_1 +#endif +#if (SL_LP_RAM_BANK2 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_2 +#endif +#if (SL_LP_RAM_BANK3 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_3 +#endif +#if (SL_LP_RAM_BANK3 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_3 +#endif +#if (SL_LP_RAM_BANK4 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_4 +#endif +#if (SL_LP_RAM_BANK5 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_5 +#endif +#if (SL_LP_RAM_BANK6 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_6 +#endif +#if (SL_LP_RAM_BANK7 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_7 +#endif +#if (SL_LP_RAM_BANK8 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_8 +#endif +#if (SL_LP_RAM_BANK9 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_9 +#endif +#if (SL_LP_RAM_BANK10 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_10 +#endif + ), + .ulpss_ram_banks = (0 +#if (SL_ULP_RAM_BANK2 == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_RAM_BANK_2 +#endif +#if (SL_ULP_RAM_BANK3 == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_RAM_BANK_3 +#endif + ), +#endif +}; + +#ifdef __cplusplus +} +#endif + +#endif // SL_SI91X_POWER_MANAGER_CONFIG_3_H diff --git a/matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_wakeup_source_config.h b/matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_wakeup_source_config.h new file mode 100644 index 0000000000..43838bf786 --- /dev/null +++ b/matter/si91x/siwx917/BRD4338A/config/sl_si91x_power_manager_wakeup_source_config.h @@ -0,0 +1,104 @@ +/***************************************************************************/ /** + * @file sl_si91x_power_manager_wakeup_source_config.h + * @brief Power Manager Wakeup Source Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_POWER_MANAGER_WAKEUP_SOURCE_CONFIG_H +#define SL_SI91X_POWER_MANAGER_WAKEUP_SOURCE_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// Calendar Wakeup +#define SL_ENABLE_CALENDAR_WAKEUP_SOURCE 0 + +// Enable Second Wakeup Source +// Default: 0 +#define ENABLE_SECOND 0 + +// Enable Alarm Wakeup Source +// Default: 1 +#define ENABLE_ALARM 0 + +// Enable Milli Second Wakeup Source +// Default: 0 +#define ENABLE_MSEC 0 + +// Alarm Time (in milliseconds) +// Default: 5000 +#define ALARM_TIME_MSEC 5000 + +// + +// GPIO Wakeup +#define SL_ENABLE_GPIO_WAKEUP_SOURCE 0 + +// Enable NPSS GPIO 0 +// Default: 0 +#define ENABLE_NPSS_GPIO_0 0 + +// Enable NPSS GPIO 1 +// Default: 0 +#define ENABLE_NPSS_GPIO_1 0 + +// Enable NPSS GPIO 2 +// Default: 0 +#define ENABLE_NPSS_GPIO_2 0 + +// Enable NPSS GPIO 3 +// Default: 0 +#define ENABLE_NPSS_GPIO_3 0 +// + +// WDT Wakeup +#define SL_ENABLE_WDT_WAKEUP_SOURCE 0 +// + +// Deep Sleep Timer Wakeup +#define SL_ENABLE_DST_WAKEUP_SOURCE 0 + +// Sleep Time (in microseconds) +// Default: 500 +#define DST_WAKEUP_TIME 500 + +// + +// Wireless Wakeup +#define SL_ENABLE_WIRELESS_WAKEUP_SOURCE 0 +// + +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif + +#endif // SL_SI91X_POWER_MANAGER_WAKEUP_SOURCE_CONFIG_H