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) |
typedef enum _eActuatorState eActuatorState |
Return type for Actuator functions that can trigger changes that require some time to be done.
typedef struct actuator s_Actuator |
The structure of Actuator module
typedef void(* zaf_actuator_callback_t) (struct actuator *pActuator) |
enum _eActuatorState |
uint32_t getDurationInMs | ( | uint8_t | duration | ) |
Converts coded duration into milliseconds format, refer to CC:0000.00.00.11.015
duration | Coded duration |
uint8_t ZAF_Actuator_GetCurrentValue | ( | s_Actuator * | pActuator | ) |
Returns current value.
pActuator | Pointer to Actuator struct for which current value was requested |
uint8_t ZAF_Actuator_GetDurationRemaining | ( | s_Actuator * | pActuator | ) |
Returns estimated time until target value is reached
pActuator | Pointer to Actuator struct for which remaining duration was requested |
uint8_t ZAF_Actuator_GetLastOnValue | ( | s_Actuator * | pActuator | ) |
Gets last ON value. If lastOnValue was never set, it returns zero. Then the caller has to use default ON value.
pActuator | Pointer to Actuator struct for which last On value was requested |
uint8_t ZAF_Actuator_GetMax | ( | s_Actuator * | pActuator | ) |
Returns value defined as maximum for pActuator
pActuator | Pointer to actuator |
uint8_t ZAF_Actuator_GetTargetValue | ( | s_Actuator * | pActuator | ) |
Returns target value.
pActuator | Pointer to Actuator struct for which target value was requested |
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 ) |
Initializes Actuator module
pActuator | Pointer to Actuator to be initialized |
minValue | Minimum possible value |
maxValue | Maximum possible value |
refreshRate | Minimal refresh rate in milliseconds. Tells how often the application should refresh it's state during timed changes. Actuator might adjust it to higher value, when number of steps between current and target value is low. |
durationDefault | Factory default duration |
cc_callback | Pointer to function in 'user' command class |
eActuatorState ZAF_Actuator_Set | ( | s_Actuator * | pActuator, |
uint8_t | value, | ||
uint8_t | duration ) |
Sets target value to value
in actuator pointed by pActuator
, during duration
period
[in,out] | pActuator | Pointer to Actuator that will be set to new value |
[in] | value | New target value |
[in] | duration | Time period that change should take. Actual time spent depends on number of steps between current and target value and refreshRate. Requested and actual time may differ slightly. |
eActuatorState ZAF_Actuator_StartChange | ( | s_Actuator * | pActuator, |
bool | ignoreStartLevel, | ||
bool | upDown, | ||
uint8_t | startLevel, | ||
uint8_t | duration ) |
Starts the change on actuator pointed by pActuator
[in,out] | pActuator | Pointer to object whose value will be updated |
[in] | ignoreStartLevel | Should startLevel be ignored. If yes, change starts from current level. |
[in] | upDown | Direction of change. FALSE for UP, TRUE for DOWN. |
[in] | startLevel | If not ignored, color will be first set to this level and then change will start |
[in] | duration | Time period that change should take. Actual time spent depends on number of steps between current and target value and refreshRate. Requested and actual time may differ slightly. |
eActuatorState ZAF_Actuator_StopChange | ( | s_Actuator * | pActuator | ) |
Stops ongoing change on actuator pointed by pActuator
pActuator | Pointer to object whose change should be stopped |