Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Refactors needed for M4 power save on SiWx917 (#177)" #181

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions matter/si91x/siwx917/BRD4338A/autogen/sl_event_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ void sl_platform_init(void) {
sli_si91x_platform_init();
RSI_Board_Init();
DEBUGINIT();
#if SL_ICD_ENABLED
#if SL_ICD_ENABLED && !(defined(DISPLAY_ENABLED))
sl_si91x_hardware_setup();
#endif // SL_ICD_ENABLED
#endif // SL_ICD_ENABLED && !(defined(DISPLAY_ENABLED)
osKernelInitialize();
}

Expand Down
68 changes: 68 additions & 0 deletions matter/si91x/siwx917/BRD4338A/support/inc/sl_si91x_m4_ps.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*****************************************************************************
* @file sl_si91x_m4_ps.h
* @brief M4 power save
*******************************************************************************
* # License
* <b>Copyright 2023 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* The licenser of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/

#ifndef SL_SI91X_M4_POWERSAVE_H_
#define SL_SI91X_M4_POWERSAVE_H_

#ifdef DEBUG_UART
#include "rsi_debug.h"
#endif
#ifdef SLI_SI91X_MCU_INTERFACE
#include "rsi_ds_timer.h"
#include "rsi_m4.h"
#include "rsi_rom_power_save.h"
#include "rsi_rom_timer.h"
#include "rsi_rom_ulpss_clk.h"
#include "rsi_rtc.h"
#include "rsi_wisemcu_hardware_setup.h"
#include "sl_event_handler.h"

/*=======================================================================*/
//! Power save command parameters
/*=======================================================================*/
//! set handshake type of power mode
#define RSI_HAND_SHAKE_TYPE M4_BASED
#define WIRELESS_WAKEUP_IRQ_PRI 8
#define portNVIC_SHPR3_REG (*((volatile uint32_t *)0xe000ed20))
#define portNVIC_PENDSV_PRI (((uint32_t)(0x3f << 4)) << 16UL)
#define portNVIC_SYSTICK_PRI (((uint32_t)(0x3f << 4)) << 24UL)

// -----------------------------------------------------------------------------
// Prototypes
/**
* @fn sl_si91x_m4_sleep_wakeup
* @brief Keeps the M4 In the Sleep
* @param[in] none
* @return none.
* @section description
* This function is used to trigger sleep in the M4 and in the case of the
* retention submitting the buffer valid to the TA for the rx packets.
*/
void sl_si91x_m4_sleep_wakeup(void);

/**
* @fn initialize_m4_alarm.
* @brief This function is to initialize Alarm block .
* @param[in] none
* @return none.
*/
void initialize_m4_alarm(void);
void IRQ026_Handler();
void set_alarm_interrupt_timer(uint16_t interval);
void wakeup_source_config(void);
#endif /* SLI_SI91X_MCU_INTERFACE */
#endif /* SL_SI91X_M4_POWERSAVE_H_ */
Loading
Loading