2013-09-22 03:01:24 -03:00
|
|
|
#ifndef __AP_HAL_LINUX_GPIO_H__
|
|
|
|
#define __AP_HAL_LINUX_GPIO_H__
|
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_Linux.h"
|
2013-09-22 03:01:24 -03:00
|
|
|
|
2014-09-18 10:35:22 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
2015-01-10 19:20:38 -04:00
|
|
|
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLE || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI
|
2014-09-18 10:35:22 -03:00
|
|
|
#include "GPIO_BBB.h"
|
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO
|
|
|
|
#include "GPIO_RPI.h"
|
2014-07-13 19:44:59 -03:00
|
|
|
#endif
|
2014-06-04 05:44:57 -03:00
|
|
|
|
2013-09-22 03:01:24 -03:00
|
|
|
class Linux::LinuxDigitalSource : public AP_HAL::DigitalSource {
|
|
|
|
public:
|
|
|
|
LinuxDigitalSource(uint8_t v);
|
|
|
|
void mode(uint8_t output);
|
|
|
|
uint8_t read();
|
|
|
|
void write(uint8_t value);
|
|
|
|
void toggle();
|
|
|
|
private:
|
|
|
|
uint8_t _v;
|
2014-06-04 05:44:57 -03:00
|
|
|
|
2013-09-22 03:01:24 -03:00
|
|
|
};
|
|
|
|
|
2014-09-18 10:35:22 -03:00
|
|
|
#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
2013-09-22 03:01:24 -03:00
|
|
|
#endif // __AP_HAL_LINUX_GPIO_H__
|