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

Improve API for switching to low-power modes #3

Open
hannobraun opened this issue Nov 27, 2017 · 3 comments
Open

Improve API for switching to low-power modes #3

hannobraun opened this issue Nov 27, 2017 · 3 comments

Comments

@hannobraun
Copy link
Member

The current Pmu API only support switching to sleep mode. All other low-power modes should be supported as well.

I think there's also some potential for embedded-hal here. I'd like to expore the possibility of creating a trait, PowerMode, and implementing this trait for each supported power mode.

That trait could live in embedded-hal. The sleep module could be updated to depend on PowerMode instead of depending on Pmu directly.

@hannobraun
Copy link
Member Author

hannobraun commented Feb 19, 2018

There's a problem with LowPowerClock: It starts with clock::state::Disabled, but that may be wrong, as we can't know what happened before the HAL was initialized.

I'm not sure if that leads to any actual problems, but it's at the very least misleading. Maybe it would be best to add a third clock state, Unknown, and start with that.

Edit: This comment has been resolved in the meantime.

@hannobraun
Copy link
Member Author

I've added support for additional low-power modes in #106.

@hannobraun
Copy link
Member Author

Before trying to design anything that can be submitted to embedded-hal, at least #108, #109, and #110 should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant