ardupilot/libraries/AP_HAL_Empty/GPIO.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
700 B
C++
Raw Normal View History

2013-09-19 03:26:14 -03:00
#include "GPIO.h"
using namespace Empty;
GPIO::GPIO()
2013-09-19 03:26:14 -03:00
{}
void GPIO::init()
2013-09-19 03:26:14 -03:00
{}
void GPIO::pinMode(uint8_t pin, uint8_t output)
2013-09-19 03:26:14 -03:00
{}
uint8_t GPIO::read(uint8_t pin) {
2013-09-19 03:26:14 -03:00
return 0;
}
void GPIO::write(uint8_t pin, uint8_t value)
2013-09-19 03:26:14 -03:00
{}
void GPIO::toggle(uint8_t pin)
2013-09-19 03:26:14 -03:00
{}
/* Alternative interface: */
AP_HAL::DigitalSource* GPIO::channel(uint16_t n) {
return new DigitalSource(0);
2013-09-19 03:26:14 -03:00
}
bool GPIO::usb_connected(void)
2013-09-19 03:26:14 -03:00
{
return false;
}
DigitalSource::DigitalSource(uint8_t v) :
2013-09-19 03:26:14 -03:00
_v(v)
{}
void DigitalSource::mode(uint8_t output)
2013-09-19 03:26:14 -03:00
{}
uint8_t DigitalSource::read() {
2013-09-19 03:26:14 -03:00
return _v;
}
void DigitalSource::write(uint8_t value) {
2013-09-19 03:26:14 -03:00
_v = value;
}
void DigitalSource::toggle() {
2013-09-19 03:26:14 -03:00
_v = !_v;
}