2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_EMPTY_GPIO_H__
|
|
|
|
#define __AP_HAL_EMPTY_GPIO_H__
|
|
|
|
|
|
|
|
#include <AP_HAL_Empty.h>
|
|
|
|
|
|
|
|
class Empty::EmptyGPIO : public AP_HAL::GPIO {
|
2012-12-17 15:07:26 -04:00
|
|
|
public:
|
|
|
|
EmptyGPIO();
|
|
|
|
void init();
|
|
|
|
void pinMode(uint8_t pin, uint8_t output);
|
2013-03-21 22:31:14 -03:00
|
|
|
int8_t analogPinToDigitalPin(uint8_t pin);
|
2012-12-17 15:07:26 -04:00
|
|
|
uint8_t read(uint8_t pin);
|
|
|
|
void write(uint8_t pin, uint8_t value);
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2012-12-17 15:07:26 -04:00
|
|
|
/* Alternative interface: */
|
|
|
|
AP_HAL::DigitalSource* channel(uint16_t n);
|
|
|
|
|
|
|
|
/* Interrupt interface: */
|
|
|
|
bool attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p,
|
|
|
|
uint8_t mode);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class Empty::EmptyDigitalSource : public AP_HAL::DigitalSource {
|
|
|
|
public:
|
|
|
|
EmptyDigitalSource(uint8_t v);
|
|
|
|
void mode(uint8_t output);
|
|
|
|
uint8_t read();
|
|
|
|
void write(uint8_t value);
|
|
|
|
private:
|
|
|
|
uint8_t _v;
|
2012-12-14 21:55:38 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_EMPTY_GPIO_H__
|