2011-10-01 19:55:41 -03:00
|
|
|
// -*- 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
|
|
|
|
|
2012-11-30 21:47:32 -04:00
|
|
|
#ifndef __AP_RELAY_H__
|
|
|
|
#define __AP_RELAY_H__
|
2011-10-01 19:55:41 -03:00
|
|
|
|
2013-06-24 09:39:18 -03:00
|
|
|
#include <AP_Param.h>
|
|
|
|
|
2011-10-01 19:55:41 -03:00
|
|
|
/// @class AP_Relay
|
|
|
|
/// @brief Class to manage the APM relay
|
2012-08-17 03:21:08 -03:00
|
|
|
class AP_Relay {
|
2011-10-01 19:55:41 -03:00
|
|
|
public:
|
2013-06-24 09:39:18 -03:00
|
|
|
AP_Relay();
|
|
|
|
|
2012-12-04 19:26:30 -04:00
|
|
|
// setup the relay pin
|
|
|
|
void init();
|
|
|
|
|
2012-08-17 03:21:08 -03:00
|
|
|
// activate the relay
|
|
|
|
void on();
|
2011-10-01 19:55:41 -03:00
|
|
|
|
2012-08-17 03:21:08 -03:00
|
|
|
// de-activate the relay
|
|
|
|
void off();
|
2011-10-01 19:55:41 -03:00
|
|
|
|
2012-08-17 03:21:08 -03:00
|
|
|
// toggle the relay status
|
|
|
|
void toggle();
|
2011-10-01 19:55:41 -03:00
|
|
|
|
2013-06-24 09:39:18 -03:00
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
2011-10-01 19:55:41 -03:00
|
|
|
|
2013-06-24 09:39:18 -03:00
|
|
|
private:
|
|
|
|
AP_Int8 _pin;
|
2011-10-01 19:55:41 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* AP_RELAY_H_ */
|