|
LightHub 4.6.0
Open-source smart home controller firmware
|
Motorized gate/shutter driver with analog position feedback, channel type CH_MOTOR = 12. More...
#include <out_motor.h>
Public Member Functions | |
| void | link (Item *_item) |
| Links the channel item and reads the pin config from itemArg. | |
| int | Setup () override |
| Sets the up/down pins as outputs, the feedback pin as input, resets the action flags. | |
| int | Poll (short cause) override |
| Drives the motor toward the target position with speed ramp, enforces the max on-time, and stops at target. | |
| int | Stop () override |
| Deactivates both motor outputs and resets the channel state. | |
| int | getChanType () override |
| Returns CH_PWM (3). | |
| int | Ctrl (itemCmd cmd, char *subItem=NULL, bool toExecute=true, bool authorized=false) override |
| Sets the target position via /set (0-255) and /cmd on/off, requesting a move (see class doc). | |
| Public Member Functions inherited from abstractOut | |
| abstractOut () | |
| virtual int | isActive () |
| virtual bool | isAllowed (itemCmd cmd) |
| virtual itemCmd | getDefaultOnVal () |
| virtual int | Status () override |
| virtual void | setStatus (uint8_t status) override |
| Item * | getItem () |
| Public Member Functions inherited from abstractCh | |
| abstractCh () | |
| virtual | ~abstractCh () |
Public Attributes | |
| int8_t | pinUp |
| int8_t | pinDown |
| int8_t | pinFeedback |
| int16_t | maxOnTime |
| uint16_t | feedbackOpen |
| uint16_t | feedbackClosed |
| bool | inverted |
Protected Member Functions | |
| void | getConfig () |
| Protected Member Functions inherited from abstractOut | |
| int | pubAction (bool state) |
| Protected Member Functions inherited from abstractCh | |
| int | publishTopic (const char *topic, long value, const char *subtopic=NULL) |
| int | publishTopic (const char *topic, float value, const char *subtopic=NULL) |
| int | publishTopic (const char *topic, const char *value, const char *subtopic=NULL, const char *suffix=NULL) |
Additional Inherited Members | |
| Protected Attributes inherited from abstractOut | |
| Item * | item |
| Item currently linked to this driver. | |
Motorized gate/shutter driver with analog position feedback, channel type CH_MOTOR = 12.
Drives the up/down motor pins (with PWM speed control where the pins support PWM) until the analog feedback reaches the target position 0-255. No more than MOTOR_QUOTE (2) motors run simultaneously, and the motor is stopped after maxOnTime ms regardless of position.
JSON config (itemArg): [pinUp, pinDown, pinFeedback, fbOpen, fbClosed, maxOnTime_ms(default 10000)]
Ctrl: /set <0-255> - target position; /cmd on / off (off drives to 0).
The current position (0-255) is derived from the analog feedback pin.
|
overridevirtual |
Sets the target position via /set (0-255) and /cmd on/off, requesting a move (see class doc).
Implements abstractOut.
|
overridevirtual |
Returns CH_PWM (3).
Reimplemented from abstractOut.
|
protected |
|
inlinevirtual |
Links the channel item and reads the pin config from itemArg.
Reimplemented from abstractOut.
|
overridevirtual |
Drives the motor toward the target position with speed ramp, enforces the max on-time, and stops at target.
Reimplemented from abstractCh.
|
overridevirtual |
Sets the up/down pins as outputs, the feedback pin as input, resets the action flags.
Reimplemented from abstractOut.
|
overridevirtual |
Deactivates both motor outputs and resets the channel state.
Reimplemented from abstractCh.
| uint16_t out_Motor::feedbackClosed |
| uint16_t out_Motor::feedbackOpen |
| bool out_Motor::inverted |
| int16_t out_Motor::maxOnTime |
| int8_t out_Motor::pinDown |
| int8_t out_Motor::pinFeedback |
| int8_t out_Motor::pinUp |