#define RC_INPUT_MIN_PULSEWIDTH 900
#define RC_INPUT_MAX_PULSEWIDTH 2100
class AP_HAL::RCInput {
public:
/**
* Call init from the platform hal instance init, so that both the type of
* the RCInput implementation and init argument (e.g. ISRRegistry) are
* known to the programmer. (It's too difficult to describe this dependency
* in the C++ type system.)
*/
virtual void init() = 0;// 初始化订阅 orb_subscribe(ORB_ID(input_rc))消息
virtual void teardown() {};
/**
* Return true if there has been new input since the last call to new_input()
* 通过_rcin.timestamp_last_signal来判断是否有新的数值更新上来
*/
virtual bool new_input(void) = 0;
/**
* Return the number of valid channels in the last read
* 返回_rcin.channel_count的通道数目
*/
virtual uint8_t num_channels() = 0;
/* Read a single channel at a time */优先返回 _override[ch]的值,没有的情况下返回_rcin.values[ch]的值
virtual uint16_t read(uint8_t ch) = 0;
/* Read an array of channels, return the valid count */从_rcin.values[ch]中读取len个channel的值
virtual uint8_t read(uint16_t* periods, uint8_t len) = 0;
/**
* Overrides: these are really grody and don't