#include <SwTimer.h>
Go to the source code of this file.
Data Structures | |
struct | actuator |
Typedefs | |
typedef void(* | zaf_actuator_callback_t) (struct actuator *pActuator) |
typedef struct actuator | s_Actuator |
typedef enum _eActuatorState | eActuatorState |
Enumerations | |
enum | _eActuatorState { EACTUATOR_NOT_CHANGING , EACTUATOR_CHANGING , EACTUATOR_FAILED } |
Functions | |
void | ZAF_Actuator_Init (s_Actuator *pActuator, uint8_t minValue, uint8_t maxValue, uint16_t refreshRate, uint8_t durationDefault, zaf_actuator_callback_t cc_callback) |
eActuatorState | ZAF_Actuator_Set (s_Actuator *pActuator, uint8_t value, uint8_t duration) |
eActuatorState | ZAF_Actuator_StartChange (s_Actuator *pActuator, bool ignoreStartLevel, bool upDown, uint8_t startLevel, uint8_t duration) |
eActuatorState | ZAF_Actuator_StopChange (s_Actuator *pActuator) |
uint8_t | ZAF_Actuator_GetCurrentValue (s_Actuator *pActuator) |
uint8_t | ZAF_Actuator_GetTargetValue (s_Actuator *pActuator) |
uint8_t | ZAF_Actuator_GetDurationRemaining (s_Actuator *pActuator) |
uint8_t | ZAF_Actuator_GetLastOnValue (s_Actuator *pActuator) |
uint32_t | getDurationInMs (uint8_t duration) |
uint8_t | ZAF_Actuator_GetMax (s_Actuator *pActuator) |
Actuator module. Manages all requests that transit from starting state to the end state during given time period.
ZAF_Actuator module can be used by any actuator command class. In current implementation, it's been used by Color Switch and Multilevel Switch command classes. Its purpose is to simplify implementation of actuator command classes, as well to provide single peace of code that will manage timed change on device. ZAF_Actuator is responsible for triggering any timed change, dealing with timers, stopping the change if needed, etc. In addition, this module knows data such as current value, target value, duration...
Command class that uses ZAF_Actuator module must contain s_Actuator data type. Before usage, ZAF_Actuator must be initialized by calling ZAF_Actuator_Init.