Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
smf.h File Reference

State Machine Framework header file. More...

#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>

Go to the source code of this file.

Data Structures

struct  smf_state
 General state that can be used in multiple state machines. More...
 
struct  smf_ctx
 Defines the current context of the state machine. More...
 

Macros

#define SMF_CREATE_STATE(_entry, _run, _exit, _parent, _initial)
 Macro to create a hierarchical state with initial transitions.
 
#define SMF_CTX(o)
 Macro to cast user defined object to state machine context.
 

Typedefs

typedef void(* state_execution) (void *obj)
 Function pointer that implements a portion of a state.
 

Functions

void smf_set_initial (struct smf_ctx *ctx, const struct smf_state *init_state)
 Initializes the state machine and sets its initial state.
 
void smf_set_state (struct smf_ctx *ctx, const struct smf_state *new_state)
 Changes a state machines state.
 
void smf_set_terminate (struct smf_ctx *ctx, int32_t val)
 Terminate a state machine.
 
void smf_set_handled (struct smf_ctx *ctx)
 Tell the SMF to stop propagating the event to ancestors.
 
int32_t smf_run_state (struct smf_ctx *ctx)
 Runs one iteration of a state machine (including any parent states)
 

Detailed Description

State Machine Framework header file.