From acfbddef0d4d677325773e5a0b60b5542834c396 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 27 Aug 2012 16:45:46 -0700 Subject: [PATCH] AP_HAL: proper RCOutput interface specification --- libraries/AP_HAL/RCOutput.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL/RCOutput.h b/libraries/AP_HAL/RCOutput.h index 33e3c872b2..1ec2690a70 100644 --- a/libraries/AP_HAL/RCOutput.h +++ b/libraries/AP_HAL/RCOutput.h @@ -6,8 +6,28 @@ class AP_HAL::RCOutput { public: - RCOutput() {} - virtual void init(int machtnicht) = 0; + virtual void init(void* implspecific) = 0; + + /* Output freq (1/period) control */ + virtual void set_freq(uint32_t chmask, uint16_t freq_hz) = 0; + virtual uint16_t get_freq(uint8_t ch) = 0; + + /* Output active/highZ control, either by single channel at a time + * or a mask of channels */ + virtual void enable_ch(uint8_t ch) = 0; + virtual void enable_mask(uint32_t chmask) = 0; + + virtual void disable_ch(uint8_t ch) = 0; + virtual void disable_mask(uint32_t chmask) = 0; + + /* Output, either single channel or bulk array of channels */ + virtual void write(uint8_t ch, uint16_t period_ms) = 0; + virtual void write(uint8_t ch, uint16_t* period_ms, uint8_t len) = 0; + + /* Read back current output state, as either single channel or + * array of channels. */ + virtual uint16_t read(uint8_t ch) = 0; + virtual void read(uint16_t* period_ms, uint8_t len) = 0; }; #endif // __AP_HAL_RC_OUTPUT_H__