2012-12-17 23:56:21 -04:00
|
|
|
|
2016-01-03 17:22:02 -04:00
|
|
|
#pragma once
|
2012-12-17 23:56:21 -04:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2020-09-12 16:04:38 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL && !defined(HAL_BUILD_AP_PERIPH)
|
2016-01-03 17:22:02 -04:00
|
|
|
#define SITL_RC_INPUT_CHANNELS 16
|
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_SITL.h"
|
2012-12-17 23:56:21 -04:00
|
|
|
|
2016-01-10 02:23:32 -04:00
|
|
|
class HALSITL::RCInput : public AP_HAL::RCInput {
|
2012-12-17 23:56:21 -04:00
|
|
|
public:
|
2017-01-09 08:28:35 -04:00
|
|
|
explicit RCInput(SITL_State *sitlState): _sitlState(sitlState) {}
|
2016-01-03 17:22:02 -04:00
|
|
|
void init() override;
|
2017-01-09 08:28:35 -04:00
|
|
|
bool new_input() override;
|
2018-07-23 23:46:31 -03:00
|
|
|
uint8_t num_channels() override;
|
2016-01-03 17:22:02 -04:00
|
|
|
uint16_t read(uint8_t ch) override;
|
|
|
|
uint8_t read(uint16_t* periods, uint8_t len) override;
|
2012-12-17 23:56:21 -04:00
|
|
|
|
2019-06-17 09:10:26 -03:00
|
|
|
const char *protocol() const override { return "SITL"; }
|
|
|
|
|
2012-12-17 23:56:21 -04:00
|
|
|
private:
|
|
|
|
SITL_State *_sitlState;
|
2019-08-28 19:39:39 -03:00
|
|
|
bool using_rc_protocol;
|
2012-12-17 23:56:21 -04:00
|
|
|
};
|
|
|
|
|
2012-12-18 05:04:47 -04:00
|
|
|
#endif
|
2012-12-17 23:56:21 -04:00
|
|
|
|