2012-12-17 15:54:55 -04:00
|
|
|
|
|
|
|
#include "RCOutput.h"
|
2021-01-14 17:44:28 -04:00
|
|
|
#include <AP_Math/AP_Math.h>
|
2012-12-17 15:54:55 -04:00
|
|
|
|
|
|
|
using namespace Empty;
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
void RCOutput::init() {}
|
2012-12-17 15:54:55 -04:00
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
void RCOutput::set_freq(uint32_t chmask, uint16_t freq_hz) {}
|
2012-12-17 15:54:55 -04:00
|
|
|
|
2018-05-02 09:55:28 -03:00
|
|
|
uint16_t RCOutput::get_freq(uint8_t chan) {
|
2012-12-17 15:54:55 -04:00
|
|
|
return 50;
|
|
|
|
}
|
|
|
|
|
2018-05-02 09:55:28 -03:00
|
|
|
void RCOutput::enable_ch(uint8_t chan)
|
2012-12-17 15:54:55 -04:00
|
|
|
{}
|
|
|
|
|
2018-05-02 09:55:28 -03:00
|
|
|
void RCOutput::disable_ch(uint8_t chan)
|
2012-12-17 15:54:55 -04:00
|
|
|
{}
|
|
|
|
|
2018-05-02 09:55:28 -03:00
|
|
|
void RCOutput::write(uint8_t chan, uint16_t period_us)
|
2021-01-14 17:44:28 -04:00
|
|
|
{
|
|
|
|
if (chan < ARRAY_SIZE(value)) {
|
|
|
|
value[chan] = period_us;
|
|
|
|
}
|
|
|
|
}
|
2012-12-17 15:54:55 -04:00
|
|
|
|
2021-01-14 17:44:28 -04:00
|
|
|
uint16_t RCOutput::read(uint8_t chan)
|
|
|
|
{
|
|
|
|
if (chan < ARRAY_SIZE(value)) {
|
|
|
|
return value[chan];
|
|
|
|
}
|
2012-12-17 15:54:55 -04:00
|
|
|
return 900;
|
|
|
|
}
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
void RCOutput::read(uint16_t* period_us, uint8_t len)
|
2021-01-14 17:44:28 -04:00
|
|
|
{
|
|
|
|
len = MIN(len, ARRAY_SIZE(value));
|
|
|
|
memcpy(period_us, value, len*sizeof(value[0]));
|
|
|
|
}
|
2012-12-17 15:54:55 -04:00
|
|
|
|