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

feat(PeriphDrivers): Implement low power modes for MAX32657 #1317

Merged
merged 7 commits into from
Jan 13, 2025

Conversation

ttmut
Copy link
Contributor

@ttmut ttmut commented Jan 3, 2025

Description

This PR updates MAX32657 low power API as listed below.

  1. Implement standby mode.
  2. Implement SRAM retention.
  3. Remove unsupported API functions.
  4. Update wrap_max32_lp.h to map wrapper functions to MAX32657 low power modes.
  5. Fixed position of Wake-up Timer wake enable bit.
  6. Moved 32K system clock source selection into sys_me30.c.

@github-actions github-actions bot added MAX32657 Related to the MAX32655 (ME30) Zephyr MSDK Zephyr related change. labels Jan 3, 2025
Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only semantics.

@ttmut
Copy link
Contributor Author

ttmut commented Jan 8, 2025

Only semantics.

Thanks for the feedback. Could you be more specific?

Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! Guess I didn't submit my comments with the review. Here is what I meant.

Comment on lines 91 to 106
/**
* @brief Enable retention regulator
*/
void MXC_LP_RetentionRegEnable(void);

/**
* @brief Disable retention regulator
*/
void MXC_LP_RetentionRegDisable(void);

/**
* @brief Is the retention regulator enabled
*
* @return 1 = enabled 0 = disabled
*/
int MXC_LP_RetentionRegIsEnabled(void);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put action verb at the beginning of the function name for tone to be consistent in the rest of the file.

/**
 * @brief      Enable retention regulator
 */
void MXC_LP_EnableRetentionReg(void);

/**
 * @brief      Disable retention regulator
 */
void MXC_LP_DisableRetentionReg(void);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MXC_LP_RetentionRegIsEnabled is fine. Didn't mean to include that function in the review window.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. Thanks.

@ttmut ttmut requested a review from sihyung-maxim January 9, 2025 06:32
Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, one last thing. Forgot that we need to update the copyrights for this new calendar year on all files we edit.

Copyright (C) 2024-2025 Analog Devices, Inc.

ttmut added 3 commits January 13, 2025 19:19
Added standby mode and SRAM retention. Unavailable features are removed.

Signed-off-by: Tahsin Mutlugun <[email protected]>
Update wrap_max32_lp.h to accomodate the low power modes of MAX32657.

Signed-off-by: Tahsin Mutlugun <[email protected]>
@ttmut
Copy link
Contributor Author

ttmut commented Jan 13, 2025

Sorry, one last thing. Forgot that we need to update the copyrights for this new calendar year on all files we edit.

Copyright (C) 2024-2025 Analog Devices, Inc.

Thanks for the reminder.

@ttmut ttmut requested a review from sihyung-maxim January 13, 2025 16:41
@ttmut ttmut added the WIP work in progress label Jan 13, 2025
@ttmut
Copy link
Contributor Author

ttmut commented Jan 13, 2025

Found a minor issue. Adding WIP label.

@ttmut ttmut marked this pull request as draft January 13, 2025 17:31
ttmut added 3 commits January 13, 2025 21:20
Fix GCR.PM register bit setting WUT as a wakeup source.

Signed-off-by: Tahsin Mutlugun <[email protected]>
RTC, WUTs, Timers and system can use a different input for 32KHz clock
based on a setting in MCR.CTRL register. Add a function to select the
input for 32KHz clock.

Signed-off-by: Tahsin Mutlugun <[email protected]>
32K clock is shared by RTC, WUTs, timers and system so it is better be
handled by the system driver.

Signed-off-by: Tahsin Mutlugun <[email protected]>
@github-actions github-actions bot added the Register Change This issue or pull request involves a change to the MSDK registers. label Jan 13, 2025
@ttmut ttmut removed the WIP work in progress label Jan 13, 2025
@ttmut ttmut marked this pull request as ready for review January 13, 2025 18:47
@sihyung-maxim sihyung-maxim merged commit c9a3d80 into main Jan 13, 2025
9 checks passed
@sihyung-maxim sihyung-maxim deleted the feat/me30_lp branch January 13, 2025 21:54
sihyung-maxim pushed a commit to analogdevicesinc/hal_adi that referenced this pull request Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX32657 Related to the MAX32655 (ME30) Register Change This issue or pull request involves a change to the MSDK registers. Zephyr MSDK Zephyr related change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants