ardupilot/libraries/AP_HAL_Empty/GPIO.h

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

31 lines
787 B
C
Raw Normal View History

#pragma once
2013-09-19 03:26:14 -03:00
#include "AP_HAL_Empty.h"
2013-09-19 03:26:14 -03:00
class Empty::GPIO : public AP_HAL::GPIO {
2013-09-19 03:26:14 -03:00
public:
GPIO();
void init() override;
void pinMode(uint8_t pin, uint8_t output) override;
uint8_t read(uint8_t pin) override;
void write(uint8_t pin, uint8_t value) override;
void toggle(uint8_t pin) override;
2013-09-19 03:26:14 -03:00
/* Alternative interface: */
AP_HAL::DigitalSource* channel(uint16_t n) override;
2013-09-19 03:26:14 -03:00
/* return true if USB cable is connected */
bool usb_connected(void) override;
2013-09-19 03:26:14 -03:00
};
class Empty::DigitalSource : public AP_HAL::DigitalSource {
2013-09-19 03:26:14 -03:00
public:
DigitalSource(uint8_t v);
void mode(uint8_t output) override;
uint8_t read() override;
void write(uint8_t value) override;
void toggle() override;
2013-09-19 03:26:14 -03:00
private:
uint8_t _v;
};