2014-09-18 10:29:47 -03:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_LINUX_RCOUTPUT_NAVIO_H__
|
|
|
|
#define __AP_HAL_LINUX_RCOUTPUT_NAVIO_H__
|
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_Linux.h"
|
2014-09-18 10:29:47 -03:00
|
|
|
|
|
|
|
class Linux::LinuxRCOutput_Navio : public AP_HAL::RCOutput {
|
2015-03-01 16:35:07 -04:00
|
|
|
public:
|
|
|
|
LinuxRCOutput_Navio();
|
|
|
|
~LinuxRCOutput_Navio();
|
2014-09-18 10:29:47 -03:00
|
|
|
void init(void* machtnichts);
|
2015-02-26 07:40:24 -04:00
|
|
|
void reset_all_channels();
|
2014-09-18 10:29:47 -03:00
|
|
|
void set_freq(uint32_t chmask, uint16_t freq_hz);
|
|
|
|
uint16_t get_freq(uint8_t ch);
|
|
|
|
void enable_ch(uint8_t ch);
|
|
|
|
void disable_ch(uint8_t ch);
|
|
|
|
void write(uint8_t ch, uint16_t period_us);
|
|
|
|
void write(uint8_t ch, uint16_t* period_us, uint8_t len);
|
|
|
|
uint16_t read(uint8_t ch);
|
|
|
|
void read(uint16_t* period_us, uint8_t len);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void reset();
|
2015-03-01 16:35:07 -04:00
|
|
|
|
2014-09-18 10:29:47 -03:00
|
|
|
AP_HAL::Semaphore *_i2c_sem;
|
2014-11-26 05:37:07 -04:00
|
|
|
AP_HAL::DigitalSource *enable_pin;
|
2015-02-26 07:53:45 -04:00
|
|
|
uint16_t _frequency;
|
2015-03-01 16:35:07 -04:00
|
|
|
|
|
|
|
uint16_t *_pulses_buffer;
|
2014-09-18 10:29:47 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_LINUX_RCOUTPUT_NAVIO_H__
|