Skip to content

Commit

Permalink
Adding the autogen and config updated file for the 917 soc (#207)
Browse files Browse the repository at this point in the history
* autogen and config update for power manager addition

* adding only sleeptimer defines for icd
  • Loading branch information
chirag-silabs authored Jun 27, 2024
1 parent 42b2803 commit 256bb77
Show file tree
Hide file tree
Showing 9 changed files with 705 additions and 3 deletions.
4 changes: 3 additions & 1 deletion matter/si91x/siwx917/BRD4338A/autogen/sl_component_catalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 11 additions & 2 deletions matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
}

Expand Down
1 change: 1 addition & 0 deletions matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/***************************************************************************//**
* @file sl_si91x_power_manager_handler.c.jinja
* @brief Power Manager Service Handler
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* 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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/***************************************************************************//**
* @file sl_si91x_power_manager_init.h.jinja
* @brief Power Manager Service Initialization
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/***************************************************************************//**
* @file sl_si91x_power_manager_wakeup_handler.c.jinja
* @brief Power Manager Service Wakeup Handler APIs
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* 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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/***************************************************************************//**
* @file sl_si91x_power_manager_wakeup_handler.h.jinja
* @brief Power Manager Service Wakeup Handler APIs
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* 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
Loading

0 comments on commit 256bb77

Please sign in to comment.