nrfcxx
0.1.0
C++-17 Framework for Nordic nRF5 Devices
|
Go to the documentation of this file. 144 static constexpr
state_type MS_ENTRY_ERRORED = 0x0012;
145 static constexpr
state_type MS_ERRORED = 0x0013;
146 static constexpr
state_type MS_ENTRY_FAILED = 0x0014;
147 static constexpr
state_type MS_FAILED = 0x0015;
148 static constexpr
state_type MS_ENTRY_STOPPED = 0x0016;
272 alarm_{alarm_callback_,
this}
438 state_machine machine_;
465 process_flags_type& pf)
static constexpr state_type MS_LOST
State indicating the machine entered processing in a state not supported by the machine.
Definition: lpm.hpp:130
void set_error()
Mark the current state with STATE_HAS_ERROR.
Definition: lpm.hpp:330
static constexpr state_type STATE_HAS_ERROR
Bit set in state_type when the machine is in an error state.
Definition: lpm.hpp:74
void set_state(state_type state, bool post=false)
Set the machine state.
Definition: lpm.hpp:307
bool blocking_alarm_pending() const
true iff the current state is marked with STATE_BLOCKING_ALARM.
Definition: lpm.hpp:372
static constexpr process_flags_type PF_OBSERVATION
lpsm_capable::lpsm_process() flag bit when a new observation is available.
Definition: lpm.hpp:248
int lpsm_process_rc() const
Get the internal result code from the last invocation of lpsm_process_().
Definition: lpm.hpp:545
static constexpr state_type MS_EXIT_SETUP
States available to guard exit from a setup step.
Definition: lpm.hpp:166
static constexpr process_flags_type PF_FAILED
Bit set in non-negative lpsm_capable::lpsm_process() result when the machine is in an unrecoverable f...
Definition: lpm.hpp:242
int lpsm_stop()
Definition: lpm.hpp:524
state_type full_state() const
Return the current machine state including error/pending flags.
Definition: lpm.hpp:296
virtual int lpsm_start()
Validate and prepare to initiate an LPM collection.
Core clock-related functionality.
int deadline() const
Read the deadline for the most recently scheduled alarm.
Definition: lpm.hpp:393
void set_error(error_type error)
Mark the current state with STATE_HAS_ERROR.
Definition: lpm.hpp:338
static constexpr process_flags_type PF_STARTED
lpsm_capable::lpsm_process() flag bit when the machine is ready to provide observations.
Definition: lpm.hpp:222
const lpm::state_machine & machine() const
Gain read-only access to the LPM machine state.
Definition: lpm.hpp:551
static constexpr process_flags_type PF_RESET
lpsm_capable::lpsm_process() flag bit when the machine has initiated a peripheral reset.
Definition: lpm.hpp:235
static constexpr state_type MS_SAMPLE
States available to implement a sample state.
Definition: lpm.hpp:192
static constexpr process_flags_type PF_OFF
lpsm_capable::lpsm_process() flag bit when the machine is turned off.
Definition: lpm.hpp:211
static constexpr state_type STATE_STOP_PENDING
Bit set in state_type when lpsm_capable::lpsm_stop() has been invoked by the application to request a...
Definition: lpm.hpp:110
static constexpr state_type MS_ENTRY_RESET
State available to indicate that the machine needs to executing an internal reset operation.
Definition: lpm.hpp:134
virtual int lpsm_sample()
Ask the LPM infrastructure to initiate a new sample.
unsigned int process_flags_type
Representation for flags returned from lpsm_capable::lpsm_process().
Definition: lpm.hpp:52
static constexpr state_type MS_OFF
State when the machine is off and all resources associated with it are disabled.
Definition: lpm.hpp:118
state_machine(notifier_type notify)
Create a state machine that records state and supports delayed transitions.
Definition: lpm.hpp:270
lpsm_capable(notifier_type notify)
Create a state machine that records state and supports delayed transitions.
Definition: lpm.hpp:434
static constexpr state_type MS_IDLE
State indicating the machine is in a functional state from which an application signal is required to...
Definition: lpm.hpp:176
void cancel_delay()
Cancel any delay initiated by set_delay().
state_type state() const
Return the current machine state excluding error/pending flags.
Definition: lpm.hpp:284
bool has_error() const
true iff the current state is marked with STATE_HAS_ERROR.
Definition: lpm.hpp:322
static constexpr state_type MS_APP_BASE
Base state value available for application-specific states.
Definition: lpm.hpp:204
lpm::state_machine::process_flags_type lpsm_process()
Make progress on an LPM collection.
std::function< void()> notifier_type
Type used to hold a notifier.
Definition: core.hpp:514
static constexpr state_type MS_ENTRY_START
State indicating the machine should begin automated transitions.
Definition: lpm.hpp:122
Class supporting an alarm with custom callback and repeatability.
Definition: clock.hpp:498
static constexpr state_type MS_EXIT_SAMPLE
States available to guard exit from a sample state.
Definition: lpm.hpp:201
void set_lost()
Set the current state as MS_LOST and store the unrecognized state in error().
Base (or mixin) class for anything that supports a state_machine.
Definition: lpm.hpp:426
State machine abstraction for time-delayed transitions and error captures.
Definition: lpm.hpp:36
void set_delay(int delay_utt)
Set an alarm to invoke post_event() after a delay.
unsigned int deadline() const
The value of (the low 32 bits of) uptime::now() at which the alarm should fire.
Definition: clock.hpp:767
virtual int lpsm_process_(int &delay, process_flags_type &pf)
Override to implement machine-specific operations of lpsm_process().
Definition: lpm.hpp:464
static constexpr state_type STATE_MASK
Mask isolating the bits of state_type that are available to record machine state.
Definition: lpm.hpp:65
static constexpr state_type STATE_BLOCKING_ALARM
Bit set in state_type when an alarm guarding entry to the configured state has not yet fired.
Definition: lpm.hpp:89
static constexpr state_type MS_ENTRY_SETUP
States available to guard entry to a setup state.
Definition: lpm.hpp:159
static constexpr state_type MS_ENTRY_SAMPLE
States available to guard entry to a sample state.
Definition: lpm.hpp:183
bool fallback_alarm_pending() const
true iff the current state is marked with STATE_FALLBACK_ALARM.
Definition: lpm.hpp:379
static constexpr process_flags_type PF_APP_BASE
First lpsm_capable::lpsm_process() flag bit available for application-specific result code bits.
Definition: lpm.hpp:255
void post_event()
Use the constructor-provided notifier to inform the application that the machine needs to be serviced...
Definition: lpm.hpp:386
virtual void lpsm_reset_()
Override to reset state that is held outside the machine.
Definition: lpm.hpp:471
static constexpr state_type MS_EXIT_RESET
State available to indicate that the machine is waiting to complete an internal reset operation.
Definition: lpm.hpp:142
static constexpr state_type STATE_FALLBACK_ALARM
Bit set in state_type when an alarm triggering post_event() has not yet fired.
Definition: lpm.hpp:106
void reset()
Cancel any pending transitions and restore the state to its as-constructed value.
Primary namespace for nrfcxx functionality.
Definition: clock.hpp:17
unsigned int state_type
Representation for both generic and specific machine state.
Definition: lpm.hpp:46
error_type error() const
Read the current error code.
Definition: lpm.hpp:365
int error_type
Representation for values stored in error().
Definition: lpm.hpp:58