Skip to content

Commit

Permalink
Fix MAX32650 lp wrapper
Browse files Browse the repository at this point in the history
This commit adds the missing lp defines for MAX32650 for
the zephyr build system. The predefined macros were used
to access GCR and the shutdown function was enabled.

Signed-off-by: Burak Babaoglu <[email protected]>
  • Loading branch information
Burakbabao committed Feb 13, 2025
1 parent ee6d734 commit ca9dc13
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX32650/lp.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ void MXC_LP_EnterDeepSleepMode(void);
*/
void MXC_LP_EnterBackupMode(void);

/**
* @brief Places the device into SHUTDOWN mode. CPU state is not maintained in this mode, so this function never returns.
* Instead, the device will restart once an RTC, USB wakeup, or external interrupt occur.
*/
void MXC_LP_EnterShutDownMode(void);

/**
* @brief Places the USB block into its initial state where the operating current is at its minimum.
* This function must be called when the USB block is not used in order to achieve low power
Expand Down
9 changes: 9 additions & 0 deletions Libraries/PeriphDrivers/Source/LP/lp_me10.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,15 @@ void MXC_LP_EnterBackupMode(void)
while (1) {}
}

/* ************************************************************************** */
void MXC_LP_EnterShutDownMode(void)
{
MXC_GCR->pmr &= ~MXC_F_GCR_PMR_MODE;
MXC_GCR->pmr |= MXC_S_GCR_PMR_MODE_SHUTDOWN;

while (1) {}
}

/* ************************************************************************** */
void MXC_LP_USBClearPONRST(void)
{
Expand Down
3 changes: 2 additions & 1 deletion Libraries/zephyr/MAX/Include/wrap_max32_lp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ extern "C" {
*/
#if defined(CONFIG_SOC_MAX32665) || defined(CONFIG_SOC_MAX32666) || \
defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675)
defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || \
defined(CONFIG_SOC_MAX32650)

static inline void Wrap_MXC_LP_EnterLowPowerMode(void)
{
Expand Down

0 comments on commit ca9dc13

Please sign in to comment.