adapnex::core::RS
Bistable latch with dominant reset.
Description
Maintains a boolean state across execution cycles. If SET is true and RESET is false, the output Q becomes true. If RESET is true, the output Q becomes false, regardless of the state of SET. If both SET and RESET are true simultaneously, reset has priority and Q becomes false.
| Parameter | Type | Direction | Description |
|---|---|---|---|
|
|
Input |
Causes the output to become |
|
|
Input |
Causes the output to become |
|
|
Output |
The current stored state of the latch. |
Common Use Case
Safety‐critical start and stop circuits where an emergency stop or stop button must override a start command.
Example: Motor Control
class MotorControlTask : public Task {
public:
bool start_button = false;
bool stop_button = false;
bool motor_cmd = false;
private:
RS motor_latch;
void Update() override {
// If both buttons are pressed, stop_button wins (motor stays off).
motor_latch(start_button, stop_button, motor_cmd);
}
};
|
Bistable latches maintain state across cycles and must be instantiated as member variables of a task rather than locally within Update(). |