2023-07-11 13:10:15 +00:00
|
|
|
/**
|
|
|
|
* @author ${author}
|
|
|
|
* @version 1.0.0
|
|
|
|
* @date ${date}
|
|
|
|
* @file ${filename_lc}.h
|
|
|
|
*/
|
|
|
|
#ifndef ${filename}_H
|
|
|
|
#define ${filename}_H
|
|
|
|
|
|
|
|
#include "../xf/xf.h"
|
|
|
|
|
|
|
|
typedef enum {
|
2023-07-11 17:27:51 +00:00
|
|
|
ST${fn}_INIT,
|
2023-07-11 13:10:15 +00:00
|
|
|
${STATES_ENUM}
|
|
|
|
} ${filename}_STATES;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
${EVENTS_ENUM}
|
|
|
|
} ${filename}_EVENTS;
|
|
|
|
|
2023-07-11 21:40:12 +00:00
|
|
|
typedef void (*${filename}_CALLBACK_FUNCTION)(void*);
|
|
|
|
typedef struct {
|
|
|
|
${filename}_CALLBACK_FUNCTION f; // function
|
|
|
|
void* p; // param(s)
|
|
|
|
} ${filename}_CALLBACK;
|
|
|
|
|
2023-07-11 13:10:15 +00:00
|
|
|
typedef struct {
|
|
|
|
${filename}_STATES state;
|
2023-07-11 13:47:07 +00:00
|
|
|
${VARS_STRUCT}
|
2023-07-11 21:40:12 +00:00
|
|
|
${STATES_CBS_STRUCT}
|
2023-07-11 13:10:15 +00:00
|
|
|
} ${filename};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the ${filename}
|
|
|
|
* @param me the ${filename} itself
|
|
|
|
*/
|
|
|
|
void ${filename}_init(${filename}* me);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start the ${filename} state machine
|
|
|
|
* @param me the ${filename} itself
|
|
|
|
*/
|
|
|
|
void ${filename}_startBehaviour(${filename}* me);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Process the event
|
|
|
|
* @param ev the event to process
|
|
|
|
* @return true if the event is processed
|
|
|
|
*/
|
|
|
|
bool ${filename}_processEvent(Event* ev);
|
|
|
|
|
2023-07-11 21:40:12 +00:00
|
|
|
/*************
|
|
|
|
* Callbacks *
|
|
|
|
*************/
|
|
|
|
|
|
|
|
${CALLBACKS_DEC}
|
|
|
|
|
2023-07-11 13:10:15 +00:00
|
|
|
/************
|
|
|
|
* EMITTERS *
|
|
|
|
************/
|
|
|
|
|
|
|
|
${EVENTS_EMITS_DEC}
|
|
|
|
|
2023-07-11 13:47:07 +00:00
|
|
|
/***********
|
|
|
|
* SETTERS *
|
|
|
|
***********/
|
|
|
|
|
|
|
|
${VARS_SETTERS_DEC}
|
|
|
|
|
2023-07-11 13:10:15 +00:00
|
|
|
#endif
|