2011-11-12 22:57:42 -04:00
|
|
|
#ifndef __APM_RC_H__
|
|
|
|
#define __APM_RC_H__
|
2010-11-27 01:01:29 -04:00
|
|
|
|
2011-11-12 22:57:42 -04:00
|
|
|
#include <inttypes.h>
|
2010-11-27 01:01:29 -04:00
|
|
|
|
2011-09-11 18:07:30 -03:00
|
|
|
// Radio channels
|
|
|
|
// Note channels are from 0!
|
|
|
|
#define CH_1 0
|
|
|
|
#define CH_2 1
|
|
|
|
#define CH_3 2
|
|
|
|
#define CH_4 3
|
|
|
|
#define CH_5 4
|
|
|
|
#define CH_6 5
|
|
|
|
#define CH_7 6
|
|
|
|
#define CH_8 7
|
2011-11-15 19:56:10 -04:00
|
|
|
#define CH_9 8
|
2011-11-12 22:57:42 -04:00
|
|
|
#define CH_10 9
|
|
|
|
#define CH_11 10
|
2011-11-15 19:56:10 -04:00
|
|
|
|
|
|
|
#define MSK_CH_1 (1 << CH_1)
|
|
|
|
#define MSK_CH_2 (1 << CH_2)
|
|
|
|
#define MSK_CH_3 (1 << CH_3)
|
|
|
|
#define MSK_CH_4 (1 << CH_4)
|
|
|
|
#define MSK_CH_5 (1 << CH_5)
|
|
|
|
#define MSK_CH_6 (1 << CH_6)
|
|
|
|
#define MSK_CH_7 (1 << CH_7)
|
|
|
|
#define MSK_CH_8 (1 << CH_8)
|
|
|
|
#define MSK_CH_9 (1 << CH_9)
|
|
|
|
#define MSK_CH_10 (1 << CH_10)
|
|
|
|
#define MSK_CH_11 (1 << CH_11)
|
|
|
|
|
|
|
|
|
2011-09-11 18:07:30 -03:00
|
|
|
|
2011-11-12 22:57:42 -04:00
|
|
|
#define NUM_CHANNELS 8
|
2010-11-27 01:01:29 -04:00
|
|
|
|
|
|
|
class APM_RC_Class
|
|
|
|
{
|
|
|
|
public:
|
2011-11-12 22:57:42 -04:00
|
|
|
APM_RC_Class() {}
|
|
|
|
virtual void OutputCh(uint8_t ch, uint16_t pwm) = 0;
|
|
|
|
virtual uint16_t InputCh(uint8_t ch) = 0;
|
|
|
|
virtual uint8_t GetState() = 0;
|
|
|
|
virtual void clearOverride(void) = 0;
|
|
|
|
virtual void Force_Out() = 0;
|
2011-11-20 04:50:09 -04:00
|
|
|
virtual void SetFastOutputChannels( uint32_t channelmask ) = 0;
|
2010-11-27 01:01:29 -04:00
|
|
|
};
|
|
|
|
|
2011-11-12 22:57:42 -04:00
|
|
|
#include "APM_RC_APM1.h"
|
2011-11-25 19:11:14 -04:00
|
|
|
#include "APM_RC_APM2.h"
|
2010-11-27 01:01:29 -04:00
|
|
|
|
|
|
|
#endif
|