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
|
2014-06-04 05:44:57 -03:00
|
|
|
|
2015-10-20 18:13:25 -03:00
|
|
|
class Linux::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();
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2015-07-07 10:36:14 -03: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
|
|
|
|
#include "GPIO_BBB.h"
|
2015-11-28 05:38:56 -04:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO || \
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_RASPILOT || \
|
|
|
|
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 || \
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXFMINI
|
2015-07-07 10:36:14 -03:00
|
|
|
#include "GPIO_RPI.h"
|
2015-10-21 12:18:27 -03:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_MINLURE
|
|
|
|
#include "GPIO_Minnow.h"
|
2015-11-26 09:37:11 -04:00
|
|
|
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
|
|
|
|
#include "GPIO_Bebop.h"
|
2015-07-07 10:36:14 -03:00
|
|
|
#endif
|
|
|
|
|
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__
|