Developer World
Spresense Arduino Library v3.3.0-b2e6327
LowPowerClass Class Reference

This provides the features fo the power saving. More...

#include <LowPower.h>

Public Member Functions

void begin ()
 Initialize the Low Power library. More...
 
void end ()
 Finalize the Low Power library.
 
void sleep (uint32_t seconds)
 Sleep (yield) this thread. More...
 
void coldSleep ()
 Enter the cold sleep state.
 
void coldSleep (uint32_t seconds)
 Enter the cold sleep state during the specified seconds. More...
 
void deepSleep ()
 Enter the deep sleep state.
 
void deepSleep (uint32_t seconds)
 Enter the deep sleep state during the specified seconds. More...
 
void reboot ()
 Reboot the system.
 
bootcause_e bootCause ()
 Get the boot cause. More...
 
bool isEnabledBootCause (bootcause_e bc)
 Check if the specified cause is permitted or not. More...
 
bool isEnabledBootCause (uint8_t pin)
 Check if the cause by the specified pin is permitted or not. More...
 
void enableBootCause (bootcause_e bc)
 Enable the specified cause as the boot cause. More...
 
void enableBootCause (uint8_t pin)
 Enable the cause by the specified pin as the boot cause. More...
 
void disableBootCause (bootcause_e bc)
 Disable the specified cause as the boot cause. More...
 
void disableBootCause (uint8_t pin)
 Disable the cause by the specified pin as the boot cause. More...
 
uint8_t getWakeupPin (bootcause_e bc)
 Get a wakeup pin number from the boot cause. More...
 
void clockMode (clockmode_e mode)
 Set clock mode and change system clock dynamically. More...
 
clockmode_e getClockMode ()
 Get clock mode. More...
 
int getVoltage (void)
 Get the sensed battery voltage on CXD5247. More...
 
int getCurrent (void)
 Get the sensed battery current on CXD5247. More...
 

Detailed Description

This provides the features fo the power saving.

Member Function Documentation

◆ begin()

void LowPowerClass::begin ( )

Initialize the Low Power library.

This initializes RTC library, because this library uses the RTC library.

◆ sleep()

void LowPowerClass::sleep ( uint32_t  seconds)

Sleep (yield) this thread.

Parameters
[in]seconds- the sleep period

Just call the system call of sleep()

◆ coldSleep()

void LowPowerClass::coldSleep ( uint32_t  seconds)

Enter the cold sleep state during the specified seconds.

Parameters
[in]seconds- the period in cold sleep

◆ deepSleep()

void LowPowerClass::deepSleep ( uint32_t  seconds)

Enter the deep sleep state during the specified seconds.

Parameters
[in]seconds- the period in deep sleep

◆ bootCause()

bootcause_e LowPowerClass::bootCause ( )

Get the boot cause.

Returns
a boot cause

◆ isEnabledBootCause() [1/2]

bool LowPowerClass::isEnabledBootCause ( bootcause_e  bc)

Check if the specified cause is permitted or not.

Parameters
[in]bc- a boot cause
Returns
true if permitted, otherwise return false

◆ isEnabledBootCause() [2/2]

bool LowPowerClass::isEnabledBootCause ( uint8_t  pin)

Check if the cause by the specified pin is permitted or not.

Parameters
[in]pin- a pin number
Returns
true if permitted, otherwise return false

◆ enableBootCause() [1/2]

void LowPowerClass::enableBootCause ( bootcause_e  bc)

Enable the specified cause as the boot cause.

Parameters
[in]bc- a boot cause

◆ enableBootCause() [2/2]

void LowPowerClass::enableBootCause ( uint8_t  pin)

Enable the cause by the specified pin as the boot cause.

Parameters
[in]pin- a pin number

◆ disableBootCause() [1/2]

void LowPowerClass::disableBootCause ( bootcause_e  bc)

Disable the specified cause as the boot cause.

Parameters
[in]bc- a boot cause

◆ disableBootCause() [2/2]

void LowPowerClass::disableBootCause ( uint8_t  pin)

Disable the cause by the specified pin as the boot cause.

Parameters
[in]pin- a pin number

◆ getWakeupPin()

uint8_t LowPowerClass::getWakeupPin ( bootcause_e  bc)

Get a wakeup pin number from the boot cause.

Parameters
[in]bc- a boot cause
Returns
a pin number.

◆ clockMode()

void LowPowerClass::clockMode ( clockmode_e  mode)

Set clock mode and change system clock dynamically.

Parameters
[in]mode- the clock mode

◆ getClockMode()

clockmode_e LowPowerClass::getClockMode ( )

Get clock mode.

Returns
the clock mode

◆ getVoltage()

int LowPowerClass::getVoltage ( void  )

Get the sensed battery voltage on CXD5247.

Returns
sensed voltage [mV]

◆ getCurrent()

int LowPowerClass::getCurrent ( void  )

Get the sensed battery current on CXD5247.

Returns
sensed current [mA]. Negative value means discharge.
Attention
The returned value isn't time-averaged and just instantaneous value. Therefore, you can not get the strict current consumption. Please use this value as a guide.

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