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
|
|
|
|
|
|
|
/// @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:
|
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
|
|
|
|
2012-08-17 03:21:08 -03:00
|
|
|
// set the relay status (on/off)
|
|
|
|
void set(bool status);
|
2011-10-01 19:55:41 -03:00
|
|
|
|
2012-08-17 03:21:08 -03:00
|
|
|
// get the relay status (on/off)
|
|
|
|
bool get();
|
2011-10-01 19:55:41 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* AP_RELAY_H_ */
|