2016-02-17 21:25:26 -04:00
|
|
|
#pragma once
|
2013-09-22 03:01:24 -03:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_Linux.h"
|
2013-09-22 03:01:24 -03:00
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
namespace Linux {
|
|
|
|
|
|
|
|
class DigitalSource : public AP_HAL::DigitalSource {
|
2013-09-22 03:01:24 -03:00
|
|
|
public:
|
2015-10-20 18:13:25 -03:00
|
|
|
DigitalSource(uint8_t v);
|
2013-09-22 03:01:24 -03:00
|
|
|
void mode(uint8_t output);
|
|
|
|
uint8_t read();
|
2016-05-17 23:26:57 -03:00
|
|
|
void write(uint8_t value);
|
2013-09-22 03:01:24 -03:00
|
|
|
void toggle();
|
|
|
|
private:
|
|
|
|
uint8_t _v;
|
2014-06-04 05:44:57 -03:00
|
|
|
|
2013-09-22 03:01:24 -03:00
|
|
|
};
|
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
}
|
|
|
|
|
2016-12-29 10:47:55 -04:00
|
|
|
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF || \
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLEBOARD || \
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI || \
|
2017-12-13 15:35:47 -04:00
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BLUE || \
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_POCKET
|
2015-07-07 10:36:14 -03:00
|
|
|
#include "GPIO_BBB.h"
|
2017-11-02 10:45:18 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2 || \
|
2016-01-05 06:28:27 -04:00
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BH || \
|
2016-10-17 15:02:48 -03:00
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DARK || \
|
2016-01-05 06:28:27 -04:00
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXFMINI
|
2015-07-07 10:36:14 -03:00
|
|
|
#include "GPIO_RPI.h"
|
2017-11-02 10:45:18 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO
|
|
|
|
#include "GPIO_Navio.h"
|
2017-11-02 10:44:55 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO2
|
|
|
|
#include "GPIO_Navio2.h"
|
2017-10-31 13:36:51 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_EDGE
|
|
|
|
#include "GPIO_Edge.h"
|
2015-10-21 12:18:27 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_MINLURE
|
|
|
|
#include "GPIO_Minnow.h"
|
2016-06-08 01:55:30 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
|
2015-11-26 09:37:11 -04:00
|
|
|
#include "GPIO_Bebop.h"
|
2016-06-08 01:55:30 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
|
|
|
|
#include "GPIO_Disco.h"
|
2016-08-29 14:10:04 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_AERO
|
|
|
|
#include "GPIO_Aero.h"
|
2015-07-07 10:36:14 -03:00
|
|
|
#endif
|