nrfcxx  0.1.0
C++-17 Framework for Nordic nRF5 Devices
Public Member Functions
nrfcxx::board::power_monitor Class Reference

Support for the power source interface. More...

#include </tmp/nrfcxx/board/thingy52/include/nrfcxx/board/thingy52.hpp>

Inheritance diagram for nrfcxx::board::power_monitor:
nrfcxx::misc::lipo_monitor nrfcxx::misc::lipo_monitor nrfcxx::lpm::lpsm_capable nrfcxx::lpm::lpsm_capable

Public Member Functions

 power_monitor (notifier_type notify)
 Construct an instance. More...
 
 power_monitor (notifier_type notify)
 Construct an instance. More...
 
- Public Member Functions inherited from nrfcxx::misc::lipo_monitor
 lipo_monitor (notifier_type notify, const gpio::gpio_pin &vchg_detect, const gpio::gpio_pin &chgn_state, sensor::adc::voltage_divider &battmeas)
 Construct an instance. More...
 
bool vchg_detected_live ()
 Read the live USB detection signal.
 
bool charging_live ()
 Read the live charging signal.
 
int calibrate ()
 Initiate a calibration of the ADC used to measure voltage. More...
 
int batt_mV () const
 The most recently collected LiPo output voltage. More...
 
int power_source () const
 Get the latest processed power source. More...
 
- Public Member Functions inherited from nrfcxx::lpm::lpsm_capable
virtual int lpsm_start ()
 Validate and prepare to initiate an LPM collection. More...
 
virtual int lpsm_sample ()
 Ask the LPM infrastructure to initiate a new sample. More...
 
lpm::state_machine::process_flags_type lpsm_process ()
 Make progress on an LPM collection. More...
 
int lpsm_stop ()
 
int lpsm_reset ()
 
int lpsm_process_rc () const
 Get the internal result code from the last invocation of lpsm_process_(). More...
 
const lpm::state_machinemachine () const
 Gain read-only access to the LPM machine state.
 

Additional Inherited Members

- Public Types inherited from nrfcxx::misc::lipo_monitor
enum  PowerSource_e : uint8_t { PS_Unknown = 0, PS_OnBattery = 1, PS_Charging = 2, PS_Charged = 3 }
 State of power source as inferred from VCHG_DETECT and BAT_CHG_STAT signals. More...
 
- Static Public Attributes inherited from nrfcxx::misc::lipo_monitor
static constexpr auto PF_STARTED = lpm::state_machine::PF_STARTED
 
static constexpr auto PF_LIPO = lpm::state_machine::PF_APP_BASE
 Sensor-specific indication from lpm::lpsm_capable::lpsm_process() that a powered USB cable has been removed and the system is running from battery power.
 
static constexpr auto PF_MAINS = lpm::state_machine::PF_APP_BASE << 1
 Sensor-specific indication from lpm::lpsm_capable::lpsm_process() that a powered USB cable has been inserted and the system is running from mains power. More...
 
static constexpr auto PF_CHARGING = lpm::state_machine::PF_APP_BASE << 2
 Sensor-specific indication from lpm::lpsm_capable::lpsm_process() that the LiPo battery is being charged from a mains power source.
 
static constexpr auto PF_CHARGED = lpm::state_machine::PF_APP_BASE << 3
 Sensor-specific indication from lpm::lpsm_capable::lpsm_process() that the LiPo battery has completed charging.
 
static constexpr auto PF_CALIBRATED = lpm::state_machine::PF_APP_BASE << 5
 Sensor-specific indication from lpm::lpsm_capable::lpsm_process() that the battery voltage sensor has been calibrated.
 
- Protected Types inherited from nrfcxx::lpm::lpsm_capable
using state_type = state_machine::state_type
 
using process_flags_type = state_machine::process_flags_type
 
- Protected Member Functions inherited from nrfcxx::lpm::lpsm_capable
 lpsm_capable (notifier_type notify)
 Create a state machine that records state and supports delayed transitions. More...
 
virtual int lpsm_process_ (int &delay, process_flags_type &pf)
 Override to implement machine-specific operations of lpsm_process(). More...
 
virtual void lpsm_reset_ ()
 Override to reset state that is held outside the machine.
 
- Protected Attributes inherited from nrfcxx::lpm::lpsm_capable
state_machine machine_
 

Detailed Description

Support for the power source interface.

Constructor & Destructor Documentation

◆ power_monitor() [1/2]

nrfcxx::board::power_monitor::power_monitor ( notifier_type  notify)

Construct an instance.

Parameters
notifyas with misc::lipo_monitor::lipo_monitor()

◆ power_monitor() [2/2]

nrfcxx::board::power_monitor::power_monitor ( notifier_type  notify)

Construct an instance.

Parameters
notifyas with misc::lipo_monitor::lipo_monitor()

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