You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
500 B
45 lines
500 B
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- |
|
|
|
/* |
|
* AP_Relay.cpp |
|
* |
|
* Created on: Oct 2, 2011 |
|
* Author: Amilcar Lucas |
|
*/ |
|
|
|
#include <avr/io.h> |
|
#include "wiring.h" |
|
|
|
#include "AP_Relay.h" |
|
|
|
void AP_Relay::on() |
|
{ |
|
PORTL |= B00000100; |
|
} |
|
|
|
|
|
void AP_Relay::off() |
|
{ |
|
PORTL &= ~B00000100; |
|
} |
|
|
|
|
|
void AP_Relay::toggle() |
|
{ |
|
PORTL ^= B00000100; |
|
} |
|
|
|
|
|
void AP_Relay::set(bool status) |
|
{ |
|
if (status) |
|
on(); |
|
else |
|
off(); |
|
} |
|
|
|
|
|
bool AP_Relay::get() |
|
{ |
|
return PORTL & B00000100; |
|
}
|
|
|