/* * AP_Relay.h * * Created on: Oct 2, 2011 * Author: Amilcar Lucas */ /// @file AP_Relay.h /// @brief APM relay control class #pragma once #include "AP_Relay_config.h" #if AP_RELAY_ENABLED #include #define AP_RELAY_NUM_RELAYS 6 /// @class AP_Relay /// @brief Class to manage the ArduPilot relay class AP_Relay { public: AP_Relay(); /* Do not allow copies */ CLASS_NO_COPY(AP_Relay); // setup the relay pin void init(); // set relay to state void set(uint8_t instance, bool value); // activate the relay void on(uint8_t instance) { set(instance, true); } // de-activate the relay void off(uint8_t instance) { set(instance, false); } // get state of relay uint8_t get(uint8_t instance) const { return instance < AP_RELAY_NUM_RELAYS ? _pin_states & (1U<