mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-02 14:13:42 -04:00
7ec02f491c
This commit changes the way libraries headers are included in source files: - If the header is in the same directory the source belongs to, so the notation '#include ""' is used with the path relative to the directory containing the source. - If the header is outside the directory containing the source, then we use the notation '#include <>' with the path relative to libraries folder. Some of the advantages of such approach: - Only one search path for libraries headers. - OSs like Windows may have a better lookup time.
49 lines
981 B
C++
49 lines
981 B
C++
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
/*
|
|
* AP_Relay.h
|
|
*
|
|
* Created on: Oct 2, 2011
|
|
* Author: Amilcar Lucas
|
|
*/
|
|
|
|
/// @file AP_Relay.h
|
|
/// @brief APM relay control class
|
|
|
|
#ifndef __AP_RELAY_H__
|
|
#define __AP_RELAY_H__
|
|
|
|
#include <AP_Param/AP_Param.h>
|
|
|
|
#define AP_RELAY_NUM_RELAYS 4
|
|
|
|
/// @class AP_Relay
|
|
/// @brief Class to manage the APM relay
|
|
class AP_Relay {
|
|
public:
|
|
AP_Relay();
|
|
|
|
// setup the relay pin
|
|
void init();
|
|
|
|
// activate the relay
|
|
void on(uint8_t relay);
|
|
|
|
// de-activate the relay
|
|
void off(uint8_t relay);
|
|
|
|
// see if the relay is enabled
|
|
bool enabled(uint8_t relay) { return relay < AP_RELAY_NUM_RELAYS && _pin[relay] != -1; }
|
|
|
|
// toggle the relay status
|
|
void toggle(uint8_t relay);
|
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
|
|
|
private:
|
|
AP_Int8 _pin[AP_RELAY_NUM_RELAYS];
|
|
AP_Int8 _default;
|
|
};
|
|
|
|
#endif /* AP_RELAY_H_ */
|