forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Silabs] Adds fix for BTN low power mode for SiWx917 SoC and power ma…
…nager (project-chip#35808) * Decouple UART power requirement handler * Adds refactored BTN handler based on power manager * Fixed incorrect API * Adds changes for interrupt * Replace use of RSI_xx APIs with sl_si91x_xx APIs * Refactor button event handling and UART power requirement handler * Adds comments based on the coding standards Reduce into inline functions * Renaming sl_btn0 -> btn0 * Adds changes to optimize code * Adds CPP define in header * Update function comments * Replace with more readable condition * Updates document to add BTN0 screen cycle action (project-chip#323) * Restyled by prettier-markdown * Adds compilation fix for EFR32 boards * Addressing comments --------- Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
Showing
16 changed files
with
117 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* | ||
* Copyright (c) 2024 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <app/icd/server/ICDServerConfig.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
#if CHIP_CONFIG_ENABLE_ICD_SERVER | ||
#if SLI_SI91X_MCU_INTERFACE | ||
#include "sl_si91x_button.h" | ||
#include "sl_si91x_button_pin_config.h" | ||
#include "sl_si91x_driver_gpio.h" | ||
/** | ||
* @brief invoked when button press event is received when in sleep | ||
* @param[in] pin_intr GPIO pin interrupt number. | ||
* @return none. | ||
* @note this is a callback from the Wiseconnect SDK | ||
*/ | ||
void gpio_uulp_pin_interrupt_callback(uint32_t pin_intr); | ||
#endif // SLI_SI91X_MCU_INTERFACE | ||
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
namespace chip { | ||
namespace DeviceLayer { | ||
namespace Silabs { | ||
namespace SiWxPlatformInterface { | ||
|
||
#if CHIP_CONFIG_ENABLE_ICD_SERVER | ||
#if SLI_SI91X_MCU_INTERFACE | ||
/** | ||
* @brief Required to invoke button press event during sleep as falling edge is not detected | ||
* @param[in] none. | ||
* @note flow is GPIO wakeup due to BTN0 press -> check button state in idle task required as the GPIO interrupt is not | ||
* detected during sleep for BUTTON RELEASED | ||
*/ | ||
inline void sl_si91x_btn_event_handler() | ||
{ | ||
sl_button_on_change(SL_BUTTON_BTN0_NUMBER, | ||
(sl_si91x_gpio_get_uulp_npss_pin(SL_BUTTON_BTN0_PIN) == LOW) ? BUTTON_PRESSED : BUTTON_RELEASED); | ||
} | ||
|
||
/** | ||
* @brief Required to enable MATTER shell UART with ICD feature flag | ||
* @param[in] none. | ||
* @note this requires hardware jumping of the GPIO PINs to work with the baseboard. | ||
*/ | ||
void sl_si91x_uart_power_requirement_handler(); | ||
#endif // SLI_SI91X_MCU_INTERFACE | ||
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER | ||
} // namespace SiWxPlatformInterface | ||
} // namespace Silabs | ||
} // namespace DeviceLayer | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters