Skip to content

machine/rp2040: add machine.Sleep api #2276

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

soypat
Copy link
Contributor

@soypat soypat commented Nov 17, 2021

@aykevl @deadprogram @ysoldak PTAL! This is a new API addition to machine package. Provides a way to set processor in a low power state until an interrupt is triggered via a PinEvent.

// Sets raspberry pico in dormant state until interrupt event is triggered
// usage:
//  err := machine.Sleep(interruptPin, machine.PinRising)
// Above code will cause program to sleep until a high level signal
// is found on interruptPin. Be sure to configure pin as input beforehand.
// Taken from https://github.com/raspberrypi/pico-extras/ -> pico/sleep.h
func Sleep(pin Pin, change PinChange) error {
@soypat soypat changed the base branch from release to dev November 17, 2021 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant