FastArduino  v1.7
C++ library to build fast but small Arduino/AVR projects
power::Power Class Reference

This class contains the API for handling power sleep modes. More...

#include <fastarduino/power.h>

Static Public Member Functions

static void set_default_mode (board::SleepMode mode)
 Set the default sleep mode, that will be used by next calls to Power::sleep() and time::yield(). More...
 
static void sleep ()
 Enter power sleep mode as defined by Power::set_default_mode(). More...
 
static void sleep (board::SleepMode mode)
 Enter a specific power sleep mode. More...
 

Detailed Description

This class contains the API for handling power sleep modes.

It is not aimed for instantiation, as all its methods are static.

Definition at line 39 of file power.h.

Member Function Documentation

◆ set_default_mode()

static void power::Power::set_default_mode ( board::SleepMode  mode)
inlinestatic

Set the default sleep mode, that will be used by next calls to Power::sleep() and time::yield().

Before this method is called, the default mode is set to board::SleepMode::IDLE.

See also
Power::sleep()
time::yield()

Definition at line 53 of file power.h.

◆ sleep() [1/2]

static void power::Power::sleep ( )
inlinestatic

Enter power sleep mode as defined by Power::set_default_mode().

This method will return only when MCU is awakened (the awakening signals depend on the selected sleep mode).

If you want your program to enter a different sleep mode than the default, you should call Power::sleep(board::SleepMode) instead.

See also
Power::set_default_mode()
Power::sleep(board::SleepMode)

Definition at line 69 of file power.h.

◆ sleep() [2/2]

static void power::Power::sleep ( board::SleepMode  mode)
inlinestatic

Enter a specific power sleep mode.

This method will return only when MCU is awakened (the awakening signals depend on the selected sleep mode).

If you want your program to enter the default sleep mode (as defined by Power::set_default_mode()), you should call Power::sleep() instead.

See also
Power::sleep()

Definition at line 84 of file power.h.


The documentation for this class was generated from the following files: