2015-05-13 16:44:14 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
|
|
|
|
#include "AP_HAL_Linux.h"
|
|
|
|
#include "RCInput.h"
|
|
|
|
|
|
|
|
#define CHANNELS 8
|
|
|
|
|
2016-07-29 16:14:02 -03:00
|
|
|
namespace Linux {
|
|
|
|
|
|
|
|
class RCInput_UART : public RCInput
|
2015-05-13 16:44:14 -03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
RCInput_UART(const char *path);
|
|
|
|
~RCInput_UART();
|
|
|
|
|
2015-12-02 11:14:20 -04:00
|
|
|
void init() override;
|
2015-05-13 16:44:14 -03:00
|
|
|
void _timer_tick(void) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
int _fd;
|
|
|
|
uint8_t *_pdata;
|
|
|
|
ssize_t _remain;
|
2020-07-05 19:19:06 -03:00
|
|
|
struct {
|
2015-05-13 16:44:14 -03:00
|
|
|
uint16_t magic;
|
|
|
|
uint16_t values[CHANNELS];
|
|
|
|
} _data;
|
|
|
|
};
|
2016-07-29 16:14:02 -03:00
|
|
|
|
|
|
|
}
|